Browse Source

Added simple display for single CModel ingest step.

pull/656/head
MorganDawe 9 years ago
parent
commit
1b38ba21b0
  1. 21
      includes/ingest.form.inc

21
includes/ingest.form.inc

@ -497,8 +497,9 @@ function islandora_ingest_form_add_step_context(array &$form, array $form_state)
foreach ($form_state['islandora']['shared_storage']['models'] as $key => $value) { foreach ($form_state['islandora']['shared_storage']['models'] as $key => $value) {
$fedora_cmodel = islandora_object_load($value); $fedora_cmodel = islandora_object_load($value);
if ($fedora_cmodel) { if ($fedora_cmodel) {
$items = array(); $element;
if (is_array($form_state['islandora']['shared_storage']['collection'])) { if (is_array($form_state['islandora']['shared_storage']['collection'])) {
$items = array();
// Form state config allows for multiple collection objects. // Form state config allows for multiple collection objects.
foreach ($form_state['islandora']['shared_storage']['collection'] as $collection) { foreach ($form_state['islandora']['shared_storage']['collection'] as $collection) {
$policy = new CollectionPolicy($collection['COLLECTION_POLICY']->content); $policy = new CollectionPolicy($collection['COLLECTION_POLICY']->content);
@ -506,20 +507,24 @@ function islandora_ingest_form_add_step_context(array &$form, array $form_state)
$label = isset($policy_content_models[$value]) ? $policy_content_models[$value]['name'] : $fedora_cmodel->label; $label = isset($policy_content_models[$value]) ? $policy_content_models[$value]['name'] : $fedora_cmodel->label;
$items[] = $label; $items[] = $label;
} }
$element = array(
'#title' => t("Applicable Content Models"),
'#theme' => 'item_list',
'#items' => $items,
'#weight' => -1000,
);
} }
else { else {
$policy = new CollectionPolicy($form_state['islandora']['shared_storage']['collection']['COLLECTION_POLICY']->content); $policy = new CollectionPolicy($form_state['islandora']['shared_storage']['collection']['COLLECTION_POLICY']->content);
$policy_content_models = $policy->getContentModels(); $policy_content_models = $policy->getContentModels();
$label = isset($policy_content_models[$value]) ? $policy_content_models[$value]['name'] : $fedora_cmodel->label; $label = isset($policy_content_models[$value]) ? $policy_content_models[$value]['name'] : $fedora_cmodel->label;
$items[] = $label; $element = array(
'#markup' => "<h3>$label</h3>",
'#weight' => -1000,
);
} }
$form["islandora-ingest-form-step-context"] = array( $form["islandora-ingest-form-step-context"] = $element;
'#title' => t("Applicable Content Models"),
'#theme' => 'item_list',
'#items' => $items,
'#weight' => -1000,
);
} }
} }
} }

Loading…
Cancel
Save