Browse Source

refactored ingest form context title.

pull/656/head
MorganDawe 9 years ago
parent
commit
968485f148
  1. 26
      includes/ingest.form.inc

26
includes/ingest.form.inc

@ -925,27 +925,11 @@ function islandora_ingest_form_get_steps(array &$form_state) {
* Implements hook_form_alter(). * Implements hook_form_alter().
*/ */
function islandora_form_islandora_ingest_form_alter(&$form, &$form_state) { function islandora_form_islandora_ingest_form_alter(&$form, &$form_state) {
// Check if multiple content models are available to select from. foreach ($form_state['islandora']['shared_storage']['models'] as $key => $cmodel) {
if (count($form_state['islandora']['step_storage']['islandora_basic_collection_select_content_model']['models']) > 1) { $fedora_cmodel = islandora_object_load($cmodel);
if (!isset($form_state['islandora']['step_storage']['active_cmodel']) && $cmodel_label = $fedora_cmodel->{'label'};
isset($form_state['islandora']['step_storage']['islandora_basic_collection_select_content_model']['values'])) { $form["contact_information_$key"] = array(
$model = $form_state['islandora']['step_storage']['islandora_basic_collection_select_content_model']['values']['models']; '#markup' => "<h3>$cmodel_label</h3></br>",
$form_state['islandora']['step_storage']['active_cmodel'] = islandora_object_load($model);
}
}
else {
// Keep a reference to the only available cmodel, if it does not
// already exist.
if (!isset($form_state['islandora']['step_storage']['active_cmodel'])) {
$model = $form_state['islandora']['step_storage']['islandora_basic_collection_select_content_model']['models'][0];
$form_state['islandora']['step_storage']['active_cmodel'] = islandora_object_load($model);
}
}
if (isset($form_state['islandora']['step_storage']['active_cmodel'])) {
$label = $form_state['islandora']['step_storage']['active_cmodel']->{'label'};
$form['contact_information'] = array(
'#markup' => "<h3>$label</h3>",
'#weight' => -1000, '#weight' => -1000,
); );
} }

Loading…
Cancel
Save