|
|
@ -52,6 +52,9 @@ define('ISLANDORA_DATASTREAM_MODIFIED_HOOK', 'islandora_datastream_modified'); |
|
|
|
define('ISLANDORA_DATASTREAM_PURGED_HOOK', 'islandora_datastream_purged'); |
|
|
|
define('ISLANDORA_DATASTREAM_PURGED_HOOK', 'islandora_datastream_purged'); |
|
|
|
define('ISLANDORA_INGEST_STEP_HOOK', 'islandora_ingest_steps'); |
|
|
|
define('ISLANDORA_INGEST_STEP_HOOK', 'islandora_ingest_steps'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Autocomplete paths. |
|
|
|
|
|
|
|
define('ISLANDORA_CONTENT_MODELS_AUTOCOMPLETE', 'islandora/autocomplete/content-models'); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Implements hook_menu(). |
|
|
|
* Implements hook_menu(). |
|
|
|
* |
|
|
|
* |
|
|
@ -246,6 +249,15 @@ function islandora_menu() { |
|
|
|
'access arguments' => array(FEDORA_VIEW_OBJECTS, 2), |
|
|
|
'access arguments' => array(FEDORA_VIEW_OBJECTS, 2), |
|
|
|
'load arguments' => array(2), |
|
|
|
'load arguments' => array(2), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
$items[ISLANDORA_CONTENT_MODELS_AUTOCOMPLETE] = array( |
|
|
|
|
|
|
|
'title' => 'Autocomplete callback', |
|
|
|
|
|
|
|
'description' => 'Autocomplete a Fedora content model PID.', |
|
|
|
|
|
|
|
'file' => 'includes/content_model.autocomplete.inc', |
|
|
|
|
|
|
|
'page callback' => 'islandora_content_model_autocomplete', |
|
|
|
|
|
|
|
'page arguments' => array(3), |
|
|
|
|
|
|
|
'access arguments' => array('administer site configuration'), |
|
|
|
|
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
|
|
|
|
); |
|
|
|
return $items; |
|
|
|
return $items; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -370,7 +382,7 @@ function islandora_forms($form_id) { |
|
|
|
* @global $user |
|
|
|
* @global $user |
|
|
|
* |
|
|
|
* |
|
|
|
* @param mixed $object |
|
|
|
* @param mixed $object |
|
|
|
* The FedoraObject or FedoraDatastream to test for accessibility, if NULL |
|
|
|
* The AbstractObject or AbstractDatastream to test for accessibility, if NULL |
|
|
|
* is given the object is assumed to not exist or be inaccessible. |
|
|
|
* is given the object is assumed to not exist or be inaccessible. |
|
|
|
* @param array $permissions |
|
|
|
* @param array $permissions |
|
|
|
* The required user permissions. |
|
|
|
* The required user permissions. |
|
|
@ -448,7 +460,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar |
|
|
|
* |
|
|
|
* |
|
|
|
* @param string $perm |
|
|
|
* @param string $perm |
|
|
|
* User permission to test for. |
|
|
|
* User permission to test for. |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* inaccessible. |
|
|
|
* inaccessible. |
|
|
|
* |
|
|
|
* |
|
|
@ -474,10 +486,10 @@ function islandora_object_access_callback($perm, $object = NULL) { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param string $perm |
|
|
|
* @param string $perm |
|
|
|
* The user permission to test for. |
|
|
|
* The user permission to test for. |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* inaccessible. |
|
|
|
* inaccessible. |
|
|
|
* @param FedoraDatastream $datastream |
|
|
|
* @param AbstractDatastream $datastream |
|
|
|
* The datastream to test, if NULL given the datastream doesn't exist |
|
|
|
* The datastream to test, if NULL given the datastream doesn't exist |
|
|
|
* or is inaccessible. |
|
|
|
* or is inaccessible. |
|
|
|
* @param StdObject $account |
|
|
|
* @param StdObject $account |
|
|
@ -525,7 +537,7 @@ function islandora_object_datastream_tokened_access_callback($perm, $object = NU |
|
|
|
* |
|
|
|
* |
|
|
|
* @param array $perms |
|
|
|
* @param array $perms |
|
|
|
* Array of user permission to test for. |
|
|
|
* Array of user permission to test for. |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* The object to test, if NULL given the object doesn't exist or is |
|
|
|
* inaccessible. |
|
|
|
* inaccessible. |
|
|
|
* |
|
|
|
* |
|
|
@ -551,13 +563,13 @@ function islandora_object_manage_access_callback($perms, $object = NULL) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Renders the given objects manage overview page. |
|
|
|
* Renders the given objects manage overview page. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to manage. |
|
|
|
* The object to manage. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
* The HTML repersentation of the manage object page. |
|
|
|
* The HTML repersentation of the manage object page. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_manage_overview_object(FedoraObject $object) { |
|
|
|
function islandora_manage_overview_object(AbstractObject $object) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
$output = array(); |
|
|
|
$output = array(); |
|
|
|
foreach (islandora_build_hook_list(ISLANDORA_OVERVIEW_HOOK, $object->models) as $hook) { |
|
|
|
foreach (islandora_build_hook_list(ISLANDORA_OVERVIEW_HOOK, $object->models) as $hook) { |
|
|
@ -578,14 +590,14 @@ function islandora_manage_overview_object(FedoraObject $object) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Renders the default manage object page for the given object. |
|
|
|
* Renders the default manage object page for the given object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object used to render the manage object page. |
|
|
|
* The object used to render the manage object page. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
|
* The default rendering of the object manage page, indexed at |
|
|
|
* The default rendering of the object manage page, indexed at |
|
|
|
* 'Default Edit output'. |
|
|
|
* 'Default Edit output'. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_default_islandora_manage_overview_object(FedoraObject $object) { |
|
|
|
function islandora_default_islandora_manage_overview_object(AbstractObject $object) { |
|
|
|
$output = theme('islandora_default_overview', array('islandora_object' => $object)); |
|
|
|
$output = theme('islandora_default_overview', array('islandora_object' => $object)); |
|
|
|
return array('Default overview output' => $output); |
|
|
|
return array('Default overview output' => $output); |
|
|
|
} |
|
|
|
} |
|
|
@ -599,13 +611,13 @@ function islandora_default_islandora_manage_overview_object(FedoraObject $object |
|
|
|
* If no modules implement 'ISLANDORA_EDIT_HOOK' then this function returns the |
|
|
|
* If no modules implement 'ISLANDORA_EDIT_HOOK' then this function returns the |
|
|
|
* default manage view. |
|
|
|
* default manage view. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to manage. |
|
|
|
* The object to manage. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
* The HTML repersentation of the manage object page. |
|
|
|
* The HTML repersentation of the manage object page. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_edit_object(FedoraObject $object) { |
|
|
|
function islandora_edit_object(AbstractObject $object) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/breadcrumb'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/breadcrumb'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
drupal_set_title($object->label); |
|
|
|
drupal_set_title($object->label); |
|
|
@ -629,14 +641,14 @@ function islandora_edit_object(FedoraObject $object) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Renders the default manage object page for the given object. |
|
|
|
* Renders the default manage object page for the given object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object used to render the manage object page. |
|
|
|
* The object used to render the manage object page. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
|
* The default rendering of the object manage page, indexed at |
|
|
|
* The default rendering of the object manage page, indexed at |
|
|
|
* 'Default Edit output'. |
|
|
|
* 'Default Edit output'. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_default_islandora_edit_object(FedoraObject $object) { |
|
|
|
function islandora_default_islandora_edit_object(AbstractObject $object) { |
|
|
|
$output = theme('islandora_default_edit', array('islandora_object' => $object)); |
|
|
|
$output = theme('islandora_default_edit', array('islandora_object' => $object)); |
|
|
|
return array('Default Edit output' => $output); |
|
|
|
return array('Default Edit output' => $output); |
|
|
|
} |
|
|
|
} |
|
|
@ -661,13 +673,13 @@ function islandora_view_default_object() { |
|
|
|
* If no modules implement the hook then the default view object page |
|
|
|
* If no modules implement the hook then the default view object page |
|
|
|
* will be rendered. |
|
|
|
* will be rendered. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object to view. |
|
|
|
* The object to view. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return string |
|
|
|
* @return string |
|
|
|
* The html repersentation of this object. |
|
|
|
* The html repersentation of this object. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_view_object(FedoraObject $object) { |
|
|
|
function islandora_view_object(AbstractObject $object) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/breadcrumb'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/breadcrumb'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
drupal_set_title($object->label); |
|
|
|
drupal_set_title($object->label); |
|
|
@ -697,7 +709,7 @@ function islandora_view_object(FedoraObject $object) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Renders the default view object page for the given object. |
|
|
|
* Renders the default view object page for the given object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object used to render the view object page. |
|
|
|
* The object used to render the view object page. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
@ -849,7 +861,7 @@ function islandora_tokened_datastream_load($datastream_id, $map) { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param mixed $object_id |
|
|
|
* @param mixed $object_id |
|
|
|
* The object to load the datastream from. This can be a Fedora PID or |
|
|
|
* The object to load the datastream from. This can be a Fedora PID or |
|
|
|
* an instantiated IslandoraFedoraObject as it implements __toString() |
|
|
|
* an instantiated IslandoraAbstractObject as it implements __toString() |
|
|
|
* returning the PID. |
|
|
|
* returning the PID. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FedoraDatastream |
|
|
|
* @return FedoraDatastream |
|
|
@ -872,7 +884,7 @@ function islandora_datastream_load($datastream_id, $object_id) { |
|
|
|
* attribute, as in: |
|
|
|
* attribute, as in: |
|
|
|
* <content_model name="Collection" version="2" ... |
|
|
|
* <content_model name="Collection" version="2" ... |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The Object the datastream belongs to. |
|
|
|
* The Object the datastream belongs to. |
|
|
|
* @param string $dsid |
|
|
|
* @param string $dsid |
|
|
|
* The ID of the datastream. |
|
|
|
* The ID of the datastream. |
|
|
@ -941,26 +953,26 @@ function islandora_islandora_undeletable_datastreams(array $models) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Ingest the given object. |
|
|
|
* Ingest the given object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param NewFedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* An ingestable FedoraObject. |
|
|
|
* An ingestable FedoraObject. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FedoraObject |
|
|
|
* @return FedoraObject |
|
|
|
* The ingested FedoraObject. |
|
|
|
* The ingested FedoraObject. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_add_object(NewFedoraObject &$object) { |
|
|
|
function islandora_add_object(AbstractObject &$object) { |
|
|
|
return $object->repository->ingestObject($object); |
|
|
|
return $object->repository->ingestObject($object); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Delete's or purges the given object. |
|
|
|
* Delete's or purges the given object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* An object to delete. |
|
|
|
* An object to delete. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return bool |
|
|
|
* @return bool |
|
|
|
* TRUE if successful, FALSE otherwise. |
|
|
|
* TRUE if successful, FALSE otherwise. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_delete_object(FedoraObject &$object) { |
|
|
|
function islandora_delete_object(AbstractObject &$object) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
$object->repository->purgeObject($object->id); |
|
|
|
$object->repository->purgeObject($object->id); |
|
|
|
$object = NULL; |
|
|
|
$object = NULL; |
|
|
@ -979,13 +991,13 @@ function islandora_delete_object(FedoraObject &$object) { |
|
|
|
* Which types are undefined, but more than likely because of the hooks |
|
|
|
* Which types are undefined, but more than likely because of the hooks |
|
|
|
* there will be several kinds. |
|
|
|
* there will be several kinds. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraDatastream $datastream |
|
|
|
* @param AbstractDatastream $datastream |
|
|
|
* The datastream to delete. |
|
|
|
* The datastream to delete. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return bool |
|
|
|
* @return bool |
|
|
|
* TRUE if successful, FALSE otherwise. |
|
|
|
* TRUE if successful, FALSE otherwise. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_delete_datastream(FedoraDatastream &$datastream) { |
|
|
|
function islandora_delete_datastream(AbstractDatastream &$datastream) { |
|
|
|
$object = $datastream->parent; |
|
|
|
$object = $datastream->parent; |
|
|
|
return $object->purgeDatastream($datastream->id); |
|
|
|
return $object->purgeDatastream($datastream->id); |
|
|
|
} |
|
|
|
} |
|
|
@ -1065,7 +1077,7 @@ function islandora_entity_property_info() { |
|
|
|
* Modules can either implement preprocess functions to append content onto the |
|
|
|
* Modules can either implement preprocess functions to append content onto the |
|
|
|
* 'content' variable, or override the display by providing a theme suggestion. |
|
|
|
* 'content' variable, or override the display by providing a theme suggestion. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param FedoraObject $object |
|
|
|
* @param AbstractObject $object |
|
|
|
* The object. |
|
|
|
* The object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
|