',
@@ -269,8 +259,6 @@ function islandora_batch_reingest_object($object_model, &$context) {
function islandora_install_solution_pack($module_name = NULL, $op = 'install') {
// check if a module name is given. // @TODO: check module name for existance
if (!empty($module_name)) {
-
- // include files
module_load_include('module', 'islandora', 'islandora');
module_load_include('inc', 'islandora', 'includes/utilities');
module_load_include('module', $module_name, $module_name);
@@ -382,7 +370,8 @@ function islandora_install_solution_pack($module_name = NULL, $op = 'install') {
*
* @see islandora_solution_pack_form()
* @see islandora_install_solution_pack()
- * @TODO: should this function live in islandora.module so it can be called easier without having to include the solution_packs.inc file?
+ * @todo: Should this function live in islandora.module so it can be called
+ * easier without having to include the solution_packs.inc file?
*/
function islandora_check_object_status($object_model = array()) {
if (!empty($object_model)) {
@@ -409,7 +398,8 @@ function islandora_check_object_status($object_model = array()) {
$object_status = 'missing';
}
else {
- // object defined with single datastream file // @TODO: should dsversion be mandatory for the check to valid?
+ // object defined with single datastream file
+ // @TODO: should dsversion be mandatory for the check to valid?
if (isset($object_model['dsid']) && isset($object_model['datastream_file']) && isset($object_model['dsversion'])) {
$datastreams = array(
array(
@@ -580,7 +570,9 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL) {
'#type' => 'item',
'#title' => t('Select a viewer'),
'#description' => t('Preferred viewer for your solution pack. These may be provided by third-party modules.'),
- '#tree' => TRUE, // this attribute is important to return the submitted values in a deeper nested arrays in
+ // This attribute is important to return the submitted values in a deeper
+ // nested arrays in
+ '#tree' => TRUE,
'#theme' => 'islandora_viewers_table',
);
@@ -631,7 +623,8 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL) {
* Returns all defined viewers.
*
* @param string $mimetype
- * specify a mimetype to return only viewers that support this certain mimetype.
+ * specify a mimetype to return only viewers that support this certain
+ * mimetype.
* @return
* array of viewer definitions, or FALSE if none are found.
*/
diff --git a/includes/utilities.inc b/includes/utilities.inc
index ab41af1e..b9cea493 100644
--- a/includes/utilities.inc
+++ b/includes/utilities.inc
@@ -156,7 +156,9 @@ function islandora_escape_pid_for_function($pid) {
* Gets the namespace of the given id.
*
* @param string $id
- * Either a PID or namespace to check for accessibility. Any string like those below are fine.
+ * Either a PID or namespace to check for accessibility. Any string like those
+ * below are fine.
+ *
* @code
* 'islandora',
* 'islandora:',
@@ -173,10 +175,13 @@ function islandora_get_namespace($id) {
}
/**
- * Checks the given namespace or PID is/has an accessible namespace as defined by the "islandora_pids_allowed" variable.
+ * Checks the given namespace or PID is/has an accessible namespace as defined
+ * by the "islandora_pids_allowed" variable.
*
* @param string $namespace
- * Either a PID or namespace to check for accessibility. Any string like those below are fine.
+ * Either a PID or namespace to check for accessibility. Any string like those
+ * below are fine.
+ *
* @code
* 'islandora',
* 'islandora:',
diff --git a/islandora.module b/islandora.module
index 4859f5b2..f60627c1 100644
--- a/islandora.module
+++ b/islandora.module
@@ -3,7 +3,8 @@
/**
* @file
*
- * islandora.module: defines paths (drupal menu items) as entry points and acts as a hub for dispatching tasks to other modules.
+ * islandora.module: defines paths (drupal menu items) as entry points and acts
+ * as a hub for dispatching tasks to other modules.
*
* This file is part of Islandora.
*
@@ -49,7 +50,8 @@ define('ISLANDORA_EDIT_DATASTREAM_HOOK', 'islandora_edit_datastream');
/**
* Implements hook_menu().
*
- * We need some standard entry points so we can have consistent urls for different Object actions
+ * We need some standard entry points so we can have consistent urls for
+ * different Object actions
*/
function islandora_menu() {
$items = array();
@@ -290,16 +292,20 @@ function islandora_forms($form_id) {
}
/**
- * Checks whether the user can access the given object with the given permission.
+ * Checks whether the user can access the given object with the given
+ * permission.
*
- * Checks for object existance, accessiblitly, namespace permissions, and user permissions
+ * Checks for object existance, accessiblitly, namespace permissions,
+ * and user permissions
*
- * @see islandora_object_load() To find potential solutions to enable page not found errors.
+ * @see islandora_object_load() To find potential solutions to enable
+ * page not found errors.
*
* @param string $perm
* The user permission to test for.
* @param FedoraObject $object
- * The object to test, if NULL given the object doesn't exist or is inaccessible.
+ * The object to test, if NULL given the object doesn't exist or is
+ * inaccessible.
*
* @return boolean
* TRUE if the user is allowed to access this object, FALSE otherwise.
@@ -310,18 +316,23 @@ function islandora_object_access_callback($perm, $object = NULL) {
}
/**
- * Checks whether the user can access the given object and datastream with the given permission.
+ * Checks whether the user can access the given object and datastream with
+ * the given permission.
*
- * Checks for object existance, accessiblitly, namespace permissions, and user permissions
+ * Checks for object existance, accessiblitly, namespace permissions,
+ * and user permissions
*
- * @see islandora_object_load() To find potential solutions to enable page not found errors.
+ * @see islandora_object_load() To find potential solutions to enable page
+ * not found errors.
*
* @param string $perm
* The user permission to test for.
* @param FedoraObject $object
- * The object to test, if NULL given the object doesn't exist or is inaccessible.
+ * The object to test, if NULL given the object doesn't exist or is
+ * inaccessible.
* @param FedoraDatastream $datastream
- * The datastream to test, if NULL given the datastream doesn't exist or is inaccessible.
+ * The datastream to test, if NULL given the datastream doesn't exist
+ * or is inaccessible.
*
* @return boolean
* TRUE if the user is allowed to access this object, FALSE otherwise.
@@ -332,10 +343,13 @@ function islandora_object_datastream_access_callback($perm, $object = NULL, $dat
}
/**
- * Renders the given objects manage page. Its possible to modify the output of this function if 'ISLANDORA_EDIT_HOOK' is
- * implemented in other modules.
+ * Renders the given objects manage page.
*
- * If no modules implement 'ISLANDORA_EDIT_HOOK' then this function returns the default manage view.
+ * Its possible to modify the output of this function if 'ISLANDORA_EDIT_HOOK'
+ * is implemented in other modules.
+ *
+ * If no modules implement 'ISLANDORA_EDIT_HOOK' then this function returns the
+ * default manage view.
*
* @param FedoraObject $object
* The object to manage.
@@ -353,7 +367,8 @@ function islandora_edit_object(FedoraObject $object) {
}
}
if (empty($output)) {
- $output = islandora_default_islandora_edit_object($object); // Add in the default, if we did not get any results.
+ // Add in the default, if we did not get any results.
+ $output = islandora_default_islandora_edit_object($object);
}
arsort($output);
drupal_alter(ISLANDORA_EDIT_HOOK, $object, $output);
@@ -367,7 +382,8 @@ function islandora_edit_object(FedoraObject $object) {
* The object used to render the manage object page.
*
* @return array
- * The default rendering of the object manage page, indexed at 'Default Edit output'.
+ * The default rendering of the object manage page, indexed at
+ * 'Default Edit output'.
*/
function islandora_default_islandora_edit_object(FedoraObject $object) {
$output = theme('islandora_default_edit', array('islandora_object' => $object));
@@ -377,7 +393,8 @@ function islandora_default_islandora_edit_object(FedoraObject $object) {
/**
* Page callback for the path "islandora".
*
- * Redirects to the view of the object indicated by the Drupal variable 'islandora_repository_pid'.
+ * Redirects to the view of the object indicated by the Drupal variable
+ * 'islandora_repository_pid'.
*/
function islandora_view_default_object() {
$pid = variable_get('islandora_repository_pid', 'islandora:root');
@@ -387,10 +404,11 @@ function islandora_view_default_object() {
/**
* Renders the default view object page for the given object.
*
- * Modules should implement ISLANDORA_VIEW_HOOK for the Fedora Content models that
- * their modules want to provide a view for.
+ * Modules should implement ISLANDORA_VIEW_HOOK for the Fedora Content
+ * models that their modules want to provide a view for.
*
- * If no modules implement the hook then the default view object page will be rendered.
+ * If no modules implement the hook then the default view object page
+ * will be rendered.
*
* @param FedoraObject $object
* The object to view.
@@ -407,13 +425,16 @@ function islandora_view_object(FedoraObject $object) {
$page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize'];
$output = array();
foreach (islandora_build_hook_list(ISLANDORA_VIEW_HOOK, $object->models) as $hook) {
- $temp = module_invoke_all($hook, $object, $page_number, $page_size); // @todo Remove page number and size from this hook, implementers of the hook should use drupal page handling directly.
+ // @todo Remove page number and size from this hook, implementers of the
+ // hook should use drupal page handling directly.
+ $temp = module_invoke_all($hook, $object, $page_number, $page_size);
if (!empty($temp)) {
$output = array_merge_recursive($output, $temp);
}
}
if (empty($output)) {
- $output = islandora_default_islandora_view_object($object); // No results, use the default view.
+ // No results, use the default view.
+ $output = islandora_default_islandora_view_object($object);
}
arsort($output);
drupal_alter(ISLANDORA_VIEW_HOOK, $object, $output);
@@ -435,24 +456,35 @@ function islandora_default_islandora_view_object($object) {
}
/**
- * A helper function to get a connection and return an object for objects specified in the menu path as '%islandora_object'.
+ * A helper function to get a connection and return an object for objects
+ * specified in the menu path as '%islandora_object'.
*
* This should only be used by the Drupal menu wildcard system!
*
- * When this function returns FALSE the Drupal menu system will issues a "page not found" error, when this function returns NULL,
- * the access function is expected to check for the given object and return false generating a "accesss denied" error.
+ * When this function returns FALSE the Drupal menu system will issues a
+ * "page not found" error, when this function returns NULL, the access function
+ * is expected to check for the given object and return false generating a
+ * "accesss denied" error.
*
- * This will currently display a message if the repository is inaccessable, ideally this would redirect to another page in such a case,
- * as the access function will not be aware of this fact and will trigger the display of the "access denied" page.
+ * This will currently display a message if the repository is inaccessable,
+ * ideally this would redirect to another page in such a case,
+ * as the access function will not be aware of this fact and will trigger
+ * the display of the "access denied" page.
*
- * @todo When the repository down this should return a 500 error or a site offline notice. Currently only displays a message.
+ * @todo When the repository down this should return a 500 error or a
+ * site offline notice. Currently only displays a message.
*
* @param string $object_id
* The pid of an object in the menu path identified by '%islandora_object'.
*
* @return FedoraObject
- * If the given object id exists in the repository then this returns a FedoraObject, if no object was found it returns FALSE which triggers drupal_page_not_found(), if the
- * object was inaccessible then NULL is returned, and the access callback is expected to catch that case, triggering drupal_access_denied().
+ * If the given object id exists in the repository then this returns a
+ * FedoraObject.
+ * If no object was found it returns FALSE which triggers
+ * drupal_page_not_found().
+ * If the object was inaccessible then NULL is returned, and the
+ * access callback is expected to catch that case, triggering
+ * drupal_access_denied().
*/
function islandora_object_load($object_id) {
static $object = NULL, $load_failed = FALSE; // Assume inaccessible.
@@ -471,46 +503,49 @@ function islandora_object_load($object_id) {
}
/**
- * A helper function to get an datastream specified as '%islandora_datastream' for the object specified in the menu path as '%islandora_object'.
+ * A helper function to get an datastream specified as '%islandora_datastream'
+ * for the object specified in the menu path as '%islandora_object'.
*
- * This should only be used by the Drupal menu wildcard system! As for non existing datastreams this will return page not found.
+ * This should only be used by the Drupal menu wildcard system!
*
- * The following settings are required for any menu paths which intent to use this auto loader.
+ * The following settings are required for any menu paths which intent to use
+ * this auto loader.
*
* @code
* 'load arguments' => array('%map'),
* @endcode
*
- * @see islandora_object_load() for solutions to access/not found problems.
- *
- * @todo For non accessible datastreams to the user this should return access denied.
- * @todo Is there anything we can do to enhance caching?
+ * Its up to the access callbacks and menu callbacks to trigger
+ * drupal_access_denied() when appropriate.
*
* @param string $datastream_id
- * The dsid of the datastream specified as '%islandora_datastream' to fetch from the given object in the menu path identified by '%islandora_object'.
+ * The dsid of the datastream specified as '%islandora_datastream' to fetch
+ * from the given object in the menu path identified by '%islandora_object'.
*
* @return FedoraDatastream
- * If the given datastream id exists in the object then this returns a FedoraDatastream, in other cases this aborts.
+ * If the given datastream ID exists then this returns a FedoraDatastream
+ * object, otherwise it returns NULL which triggers drupal_page_not_found().
*/
function islandora_datastream_load($datastream_id, $map) {
- static $datastream = NULL, $load_failed = FALSE; // @hack for bug in drupal_not_found() when used before the menu callback. Infinite recursion bug.
+ static $datastream = NULL, $load_failed = FALSE;
if ($load_failed || isset($datastream)) {
return $datastream;
}
foreach ($map as $element) {
- $is_fedora_object = is_object($element) && strtolower(get_class($element)) == 'fedoraobject'; // @todo Probably a better way to check types by now.
- if ($is_fedora_object && isset($element[$datastream_id])) { // @todo check for access denied to this datastream so we can show the access denied page instead.
+ $is_fedora_object = is_object($element) && strtolower(get_class($element)) == 'fedoraobject';
+ if ($is_fedora_object && isset($element[$datastream_id])) {
$datastream = $element[$datastream_id];
return $datastream;
}
}
$load_failed = TRUE;
- return $datastream; // @todo Test
+ return $datastream;
}
/**
- * Content model, collection view and collection policy datastreams may now optionally define a version
- * number in their top-level XML element as an attribute, as in:
+ * Content model, collection view and collection policy datastreams may now
+ * optionally define a version number in their top-level XML element as an
+ * attribute, as in:
*
array(
diff --git a/theme/islandora-object-edit.tpl.php b/theme/islandora-object-edit.tpl.php
index 559ffd8c..0772a899 100644
--- a/theme/islandora-object-edit.tpl.php
+++ b/theme/islandora-object-edit.tpl.php
@@ -2,8 +2,9 @@
/**
* @file
- * islandora-object-edit.tpl.php: This is a template for objects that do not have
- * a module to registered to build their display.
+ *
+ * islandora-object-edit.tpl.php: This is a template for objects that do not
+ * have a module to registered to build their display.
*
* islandora_object is a fedora tuque Object
* $object->label
@@ -13,7 +14,8 @@
*
* $dublin_core is a DublinCore object
* which is an array of elements, such as dc.title
- * and each element has an array of values. dc.title can have none, one or many titles
+ * and each element has an array of values.
+ * dc.title can have none, one or many titles
* this is the case for all dc elements.
*
*/
@@ -21,4 +23,4 @@
label); ?>
-
\ No newline at end of file
+
diff --git a/theme/islandora-object.tpl.php b/theme/islandora-object.tpl.php
index f10bb745..9062098c 100644
--- a/theme/islandora-object.tpl.php
+++ b/theme/islandora-object.tpl.php
@@ -1,8 +1,10 @@
label - The label for this object.
@@ -35,13 +37,16 @@
* $ds->size - The size of the datastream
* $ds->checksum - The checksum of the datastream
* $ds->checksumType - The type of checksum for the datastream.
- * $ds->createdDate->format("Y-m-d") - The created date with an option to use a format of your choice
+ * $ds->createdDate->format("Y-m-d") - The created date with an option to use
+ * a format of your choice
* $ds->content - The content of the datastream
- * $ds->url - The URL. This is only valid for R and E datastreams.
+ * $ds->url - The URL. This is only valid for R and E
+ * datastreams.
*
* $dublin_core is a DublinCore object
* which is an array of elements, such as dc.title
- * and each element has an array of values. dc.title can have none, one or many titles
+ * and each element has an array of values.
+ * dc.title can have none, one or many titles
* this is the case for all dc elements.
*
*
@@ -81,7 +86,7 @@
Collections
- label, "islandora/object/{$collection->id}"); ?>
+ label, "islandora/object/{$collection->id}"); ?>
diff --git a/theme/islandora.theme.inc b/theme/islandora.theme.inc
index f92091fc..eaef7b60 100644
--- a/theme/islandora.theme.inc
+++ b/theme/islandora.theme.inc
@@ -2,6 +2,7 @@
/**
* @file
+ *
* This file contains all theme and preprocess functions.
*/
@@ -13,13 +14,12 @@
* theme variables for the edit template
*/
function islandora_preprocess_islandora_default_edit(&$variables) {
- $islandora_object = $variables['islandora_object'];
global $base_url;
+ $islandora_object = $variables['islandora_object'];
$datastreams = array();
$variables['islandora_editmetadata_url'] = $base_url . '/islandora/edit_form/' . $islandora_object->id;
module_load_include('inc', 'islandora', 'includes/datastream');
module_load_include('inc', 'islandora', 'includes/utilities');
- // $variables['add_datastream_form'] = drupal_get_form('islandora_add_datastream_form', $islandora_object->id);
$header = array(
array('data' => t('ID')),
array('data' => t('Label')),
@@ -27,7 +27,6 @@ function islandora_preprocess_islandora_default_edit(&$variables) {
array('data' => t('Mime type')),
array('data' => t('Size')),
array('data' => t('Operations'), 'colspan' => '3'),
- //array('data' => t('Delete')),
);
$table_attributes = array('class' => array('manage-datastreams'));
$rows = array();
@@ -87,7 +86,6 @@ function islandora_preprocess_islandora_default(&$variables) {
$variables['datastreams'] = $datastreams;
try {
$dc = $islandora_object['DC']->content;
- //$dc_xml = simplexml_load_string($dc);
$dc_object = DublinCore::import_from_xml_string($dc);
$dc_array = $dc_object->as_formatted_array();
} catch (Exception $e) {