|
|
|
@ -204,13 +204,13 @@ function islandora_escape_pid_for_function($pid) {
|
|
|
|
|
// Apparently, case doesn't matter for function calls in PHP, so let's not |
|
|
|
|
// really worry about changing the case. |
|
|
|
|
return str_replace( |
|
|
|
|
// Any PID characters which are not valid in the name of a PHP function. |
|
|
|
|
array( |
|
|
|
|
':', |
|
|
|
|
'-', |
|
|
|
|
), |
|
|
|
|
'_', |
|
|
|
|
$pid |
|
|
|
|
// Any PID characters which are not valid in the name of a PHP function. |
|
|
|
|
array( |
|
|
|
|
':', |
|
|
|
|
'-', |
|
|
|
|
), |
|
|
|
|
'_', |
|
|
|
|
$pid |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -281,16 +281,16 @@ function islandora_namespace_accessible($id) {
|
|
|
|
|
function islandora_get_parents_from_rels_ext(FedoraObject $object) { |
|
|
|
|
try { |
|
|
|
|
$collections = array_merge( |
|
|
|
|
$object->relationships->get(FEDORA_RELS_EXT_URI, 'isMemberOfCollection'), |
|
|
|
|
$object->relationships->get(FEDORA_RELS_EXT_URI, 'isMemberOf')); |
|
|
|
|
$object->relationships->get(FEDORA_RELS_EXT_URI, 'isMemberOfCollection'), |
|
|
|
|
$object->relationships->get(FEDORA_RELS_EXT_URI, 'isMemberOf')); |
|
|
|
|
} |
|
|
|
|
catch (RepositoryException $e) { |
|
|
|
|
// @todo some logging would be nice, not sure what this throws. |
|
|
|
|
return array(); |
|
|
|
|
} |
|
|
|
|
$map = function($o) { |
|
|
|
|
return islandora_object_load($o['object']['value']); |
|
|
|
|
}; |
|
|
|
|
return islandora_object_load($o['object']['value']); |
|
|
|
|
}; |
|
|
|
|
$collections = array_map($map, $collections); |
|
|
|
|
return array_filter($collections); |
|
|
|
|
} |
|
|
|
@ -400,7 +400,7 @@ function islandora_get_datastreams_requirements_from_content_model(FedoraObject
|
|
|
|
|
$xml = new SimpleXMLElement($object[DS_COMP_STREAM]->content); |
|
|
|
|
foreach ($xml->dsTypeModel as $ds) { |
|
|
|
|
$dsid = (string) $ds['ID']; |
|
|
|
|
$optional = drupal_strtolower((string) $ds['optional']); |
|
|
|
|
$optional = strtolower((string) $ds['optional']); |
|
|
|
|
$mime = array(); |
|
|
|
|
foreach ($ds->form as $form) { |
|
|
|
|
$mime[] = (string) $form['MIME']; |
|
|
|
@ -505,7 +505,7 @@ function islandora_display_repository_inaccessible_message() {
|
|
|
|
|
$text = t('Islandora configuration'); |
|
|
|
|
$link = l($text, 'admin/islandora/configure', array('attributes' => array('title' => $text))); |
|
|
|
|
$message = t('Could not connect to the repository. Please check the settings on the !link page.', |
|
|
|
|
array('!link' => $link)); |
|
|
|
|
array('!link' => $link)); |
|
|
|
|
drupal_set_message($message, 'error', FALSE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -731,7 +731,7 @@ function islandora_get_content_models($ignore_system_namespace = TRUE) {
|
|
|
|
|
$label = $result['label']['value']; |
|
|
|
|
$namespace = islandora_get_namespace($content_model); |
|
|
|
|
$ignore = $ignore_system_namespace && $namespace == 'fedora-system'; |
|
|
|
|
$ignore |= ! islandora_namespace_accessible($namespace); |
|
|
|
|
$ignore |= !islandora_namespace_accessible($namespace); |
|
|
|
|
if (!$ignore) { |
|
|
|
|
$content_models[$content_model] = array('pid' => $content_model, 'label' => $label); |
|
|
|
|
} |
|
|
|
|