Browse Source

Added markup field type. Updated form builder to accept the new markup element type.

pull/105/head
mroy 14 years ago
parent
commit
5987a08c29
  1. 2
      content_modeller/islandora_content_modeller.module
  2. 5
      plugins/FormBuilder.inc

2
content_modeller/islandora_content_modeller.module

@ -2686,6 +2686,7 @@ function icm_model_add_ingestFormElement(&$form_state,$params=null)
'copyright'=>t('Creative-Commons Copyright Chooser'), 'copyright'=>t('Creative-Commons Copyright Chooser'),
'hidden'=>t('Hidden'), 'hidden'=>t('Hidden'),
'file'=>t('File Upload (browse)'), 'file'=>t('File Upload (browse)'),
'markup'=>t('HTML Markup (no field)'),
), ),
'#description'=> t('The type of form element to display.') '#description'=> t('The type of form element to display.')
); );
@ -2851,6 +2852,7 @@ function icm_model_edit_ingestFormElement(&$form_state,$params=null)
'copyright'=>t('Creative-Commons Copyright Chooser'), 'copyright'=>t('Creative-Commons Copyright Chooser'),
'hidden'=>t('Hidden'), 'hidden'=>t('Hidden'),
'file'=>t('File Upload (browse)'), 'file'=>t('File Upload (browse)'),
'markup'=>t('HTML Markup (no field)'),
), ),
'#description'=> t('The type of form element to display. <br/><b>Warning:</b> Changing the type from "Select" or "Radio" to anything else will cause any authoritative list to be permanently removed.') '#description'=> t('The type of form element to display. <br/><b>Warning:</b> Changing the type from "Select" or "Radio" to anything else will cause any authoritative list to be permanently removed.')
); );

5
plugins/FormBuilder.inc

@ -312,12 +312,17 @@ class FormBuilder {
); );
foreach ($elements as $element) { foreach ($elements as $element) {
if ($element['type'] == 'markup') {
$el = array('#value'=> $element['description']);
} else {
$el = array( $el = array(
'#title' => $element['label'], '#title' => $element['label'],
'#required' => ($element['required'] ? 1 : 0), '#required' => ($element['required'] ? 1 : 0),
'#description' => $element['description'], '#description' => $element['description'],
'#type' => $element['type'] '#type' => $element['type']
); );
}
$name = explode('][', $element['name']); $name = explode('][', $element['name']);
$elLocation = &$form['indicator2']; $elLocation = &$form['indicator2'];

Loading…
Cancel
Save