Browse Source

Updated collection manager.

pull/120/head
jonathangreen 13 years ago
parent
commit
2cd4ca5eeb
  1. 2
      islandora_basic_collection/includes/ChangeContentModels.inc
  2. 11
      islandora_basic_collection/includes/ChildCollection.inc

2
islandora_basic_collection/includes/ChangeContentModels.inc

@ -28,7 +28,7 @@ function islandora_change_content_models_form($form, &$form_state, $collection_p
$collection_policy_datastream = $collection_object->getDatastream($collection_policy_dsid); $collection_policy_datastream = $collection_object->getDatastream($collection_policy_dsid);
$supported_collection_models = array(); $supported_collection_models = array();
if ($collection_policy_datastream->content) { if ($collection_policy_datastream && $collection_policy_datastream->content) {
$collection_policy = new CollectionPolicy($collection_policy_datastream->content); $collection_policy = new CollectionPolicy($collection_policy_datastream->content);
$supported_collection_models = $collection_policy->getContentModels(); $supported_collection_models = $collection_policy->getContentModels();
} }

11
islandora_basic_collection/includes/ChildCollection.inc

@ -86,18 +86,15 @@ function islandora_create_child_collection_form_validate($form, &$form_state) {
} }
function islandora_create_child_collection_form_submit($form, &$form_state) { function islandora_create_child_collection_form_submit($form, &$form_state) {
global $base_root; global $base_url;
module_load_include('inc', 'islandora', '/includes/islandora.ingest'); module_load_include('inc', 'islandora', '/includes/islandora.ingest');
$thumbnail = $base_root . '/' . drupal_get_path('module', 'islandora_basic_collection') . '/Crystal_Clear_filesystem_folder_grey.png'; $thumbnail = $base_url . '/' . drupal_get_path('module', 'islandora_basic_collection') . '/Crystal_Clear_filesystem_folder_grey.png';
$new_collection_pid = $form_state['values']['new_collection_pid']; $new_collection_pid = $form_state['values']['new_collection_pid'];
$new_collection_label = $form_state['values']['collection_name']; $new_collection_label = $form_state['values']['collection_name'];
$namespace = $form_state['values']['collection_namespace']; $namespace = $form_state['values']['collection_namespace'];
// $all_cModels = get_content_models_as_option_array(); // $all_cModels = get_content_models_as_option_array();
$content_models = array('islandora:collectionCModel'); $content_models = array(array('pid' => 'islandora:collectionCModel'));
$relationship = array( $relationship = 'isMemberOfCollection';
'uri' => FEDORA_RELS_EXT_URI,
'value' => 'isMemberOfCollection',
);
$fedora_object = islandora_ingest_get_object($content_models, $form_state['values']['current'], $relationship, $new_collection_pid); $fedora_object = islandora_ingest_get_object($content_models, $form_state['values']['current'], $relationship, $new_collection_pid);
$fedora_object->label = $new_collection_label; $fedora_object->label = $new_collection_label;

Loading…
Cancel
Save