diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index f3cde3e5..d804f1b4 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -476,11 +476,38 @@ function islandora_ingest_form_stepify(array $form, array &$form_state, array $s $form['hidden_next']['#prefix'] = '
'; } + + // Add active CModel header to the form. + islandora_ingest_form_add_step_context($form, $form_state); + // Allow for a hook_form_FORM_ID_alter(). drupal_alter(array('form_' . $step['form_id'], 'form'), $form, $form_state, $step['form_id']); return $form; } +/** + * Append CModel label to the top of the step's form. + * + * @param array $form + * The Drupal form. + * @param array $form_state + * The Drupal form state. + */ +function islandora_ingest_form_add_step_context(array &$form, array $form_state) { + foreach ($form_state['islandora']['shared_storage']['models'] as $key => $value) { + $fedora_cmodel = islandora_object_load($value); + if ($fedora_cmodel) { + $policy = new CollectionPolicy($form_state['islandora']['shared_storage']['collection']['COLLECTION_POLICY']->content); + $policy_content_models = $policy->getContentModels(); + $label = isset($policy_content_models[$value]) ? $policy_content_models[$value]['name'] : $fedora_cmodel->label; + $form["context_info_$key"] = array( + '#markup' => "