Browse Source

ISLANDORA-260 Missing PID now shows 404 page

pull/7/head
Alan Stanley 14 years ago
parent
commit
8a1e300742
  1. 156
      fedora_repository.module

156
fedora_repository.module

@ -437,7 +437,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) {
} }
elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) { elseif (empty($collectionPid) && !empty($_SESSION['fedora_collection']) && $_SESSION['fedora_collection'] != $pid) {
$collectionPid = $_SESSION['fedora_collection']; $collectionPid = $_SESSION['fedora_collection'];
$form_state['redirect'] = "fedora/repository/$collectionPid/"; $form_state['redirect'] = "fedora/repository/$collectionPid/";
} }
else { else {
@ -529,14 +529,14 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$dsid = $form_state['values']['dsId']; $dsid = $form_state['values']['dsId'];
$dsLabel = $form_state['values']['dsLabel']; $dsLabel = $form_state['values']['dsLabel'];
// Remove the original file extension from the label and add the new one // Remove the original file extension from the label and add the new one
$indexOfDot = strrpos($dsLabel,'.');//use strrpos to get the last dot $indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot
if($indexOfDot !== FALSE){ if ($indexOfDot !== FALSE) {
$dsLabel = substr($dsLabel, 0, $indexOfDot); $dsLabel = substr($dsLabel, 0, $indexOfDot);
$dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.; $dsLabel .= substr($file->filename, strrpos($file->filename, '.')); // Add the file extention to the end of the label.;
} }
module_load_include('inc', 'Fedora_Repository', 'MimeClass'); module_load_include('inc', 'Fedora_Repository', 'MimeClass');
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$file_basename = basename($file->filepath); $file_basename = basename($file->filepath);
$file_directory = dirname($file->filepath); $file_directory = dirname($file->filepath);
$streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename); $streamUrl = $base_url . '/' . $file_directory . '/' . urlencode($file_basename);
@ -548,11 +548,10 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$dformat = $mimetype->getType($file->filepath); $dformat = $mimetype->getType($file->filepath);
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
$item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); $item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat);
$form_state['redirect'] = 'fedora/repository/' . $pid;
$form_state['redirect'] = 'fedora/repository/' . $pid;
} }
function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) { function fedora_repository_edit_qdc_page($pid = NULL, $dsId = NULL) {
@ -721,16 +720,20 @@ function makeObject($pid, $dsID) {
function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) { function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NULL, $page_number = NULL, $limit = NULL) {
module_load_include('inc', 'fedora_repository', 'ObjectHelper'); module_load_include('inc', 'fedora_repository', 'ObjectHelper');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
global $user; global $user;
if (!fedora_available()) { if (!fedora_available()) {
drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE); drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE);
return ''; return '';
} }
if ($pid &!validPid($pid)) {
$item = new fedora_item($pid);
if (!$item->exists()) {
drupal_not_found();
}
if ($pid & !validPid($pid)) {
drupal_set_message(t("Invalid PID!"), 'error'); drupal_set_message(t("Invalid PID!"), 'error');
return ' '; return ' ';
} }
@ -740,8 +743,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
return ' '; return ' ';
} }
if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) {
//drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error');
if (user_access('access administration pages')) { if (user_access('access administration pages')) {
drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning');
} }
@ -769,13 +770,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
$collectionClass = new CollectionClass(); $collectionClass = new CollectionClass();
//if(!isset($pageNumber)){
// $pageNumber=0;
//}
//if(!isset($limit)){
// $limit=20;
//}
module_load_include('inc', 'fedora_repository', 'ContentModel'); module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject'); module_load_include('inc', 'fedora_repository', 'plugins/fedoraObject');
$breadcrumbs = array(); $breadcrumbs = array();
@ -783,15 +777,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
drupal_set_breadcrumb(array_reverse($breadcrumbs)); drupal_set_breadcrumb(array_reverse($breadcrumbs));
$offset = $limit * $page_number; $offset = $limit * $page_number;
//$results = $collectionClass->getRelatedObjects($pid, $limit, $offset, NULL); //updated so we can do paging in query not in xslt
//$results = $collectionClass->getRelatedItems($pid, NULL);
$content_models = $objectHelper->get_content_models_list($pid); $content_models = $objectHelper->get_content_models_list($pid);
// Each content model may return either a tabset array or plain HTML. If it's HTML, stick it in a tab. // Each content model may return either a tabset array or plain HTML. If it's HTML, stick it in a tab.
$cmodels_tabs = array( $cmodels_tabs = array(
'#type' => 'tabset', '#type' => 'tabset',
); );
foreach ($content_models as $content_model) { foreach ($content_models as $content_model) {
//$content_model_fieldsets = $objectHelper->createExtraFieldsets($pid, $content_model, $pageNumber);
$content_model_fieldset = $content_model->displayExtraFieldset($pid, $page_number); $content_model_fieldset = $content_model->displayExtraFieldset($pid, $page_number);
if (is_array($content_model_fieldset)) { if (is_array($content_model_fieldset)) {
$cmodels_tabs = array_merge($cmodels_tabs, $content_model_fieldset); $cmodels_tabs = array_merge($cmodels_tabs, $content_model_fieldset);
@ -808,13 +799,6 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
$obj = new FedoraObject($pid); $obj = new FedoraObject($pid);
$object_details = $obj->showFieldSets(); $object_details = $obj->showFieldSets();
$cmodels_tabs = array_merge($cmodels_tabs, $object_details); $cmodels_tabs = array_merge($cmodels_tabs, $object_details);
//$content .= $objectHelper
//$content .= $objectHelper->parseContent($results, $pid, $dsId, $collection, $pageNumber);
//the below is for islandlives we should be able to do this in the xslt though
//$css=$path.'/stylesheets/container-large.css';
//drupal_add_css($css);
return tabs_render($cmodels_tabs); return tabs_render($cmodels_tabs);
} }
@ -1182,7 +1166,6 @@ function fedora_repository_theme() {
'arguments' => array( 'arguments' => array(
'element' => NULL 'element' => NULL
), ),
'fedora_repository_solution_packs_list' => array( 'fedora_repository_solution_packs_list' => array(
'arguments' => array( 'arguments' => array(
'solution_packs' => NULL, 'solution_packs' => NULL,
@ -1265,10 +1248,10 @@ function fedora_repository_demo_objects_form() {
); );
foreach (array( foreach (array(
'islandora:collectionCModel' => 'Islandora default content models', 'islandora:collectionCModel' => 'Islandora default content models',
'islandora:top' => 'Islandora top-level collection', 'islandora:top' => 'Islandora top-level collection',
'islandora:demos' => 'Islandora demos collection', 'islandora:demos' => 'Islandora demos collection',
'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)',
) )
as $available_demo => $available_demo_desc) { as $available_demo => $available_demo_desc) {
try { try {
@ -1415,7 +1398,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
$smiley_stuff->add_relationship('isMemberOfCollection', 'info:fedora/islandora:demos'); $smiley_stuff->add_relationship('isMemberOfCollection', 'info:fedora/islandora:demos');
$tn = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/smileytn.png', 'TN', 'Thumbnail.png', 'image/png', 'M'); $tn = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/smileytn.png', 'TN', 'Thumbnail.png', 'image/png', 'M');
$cp = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/JPG-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy.xml', 'application/xml', 'X'); $cp = $smiley_stuff->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/JPG-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy.xml', 'application/xml', 'X');
$cm = new Fedora_Item('demo:DualResImage'); $cm = new Fedora_Item('demo:DualResImage');
try { try {
$cmstream = $cm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STANDARD JPG.xml', 'ISLANDORACM', 'Content Model.xml', 'application/xml', 'X'); $cmstream = $cm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STANDARD JPG.xml', 'ISLANDORACM', 'Content Model.xml', 'application/xml', 'X');
@ -1456,16 +1439,15 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
} }
} }
function fedora_repository_required_fedora_objects() { function fedora_repository_required_fedora_objects() {
// array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required) // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required)
$module_path = drupal_get_path('module', 'fedora_repository'); $module_path = drupal_get_path('module', 'fedora_repository');
return array ( return array(
'fedora_repository' => array( 'fedora_repository' => array(
'module' => 'fedora_repository', 'module' => 'fedora_repository',
'title' => 'Islandora Core', 'title' => 'Islandora Core',
'objects' => array ( 'objects' => array(
array ( array(
'pid' => 'islandora:collectionCModel', 'pid' => 'islandora:collectionCModel',
'label' => 'Islandora Collection Content Model', 'label' => 'Islandora Collection Content Model',
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
@ -1473,7 +1455,7 @@ function fedora_repository_required_fedora_objects() {
'dsversion' => 2, 'dsversion' => 2,
'cmodel' => 'fedora-system:ContentModel-3.0', 'cmodel' => 'fedora-system:ContentModel-3.0',
), ),
array ( array(
'pid' => 'islandora:strict_pdf', 'pid' => 'islandora:strict_pdf',
'label' => 'Islandora strict PDF content model', 'label' => 'Islandora strict PDF content model',
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
@ -1484,85 +1466,85 @@ function fedora_repository_required_fedora_objects() {
'pid' => 'islandora:top', 'pid' => 'islandora:top',
'label' => 'Islandora Top-level Collection', 'label' => 'Islandora Top-level Collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:ContentModelCollection', 'pid' => 'islandora:ContentModelCollection',
'label' => 'Collection of installed content models', 'label' => 'Collection of installed content models',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:top', 'parent' => 'islandora:top',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_VIEW', 'dsid' => 'COLLECTION_VIEW',
'datastream_file' => "$module_path/collection_views/simple_list_view.xml", 'datastream_file' => "$module_path/collection_views/simple_list_view.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/contentModel.jpg", 'datastream_file' => "$module_path/images/contentModel.jpg",
'mimetype' => 'image/jpeg', 'mimetype' => 'image/jpeg',
), ),
array ( array(
'dsid' => 'QUERY', 'dsid' => 'QUERY',
'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt", 'datastream_file' => "$module_path/collection_views/cmodel_collection_query.txt",
'mimetype' => 'text/plain', 'mimetype' => 'text/plain',
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:demos', 'pid' => 'islandora:demos',
'label' => 'Islandora demos collection', 'label' => 'Islandora demos collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:top', 'parent' => 'islandora:top',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/COLLECTION-COLLECTION POLICY.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'islandora:pdf_collection', 'pid' => 'islandora:pdf_collection',
'label' => 'Islandora Demo PDF Collection', 'label' => 'Islandora Demo PDF Collection',
'cmodel' => 'islandora:collectionCModel', 'cmodel' => 'islandora:collectionCModel',
'parent' => 'islandora:demos', 'parent' => 'islandora:demos',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png", 'datastream_file' => "$module_path/images/Crystal_Clear_mimetype_pdf.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/PDF-COLLECTION POLICY.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResImage', 'pid' => 'demo:DualResImage',
'foxml_file' => "$module_path/content_models/demo_DualResImage.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImage.xml",
'datastreams' => array( 'datastreams' => array(
array ( array(
'dsid' => 'ISLANDORACM', 'dsid' => 'ISLANDORACM',
'datastream_file' => "$module_path/content_models/STANDARD JPG.xml", 'datastream_file' => "$module_path/content_models/STANDARD JPG.xml",
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResImageCollection', 'pid' => 'demo:DualResImageCollection',
'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImageCollection.xml",
'datastreams' => array( 'datastreams' => array(
@ -1572,51 +1554,51 @@ function fedora_repository_required_fedora_objects() {
), ),
), ),
), ),
array ( array(
'pid' => 'demo:DualResolution', 'pid' => 'demo:DualResolution',
'foxml_file' => "$module_path/content_models/demo_DualResolution.xml", 'foxml_file' => "$module_path/content_models/demo_DualResolution.xml",
), ),
array ( array(
'pid' => 'demo:DualResImageImpl', 'pid' => 'demo:DualResImageImpl',
'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml", 'foxml_file' => "$module_path/content_models/demo_DualResImageImpl.xml",
), ),
array ( array(
'pid' => 'demo:CollectionImpl', 'pid' => 'demo:CollectionImpl',
'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml", 'foxml_file' => "$module_path/content_models/demo_CollectionImpl.xml",
), ),
array ( array(
'pid' => 'demo:Collection', 'pid' => 'demo:Collection',
'foxml_file' => "$module_path/content_models/demo_Collection.xml", 'foxml_file' => "$module_path/content_models/demo_Collection.xml",
), ),
array ( array(
'pid' => 'islandora:demo_image_collection', 'pid' => 'islandora:demo_image_collection',
'label' => 'Demo Image Collection', 'label' => 'Demo Image Collection',
'cmodel' => 'demo:DualResImageCollection', 'cmodel' => 'demo:DualResImageCollection',
'parent' => 'islandora:demos', 'parent' => 'islandora:demos',
'datastreams' => array ( 'datastreams' => array(
array ( array(
'dsid' => 'COLLECTION_POLICY', 'dsid' => 'COLLECTION_POLICY',
'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml", 'datastream_file' => "$module_path/collection_policies/JPG-COLLECTION POLICY.xml",
), ),
array ( array(
'dsid' => 'TN', 'dsid' => 'TN',
'datastream_file' => "$module_path/images/Gnome-emblem-photos.png", 'datastream_file' => "$module_path/images/Gnome-emblem-photos.png",
'mimetype' => 'image/png', 'mimetype' => 'image/png',
), ),
array ( array(
'dsid' => 'COLLECTION_VIEW', 'dsid' => 'COLLECTION_VIEW',
'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_view.xml",
), ),
array ( array(
'dsid' => 'QUERY', 'dsid' => 'QUERY',
'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt", 'datastream_file' => "$module_path/collection_views/standard_jpeg_collection_query.txt",
'mimetype' => 'text/plain', 'mimetype' => 'text/plain',
), ),
array ( array(
'dsid' => 'DC', 'dsid' => 'DC',
'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml", 'datastream_file' => "$module_path/collection_views/demo_image_collection_dc_record.xml",
), ),
), ),
), ),
), ),
), ),
@ -1966,7 +1948,6 @@ function fedora_repository_display_schema($file) {
return; return;
} }
function fedora_repository_batch_reingest_object($object, &$context) { function fedora_repository_batch_reingest_object($object, &$context) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
@ -1991,8 +1972,8 @@ function fedora_repository_batch_reingest_object($object, &$context) {
} }
} }
if (!empty($object['dsid']) && !empty($object['datastream_file'])) { if (!empty($object['dsid']) && !empty($object['datastream_file'])) {
$datastreams = array ( $datastreams = array(
array ( array(
'dsid' => $object['dsid'], 'dsid' => $object['dsid'],
'datastream_file' => $object['datastream_file'], 'datastream_file' => $object['datastream_file'],
) )
@ -2001,19 +1982,19 @@ function fedora_repository_batch_reingest_object($object, &$context) {
elseif (!empty($object['datastreams'])) { elseif (!empty($object['datastreams'])) {
$datastreams = $object['datastreams']; $datastreams = $object['datastreams'];
} }
if (!empty($datastreams) && is_array($datastreams)) { if (!empty($datastreams) && is_array($datastreams)) {
$label = !empty($object['label']) ? $object['label'] : ''; $label = !empty($object['label']) ? $object['label'] : '';
if (empty($object['foxml_file']) && !defined($new_item)) { if (empty($object['foxml_file']) && !defined($new_item)) {
$new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label); $new_item = Fedora_Item::ingest_new_item($object['pid'], 'A', $label);
} }
if (!empty($object['cmodel'])) { if (!empty($object['cmodel'])) {
$new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI);
} }
if (!empty($object['parent'])) { if (!empty($object['parent'])) {
$new_item->add_relationship('isMemberOfCollection', $object['parent']); $new_item->add_relationship('isMemberOfCollection', $object['parent']);
} }
foreach($datastreams as $ds) { foreach ($datastreams as $ds) {
if ($ds['dsid'] == 'DC') { if ($ds['dsid'] == 'DC') {
$new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); $new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml');
} }
@ -2039,13 +2020,14 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid
$return = NULL; $return = NULL;
if (isset($item)) { if (isset($item)) {
$doc = simplexml_load_string($item->get_datastream_dissemination($dsid)); $doc = simplexml_load_string($item->get_datastream_dissemination($dsid));
} elseif (isset($datastream_file)) { }
elseif (isset($datastream_file)) {
$doc = simplexml_load_file($datastream_file); $doc = simplexml_load_file($datastream_file);
} }
if (!empty($doc)) { if (!empty($doc)) {
$attrs = $doc->attributes(); $attrs = $doc->attributes();
foreach($attrs as $name => $value) { foreach ($attrs as $name => $value) {
if ($name == 'version') { if ($name == 'version') {
$return = (int) $value; $return = (int) $value;
break; break;
@ -2054,18 +2036,18 @@ function fedora_repository_get_islandora_datastream_version($item = NULL, $dsid
} }
return $return; return $return;
} }
function theme_fedora_repository_solution_packs_list($solution_packs) { function theme_fedora_repository_solution_packs_list($solution_packs) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
$output = ''; $output = '';
$header = array(); $header = array();
$rows = array(); $rows = array();
drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); drupal_add_css(drupal_get_path('module', 'update') . '/update.css');
return $output; return $output;
} }

Loading…
Cancel
Save