diff --git a/MimeClass.inc b/MimeClass.inc index 55228740..652f3cc3 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -163,6 +163,9 @@ class MimeClass { "mpeg" => "video/mpeg", "mpe" => "video/mpeg", "mpg" => "video/mpeg", + "m4v" => "video/mp4", + "mp4" => "video/mp4", + "ogv" => "video/ogg", "qt" => "video/quicktime", "mov" => "video/quicktime", "mxu" => "video/vnd.mpegurl", @@ -170,12 +173,20 @@ class MimeClass { "movie" => "video/x-sgi-movie", "flv" => "video/x-flv", "swf" => "application/x-shockwave-flash", + // audio: + "mp3" => "audio/mpeg", + "mp4a" => "audio/mp4", + "m4a" => "audio/mp4", + "oga" => "audio/ogg", + "ogg" => "audio/ogg", + "flac" => "audio/x-flac", + "wav" => "audio/vnd.wave", // compressed formats: (note: http://svn.cleancode.org/svn/email/trunk/mime.types) "tgz" => "application/x-gzip", "gz" => "application/x-gzip", "tar" => "application/x-tar", "gtar" => "application/x-gtar", - "zip" => "application/x-zip", + "zip" => "application/x-zip", // others: 'bin' => 'application/octet-stream', ); @@ -323,14 +334,3 @@ class MimeClass { } -/* -$helper = new MimeClass(); -print "get_extension('application/x-gzip'): \n"; -echo print_r( $helper->get_extension('application/x-gzip', true), true ) . "\n"; -print "get_extension('text/plain'): \n"; -echo print_r( $helper->get_extension('text/plain', true), true ) . "\n"; -print "get_mimetype('fucker/asdf.tar.gz'): \n"; -echo print_r( $helper->get_mimetype('fucker/asdf.tar.gz', true), true ) . "\n"; -print "get_mimetype('blah.tsp'): \n"; -echo print_r( $helper->get_mimetype('blah.tsp', true), true ) . "\n"; -/* */ diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 80d354df..ab4cb617 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -54,25 +54,26 @@ class ObjectHelper { return ' '; } - if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_set_message(t("You do not have access Fedora objects within the attempted namespace."), 'error'); drupal_access_denied(); return ' '; } - - if (($cm = ContentModel::loadFromObject($pid)) == FALSE) { - drupal_set_message(t("You do not have access to objects without an Islandora Content Model."), 'error'); - drupal_access_denied(); - return ' '; - } - $cmDatastreams = $cm->listDatastreams(); + + if (variable_get('fedora_object_restrict_datastreams', TRUE) == TRUE ) { + if (($cm = ContentModel::loadFromObject($pid)) == FALSE) { + drupal_set_message(t("You do not have access to objects without an Islandora Content Model."), 'error'); + drupal_access_denied(); + return ' '; + } - if ( !((isset($user) && in_array('administrator',$user->roles)) || in_array($dsID,$cmDatastreams))) { - drupal_set_message(t("You do not have access to the specified datastream."), 'error'); - drupal_access_denied(); - return ' '; + $cmDatastreams = $cm->listDatastreams(); + if ( !((isset($user) && in_array('administrator',$user->roles)) || in_array($dsID,$cmDatastreams))) { + drupal_set_message(t("You do not have access to the specified datastream."), 'error'); + drupal_access_denied(); + return ' '; + } } module_load_include('inc', 'fedora_repository', 'api/fedora_item'); diff --git a/content_models/islandora_largeimages.xml b/content_models/islandora_largeimages.xml index 6a152ad4..a0bbfe9b 100644 --- a/content_models/islandora_largeimages.xml +++ b/content_models/islandora_largeimages.xml @@ -1,298 +1,358 @@ - - - - - - - - - - - - - - -ingest - -fedoraAdmin -2010-01-26T21:29:20.416Z -Created with Admin GUI "New Object" command - - - -addDatastream -COLLECTION_POLICY -fedoraAdmin -2010-01-26T21:30:55.607Z -DatastreamsPane generated this logMessage. - - - -addDatastream -RELS-EXT -fedoraAdmin -2010-01-26T21:33:14.125Z - - - - -modifyDatastreamByValue -COLLECTION_POLICY -fedoraAdmin -2010-03-04T12:50:05.983Z - - - - -modifyDatastreamByValue -COLLECTION_POLICY -fedoraAdmin -2010-03-11T21:01:44.921Z - - - - - - - - - - - Large Image Collection - islandora:largeimages - - - - - - - - - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - - isMemberOfCollection - - dc.description - - dc.title - dc.title - - - dc.creator - dc.creator - - - dc.description - dc.description - - - dc.date - dc.date - - - dc.identifier - dc.identifier - - - dc.language - dc.language - - - dc.publisher - dc.publisher - - - dc.rights - dc.rights - - - dc.subject - dc.subject - - - dc.relation - dc.relation - - - dcterms.temporal - dcterms.temporal - - - dcterms.spatial - dcterms.spatial - - - fgs.DS.first.text - Full Text - - - - - - - - - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - islandora:herb - islandora:herbCModel - ISLANDORACM - - - isMemberOfCollection - - dc.description - - dc.title - dc.title - - - dc.creator - dc.creator - - - dc.description - dc.description - - - dc.date - dc.date - - - dc.identifier - dc.identifier - - - dc.language - dc.language - - - dc.publisher - dc.publisher - - - dc.rights - dc.rights - - - dc.subject - dc.subject - - - dc.relation - dc.relation - - - dcterms.temporal - dcterms.temporal - - - dcterms.spatial - dcterms.spatial - - - fgs.DS.first.text - Full Text - - - - - - - - - - - islandora:slide - islandora:slideCModel - ISLANDORACM - - - isMemberOfCollection - - dc.description - - dc.title - dc.title - - - dc.creator - dc.creator - - - dc.description - dc.description - - - dc.date - dc.date - - - dc.identifier - dc.identifier - - - dc.language - dc.language - - - dc.publisher - dc.publisher - - - dc.rights - dc.rights - - - dc.subject - dc.subject - - - dc.relation - dc.relation - - - dcterms.temporal - dcterms.temporal - - - dcterms.spatial - dcterms.spatial - - - fgs.DS.first.text - Full Text - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + ingest + + fedoraAdmin + 2010-01-26T21:29:20.416Z + Created with Admin GUI "New Object" command + + + + addDatastream + COLLECTION_POLICY + fedoraAdmin + 2010-01-26T21:30:55.607Z + DatastreamsPane generated this logMessage. + + + + addDatastream + RELS-EXT + fedoraAdmin + 2010-01-26T21:33:14.125Z + + + + + modifyDatastreamByValue + COLLECTION_POLICY + fedoraAdmin + 2010-03-04T12:50:05.983Z + + + + + modifyDatastreamByValue + COLLECTION_POLICY + fedoraAdmin + 2010-03-11T21:01:44.921Z + + + + + ingest + + admin + 2010-12-10T17:29:47.073Z + Fedora Object Ingested + + + + addDatastream + TN + admin + 2010-12-10T17:29:47.200Z + Ingested object TN + + + + modifyDatastreamByValue + COLLECTION_POLICY + fedoraAdmin + 2010-12-10T17:32:17.345Z + + + + + + + + + + + Large Image Collection + islandora:largeimages + + + + + + + + + + + islandora:slide + islandora:slideCModel + ISLANDORACM + + + isMemberOfCollection + + dc.description + + dc.title + dc.title + + + dc.creator + dc.creator + + + dc.description + dc.description + + + dc.date + dc.date + + + dc.identifier + dc.identifier + + + dc.language + dc.language + + + dc.publisher + dc.publisher + + + dc.rights + dc.rights + + + dc.subject + dc.subject + + + dc.relation + dc.relation + + + dcterms.temporal + dcterms.temporal + + + dcterms.spatial + dcterms.spatial + + + fgs.DS.first.text + Full Text + + + + + + + + + + + islandora:slide + islandora:slideCModel + ISLANDORACM + + + islandora:herb + islandora:herbCModel + ISLANDORACM + + + isMemberOfCollection + + dc.description + + dc.title + dc.title + + + dc.creator + dc.creator + + + dc.description + dc.description + + + dc.date + dc.date + + + dc.identifier + dc.identifier + + + dc.language + dc.language + + + dc.publisher + dc.publisher + + + dc.rights + dc.rights + + + dc.subject + dc.subject + + + dc.relation + dc.relation + + + dcterms.temporal + dcterms.temporal + + + dcterms.spatial + dcterms.spatial + + + fgs.DS.first.text + Full Text + + + + + + + + + + + islandora:slide + islandora:slideCModel + ISLANDORACM + + + isMemberOfCollection + + dc.description + + dc.title + dc.title + + + dc.creator + dc.creator + + + dc.description + dc.description + + + dc.date + dc.date + + + dc.identifier + dc.identifier + + + dc.language + dc.language + + + dc.publisher + dc.publisher + + + dc.rights + dc.rights + + + dc.subject + dc.subject + + + dc.relation + dc.relation + + + dcterms.temporal + dcterms.temporal + + + dcterms.spatial + dcterms.spatial + + + fgs.DS.first.text + Full Text + + + + + + + + + + + + + dc.title + dc.creator + dc.description + dc.date + dc.identifier + dc.language + dc.publisher + dc.rights + dc.subject + dc.relation + dcterms.temporal + dcterms.spatial + Full Text + + isMemberOfCollection + + + + + + + + + + + + + + + + + + + + + + diff --git a/formClass.inc b/formClass.inc index 8505f402..20840ba7 100644 --- a/formClass.inc +++ b/formClass.inc @@ -77,8 +77,14 @@ class formClass { 'access arguments' => array('view fedora collection'), // 'access' => TRUE ); + $repository_title = variable_get('fedora_repository_title','Digital repository'); + if (trim($repository_title)!= '') { + $respository_title=t($repository_title); + } else { + $repository_title= NULL; + } $items['fedora/repository'] = array( -// 'title' => t('Digital repository'), + 'title' => $repository_title, 'page callback' => 'repository_page', 'type' => MENU_NORMAL_ITEM, // 'page arguments'=>array(1), @@ -361,13 +367,22 @@ class formClass { ); */ - $form['fedora_object_display_title'] = array( - '#type' => 'select', - '#title' => t('Display Object Title Behaviour'), - '#default_value'=> variable_get('fedora_object_display_title', ObjectHelper::$DISPLAY_ALWAYS), - '#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')), - '#description' => t('Determines when to display the object (or collection) title when viewing an object/collection page.'), - ); + $form['fedora_repository_title'] = array( + '#type' => 'textfield', + '#title' => t('Fedora Repository Title'), + '#default_value'=> variable_get('fedora_repository_title', 'Digital Repository'), + '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), + ); + + + $form['fedora_object_display_title'] = array( + '#type' => 'select', + '#title' => t('Display Object Title Behaviour'), + '#default_value'=> variable_get('fedora_object_display_title', ObjectHelper::$DISPLAY_ALWAYS), + '#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')), + '#description' => t('Determines when to display the object (or collection) title when viewing an object/collection page.'), + ); + $form['fedora_object_display_description'] = array( @@ -377,6 +392,13 @@ class formClass { '#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')), '#description' => t('Determines when to display the default object (or collection) description fieldset when viewing an object/collection page.'), ); + + $form['fedora_object_restrict_datastreams'] = array( + '#type' => 'checkbox', + '#title' => t('Restrict Access to Fedora Object Datastreams'), + '#default_value'=> variable_get('fedora_object_restrict_datastreams', TRUE), + '#description' => t('When enabled, restricts access to fedora object datastreams that are not listed in the Islandora Content Model for the object (unless the user is an administrator).'), + ); $form['fedora_collection_display_list'] = array( '#type' => 'select', diff --git a/plugins/pidfield/pidfield.module b/plugins/pidfield/pidfield.module index 902d6690..53e176a2 100644 --- a/plugins/pidfield/pidfield.module +++ b/plugins/pidfield/pidfield.module @@ -276,11 +276,14 @@ function theme_pidfield_formatter_default($element) { //return $element['#item']['safe']; $pid = $element['#item']['safe']; - module_load_include('inc', 'fedora_repository', 'api/fedora_item'); - $item = new Fedora_Item($pid); + if(!empty($pid)) { + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + $item = new Fedora_Item($pid); - return fedora_repository_get_items($pid); - //return $item->objectProfile->objLabel; + return fedora_repository_get_items($pid); + //return $item->objectProfile->objLabel; + } + return null; } /**