|
|
@ -378,56 +378,59 @@ class ObjectHelper { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getFormattedDatastreamList($object_pid, $contentModels, &$fedoraItem) { |
|
|
|
function getFormattedDatastreamList($object_pid, $contentModels, &$fedoraItem) { |
|
|
|
$availableDataStreamsText = 'Detailed List of Content'; |
|
|
|
if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) { |
|
|
|
//$metaDataText='Description'; |
|
|
|
$availableDataStreamsText = 'Detailed List of Content'; |
|
|
|
$mainStreamLabel = NULL; |
|
|
|
//$metaDataText='Description'; |
|
|
|
$object = $fedoraItem->get_datastreams_list_as_SimpleXML(); |
|
|
|
$mainStreamLabel = NULL; |
|
|
|
if (!isset($object)) { |
|
|
|
$object = $fedoraItem->get_datastreams_list_as_SimpleXML(); |
|
|
|
drupal_set_message(t("No datastreams available")); |
|
|
|
if (!isset($object)) { |
|
|
|
return ' '; |
|
|
|
drupal_set_message(t("No datastreams available")); |
|
|
|
} |
|
|
|
return ' '; |
|
|
|
$hasOBJStream = NULL; |
|
|
|
} |
|
|
|
$hasTNStream = FALSE; |
|
|
|
$hasOBJStream = NULL; |
|
|
|
$dataStreamBody = "<br /><table>\n"; |
|
|
|
$hasTNStream = FALSE; |
|
|
|
|
|
|
|
$dataStreamBody = "<br /><table>\n"; |
|
|
|
$cmDatastreams = array(); |
|
|
|
|
|
|
|
if (variable_get('fedora_object_restrict_datastreams', FALSE) == TRUE && ($cm = ContentModel::loadFromObject($object_pid)) !== FALSE) { |
|
|
|
$cmDatastreams = array(); |
|
|
|
$cmDatastreams = $cm->listDatastreams(); |
|
|
|
if (variable_get('fedora_object_restrict_datastreams', FALSE) == TRUE && ($cm = ContentModel::loadFromObject($object_pid)) !== FALSE) { |
|
|
|
} |
|
|
|
$cmDatastreams = $cm->listDatastreams(); |
|
|
|
|
|
|
|
} |
|
|
|
$dataStreamBody .= $this->get_parent_objects_asHTML($object_pid); |
|
|
|
|
|
|
|
$dataStreamBody .= '<tr><th colspan="4"><h3>' . t("!text", array('!text' => $availableDataStreamsText)) . '</h3></th></tr>'; |
|
|
|
$dataStreamBody .= $this->get_parent_objects_asHTML($object_pid); |
|
|
|
foreach ($object as $datastream) { |
|
|
|
$dataStreamBody .= '<tr><th colspan="4"><h3>' . t("!text", array('!text' => $availableDataStreamsText)) . '</h3></th></tr>'; |
|
|
|
foreach ($datastream as $datastreamValue) { |
|
|
|
foreach ($object as $datastream) { |
|
|
|
|
|
|
|
foreach ($datastream as $datastreamValue) { |
|
|
|
if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator',$user->roles)) || in_array($datastreamValue->ID,$cmDatastreams))) { |
|
|
|
|
|
|
|
if ($datastreamValue->ID == 'OBJ') { |
|
|
|
if (variable_get('fedora_object_restrict_datastreams', FALSE) == FALSE || ((isset($user) && in_array('administrator',$user->roles)) || in_array($datastreamValue->ID,$cmDatastreams))) { |
|
|
|
$hasOBJStream = '1'; |
|
|
|
if ($datastreamValue->ID == 'OBJ') { |
|
|
|
$mainStreamLabel = $datastreamValue->label; |
|
|
|
$hasOBJStream = '1'; |
|
|
|
$mainStreamLabel = str_replace("_", " ", $mainStreamLabel); |
|
|
|
$mainStreamLabel = $datastreamValue->label; |
|
|
|
} |
|
|
|
$mainStreamLabel = str_replace("_", " ", $mainStreamLabel); |
|
|
|
if ($datastreamValue->ID == 'TN') { |
|
|
|
} |
|
|
|
$hasTNStream = TRUE; |
|
|
|
if ($datastreamValue->ID == 'TN') { |
|
|
|
|
|
|
|
$hasTNStream = TRUE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//create the links to each datastream |
|
|
|
|
|
|
|
$dataStreamBody .= $this->create_link_for_ds($object_pid, $datastreamValue); //"<tr><td><b>$key :</b></td><td>$value</td></tr>\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
//create the links to each datastream |
|
|
|
|
|
|
|
$dataStreamBody .= $this->create_link_for_ds($object_pid, $datastreamValue); //"<tr><td><b>$key :</b></td><td>$value</td></tr>\n"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$dataStreamBody .= "</table>\n"; |
|
|
|
$dataStreamBody .= "</table>\n"; |
|
|
|
//if they have access let them add a datastream |
|
|
|
//if they have access let them add a datastream |
|
|
|
if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { |
|
|
|
if (user_access(ObjectHelper :: $ADD_FEDORA_STREAMS)) { |
|
|
|
$allow=TRUE; |
|
|
|
$allow=TRUE; |
|
|
|
if (module_exists('fedora_fesl')) { |
|
|
|
if (module_exists('fedora_fesl')) { |
|
|
|
$allow= fedora_fesl_check_roles($object_pid,'write'); |
|
|
|
$allow= fedora_fesl_check_roles($object_pid,'write'); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($allow) { |
|
|
|
if ($allow) { |
|
|
|
$dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); |
|
|
|
$dataStreamBody .= drupal_get_form('add_stream_form', $object_pid); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$dataStreamBody = '<div class = "fedora_detailed_list">' . $dataStreamBody . '</div>'; |
|
|
|
|
|
|
|
return $dataStreamBody; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return ''; |
|
|
|
$dataStreamBody = '<div class = "fedora_detailed_list">' . $dataStreamBody . '</div>'; |
|
|
|
|
|
|
|
return $dataStreamBody; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -454,9 +457,8 @@ class ObjectHelper { |
|
|
|
$dataStreamBody = ''; |
|
|
|
$dataStreamBody = ''; |
|
|
|
$fedoraItem = new Fedora_Item($object_pid); |
|
|
|
$fedoraItem = new Fedora_Item($object_pid); |
|
|
|
|
|
|
|
|
|
|
|
if (user_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST)) { |
|
|
|
|
|
|
|
$dataStreamBody = $this->getFormattedDatastreamList($object_pid, $contentModels, $fedoraItem); |
|
|
|
$dataStreamBody = $this->getFormattedDatastreamList($object_pid, $contentModels, $fedoraItem); |
|
|
|
} |
|
|
|
|
|
|
|
$content = ''; |
|
|
|
$content = ''; |
|
|
|
|
|
|
|
|
|
|
|
if (empty($contentModels)) { |
|
|
|
if (empty($contentModels)) { |
|
|
|