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. 10
      content_modeller/islandora_content_modeller.module
  2. 17
      plugins/FormBuilder.inc

10
content_modeller/islandora_content_modeller.module

@ -2684,8 +2684,9 @@ function icm_model_add_ingestFormElement(&$form_state,$params=null)
'other_select'=>t('Select (with \'other\' option)'),
'datepicker'=>t('Datepicker'),
'copyright'=>t('Creative-Commons Copyright Chooser'),
'hidden'=>t('Hidden'),
'file'=>t('File Upload (browse)'),
'hidden'=>t('Hidden'),
'file'=>t('File Upload (browse)'),
'markup'=>t('HTML Markup (no field)'),
),
'#description'=> t('The type of form element to display.')
);
@ -2849,8 +2850,9 @@ function icm_model_edit_ingestFormElement(&$form_state,$params=null)
'other_select'=>t('Select (with \'other\' option)'),
'datepicker'=>t('Datepicker'),
'copyright'=>t('Creative-Commons Copyright Chooser'),
'hidden'=>t('Hidden'),
'file'=>t('File Upload (browse)'),
'hidden'=>t('Hidden'),
'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.')
);

17
plugins/FormBuilder.inc

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

Loading…
Cancel
Save