From 12b4c4e610fd294258c5c023d0b7e4d6764bad6a Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 23 Mar 2015 13:53:57 -0300 Subject: [PATCH 01/10] Adding view to overview tab --- islandora.api.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/islandora.api.php b/islandora.api.php index dad43838..625dd7c5 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -601,7 +601,7 @@ function hook_cmodel_pid_islandora_overview_object(AbstractObject $object) { * Lets one alter the overview tab in object management. */ function hook_islandora_overview_object_alter(AbstractObject &$object, &$output) { - $output = $output . drupal_render(drupal_get_form('some_form', $object)); + $output = $output . drupal_render(drupal_get_form('some_form', $object))); } /** @@ -610,7 +610,12 @@ function hook_islandora_overview_object_alter(AbstractObject &$object, &$output) * Content model specific. */ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object, &$output) { - $output = $output . drupal_render(drupal_get_form('some_form', $object)); + $view = views_embed_view('usage_collection'); + $form['islandora_manage_overview_object'] = array( + '#type' => 'item', + '#markup' => $view, + ); + $output = $output . $form . drupal_render(drupal_get_form('some_form', $object))); } /** From d63acbd7fb26c2bf1988534908883d08b4e7379f Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 23 Mar 2015 14:10:32 -0300 Subject: [PATCH 02/10] had to include this in commit, same as 7.x --- tests/includes/utilities.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/includes/utilities.inc b/tests/includes/utilities.inc index 4eef5255..eefae4cc 100644 --- a/tests/includes/utilities.inc +++ b/tests/includes/utilities.inc @@ -315,7 +315,7 @@ class IslandoraTestUtilities extends IslandoraTestUtilityClass { * * @return bool * TRUE if all objects were removed, or FALSE if any of them still remained - * after removal. + * after removal. */ public function deleteUserCreatedObjects($username) { if ($username === $this->configuration['admin_user']) { From 58c6174d284bc726a5e87c327f1ae5dd8bda9bda Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 23 Mar 2015 15:12:15 -0300 Subject: [PATCH 03/10] Cleaned up syntax --- islandora.api.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/islandora.api.php b/islandora.api.php index 742c77fd..95e08f1d 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -245,7 +245,7 @@ function hook_cmodel_pid_islandora_object_ingested(AbstractObject $object) { * modifications, where as manipulating an object's datstreams are not. * * @param AbstractObject $object - * The object that was modified. + * The object that was ingested. * * @todo We should also include what changes were made in a additional * parameter. @@ -254,7 +254,7 @@ function hook_islandora_object_modified(AbstractObject $object) { } /** - * Notify modules that the given object was modified. + * Notify modules that the given object was ingested. * * @see hook_islandora_object_modified() */ @@ -361,22 +361,9 @@ function hook_cmodel_pid_islandora_datastream_purged(AbstractObject $object, $ds * @param AbstractObject $object * The object to check. * @param string $dsid - * A string indicating the datastream for which to get the registry. - * - * @return array - * An array of associative arrays, each mapping: - * - name: A string containg a human-readable name for the entry. - * - url: A string containing the URL to which to the user will be routed. + * todo */ function hook_islandora_edit_datastream_registry($object, $dsid) { - $routes = array(); - - $routes[] = array( - 'name' => t('My Awesome Edit Route'), - 'url' => "go/edit/here/{$object->id}/{$dsid}", - ); - - return $routes; } /** @@ -614,7 +601,7 @@ function hook_cmodel_pid_islandora_overview_object(AbstractObject $object) { * Lets one alter the overview tab in object management. */ function hook_islandora_overview_object_alter(AbstractObject &$object, &$output) { - $output = $output . drupal_render(drupal_get_form('some_form', $object))); + $output = $output . drupal_render(drupal_get_form('some_form', $object)); } /** @@ -628,7 +615,7 @@ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object '#type' => 'item', '#markup' => $view, ); - $output = $output . $form . drupal_render(drupal_get_form('some_form', $object))); + $output = $output . $form . drupal_render(drupal_get_form('some_form', $object)); } /** From 7ac58c5b6812dbfd507d088a5ea687c1fc24a09c Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Wed, 1 Apr 2015 09:31:32 -0300 Subject: [PATCH 04/10] Changing and tags --- includes/add_datastream.form.inc | 2 +- includes/admin.form.inc | 8 +------- includes/utilities.inc | 8 ++++---- islandora.module | 4 ++-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/includes/add_datastream.form.inc b/includes/add_datastream.form.inc index 55b45a04..3ad5a965 100644 --- a/includes/add_datastream.form.inc +++ b/includes/add_datastream.form.inc @@ -43,7 +43,7 @@ function islandora_add_datastream_form(array $form, array &$form_state, Abstract '#collapsed' => FALSE, 'dsid' => array( '#title' => 'Datastream ID', - '#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters, dashes and underscores. The following datastreams are defined by this content model but don't currently exist: @unused_dsids.", array('@unused_dsids' => $unused_datastreams)), + '#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters, dashes and underscores. The following datastreams are defined by this content model but don't currently exist: @unused_dsids.", array('@unused_dsids' => $unused_datastreams)), '#type' => 'textfield', '#size' => 64, '#maxlength' => 64, diff --git a/includes/admin.form.inc b/includes/admin.form.inc index cf0b8f69..0d932697 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -74,12 +74,6 @@ function islandora_repository_admin(array $form, array &$form_state) { '#description' => t('Displays an extra print tab, allowing an object to be printed'), '#default_value' => variable_get('islandora_show_print_option', FALSE), ), - 'islandora_render_drupal_breadcrumbs' => array( - '#type' => 'checkbox', - '#title' => t('Render Drupal breadcrumbs'), - '#description' => t('Larger sites may experience a notable performance improvement when disabled due to how breadcrumbs are constructed.'), - '#default_value' => variable_get('islandora_render_drupal_breadcrumbs', TRUE), - ), ), 'islandora_namespace' => array( '#type' => 'fieldset', @@ -93,7 +87,7 @@ function islandora_repository_admin(array $form, array &$form_state) { 'islandora_pids_allowed' => array( '#type' => 'textarea', '#title' => t('PID namespaces allowed in this Drupal install'), - '#description' => t('A list of PID namespaces, separated by spaces, that users are permitted to access from this Drupal installation.
This could be more than a simple namespace, e.g. demo:mydemos.
The namespace islandora: is reserved, and is always allowed.'), + '#description' => t('A list of PID namespaces, separated by spaces, that users are permitted to access from this Drupal installation.
This could be more than a simple namespace, e.g. demo:mydemos.
The namespace islandora: is reserved, and is always allowed.'), '#default_value' => variable_get('islandora_pids_allowed', 'default: demo: changeme: ilives: islandora-book: books: newspapers: '), '#states' => array( 'invisible' => array( diff --git a/includes/utilities.inc b/includes/utilities.inc index 8682a4bc..8e071def 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -86,16 +86,16 @@ function islandora_temp_file_entry($file_uri, $mime = NULL) { function islandora_control_group_to_human_readable($control_group) { switch ($control_group) { case 'M': - return 'Managed'; + return 'Managed'; case 'X': - return 'Inline XML'; + return 'Inline XML'; case 'R': - return 'Redirect'; + return 'Redirect'; case 'E': - return 'Externally Referenced'; + return 'Externally Referenced'; default: return $control_group; diff --git a/islandora.module b/islandora.module index 567a39bd..a7d0cdee 100644 --- a/islandora.module +++ b/islandora.module @@ -1819,13 +1819,13 @@ function islandora_form_simpletest_test_form_alter(array &$form) { $filter_status = is_writable($filter_path); if ($filter_status) { $filter_status_message = theme_image(array('path' => 'misc/watchdog-ok.png', 'attributes' => array())) . " "; - $filter_status_message .= t("Drupal filter at !filter_path is writable by the server.", array( + $filter_status_message .= t("Drupal filter at !filter_path is writable by the server.", array( '!filter_path' => $filter_path, )); } else { $filter_status_message = theme_image(array('path' => 'misc/watchdog-error.png', 'attributes' => array())) . " "; - $filter_status_message .= t("Drupal filter at !filter_path is not writable by the server. Please make sure your webserver has permission to write to the Drupal filter. If the path given is incorrect, you will need to change it in your server's test config file, located in the Islandora module's 'tests' folder as test_config.ini or default.test_config.ini.", array( + $filter_status_message .= t("Drupal filter at !filter_path is not writable by the server. Please make sure your webserver has permission to write to the Drupal filter. If the path given is incorrect, you will need to change it in your server's test config file, located in the Islandora module's 'tests' folder as test_config.ini or default.test_config.ini.", array( '!filter_path' => $filter_path, )); } From 9670b47950eb5432d660a14ea1d9ddc75d7c340b Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Thu, 2 Apr 2015 11:04:47 -0300 Subject: [PATCH 05/10] cleaning up islandora.api.php --- islandora.api.php | 82 ++++++++++------------------------------------- 1 file changed, 17 insertions(+), 65 deletions(-) diff --git a/islandora.api.php b/islandora.api.php index 95e08f1d..f06a0786 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -1,10 +1,8 @@ $object->label, 'path' => $resource_url, ); - // Theme the image seperatly. $variables['islandora_img'] = theme('image', $params); $output = theme('islandora_default_print', array( 'islandora_content' => $variables['islandora_img'])); } - return $output; } /** @@ -59,8 +55,6 @@ function hook_islandora_view_print_object($object) { */ function hook_cmodel_pid_islandora_view_object($object) { } - - /** * Alter display output after it has been generated. * @@ -71,7 +65,6 @@ function hook_cmodel_pid_islandora_view_object($object) { */ function hook_islandora_view_object_alter(&$object, &$rendered) { } - /** * Alter display output if the object has the given model. * @@ -84,7 +77,6 @@ function hook_islandora_view_object_alter(&$object, &$rendered) { */ function hook_cmodel_pid_islandora_view_object_alter(&$object, &$rendered) { } - /** * Generate an object's datastreams management display. * @@ -96,7 +88,6 @@ function hook_cmodel_pid_islandora_view_object_alter(&$object, &$rendered) { */ function hook_islandora_edit_object($object) { } - /** * Generate an object's datastreams management display based on content model. * @@ -111,7 +102,6 @@ function hook_islandora_edit_object($object) { */ function hook_cmodel_pid_islandora_edit_object($object) { } - /** * Allow datastreams management display output to be altered. * @@ -122,7 +112,6 @@ function hook_cmodel_pid_islandora_edit_object($object) { */ function hook_islandora_edit_object_alter(&$object, &$rendered) { } - /** * Allows modules to alter the object or block/modify the given action. * @@ -154,7 +143,6 @@ function hook_islandora_edit_object_alter(&$object, &$rendered) { */ function hook_islandora_object_alter(AbstractObject $object, array &$context) { } - /** * Allows modules to alter the object or block/modify the given action. * @@ -162,7 +150,6 @@ function hook_islandora_object_alter(AbstractObject $object, array &$context) { */ function hook_cmodel_pid_islandora_object_alter(AbstractObject $object, array &$context) { } - /** * Allows modules to alter the datastream or block/modify the given action. * @@ -203,7 +190,6 @@ function hook_cmodel_pid_islandora_object_alter(AbstractObject $object, array &$ */ function hook_islandora_datastream_alter(AbstractObject $object, AbstractDatastream $datastream, array &$context) { } - /** * Allows modules to alter the datastream or block/modify the given action. * @@ -211,7 +197,6 @@ function hook_islandora_datastream_alter(AbstractObject $object, AbstractDatastr */ function hook_cmodel_pid_dsid_islandora_datastream_alter(AbstractObject $object, AbstractDatastream $datastream, array &$context) { } - /** * Notify modules that the given object was ingested. * @@ -227,7 +212,6 @@ function hook_cmodel_pid_dsid_islandora_datastream_alter(AbstractObject $object, */ function hook_islandora_object_ingested(AbstractObject $object) { } - /** * Notify modules that the given object was ingested. * @@ -235,7 +219,6 @@ function hook_islandora_object_ingested(AbstractObject $object) { */ function hook_cmodel_pid_islandora_object_ingested(AbstractObject $object) { } - /** * Notify modules that the given object was modified. * @@ -245,22 +228,20 @@ function hook_cmodel_pid_islandora_object_ingested(AbstractObject $object) { * modifications, where as manipulating an object's datstreams are not. * * @param AbstractObject $object - * The object that was ingested. + * The object that was modified. * * @todo We should also include what changes were made in a additional * parameter. */ function hook_islandora_object_modified(AbstractObject $object) { } - /** - * Notify modules that the given object was ingested. + * Notify modules that the given object was modified. * * @see hook_islandora_object_modified() */ function hook_cmodel_pid_islandora_object_modified(AbstractObject $object) { } - /** * Notify modules that the given object was purged/deleted. * @@ -272,7 +253,6 @@ function hook_cmodel_pid_islandora_object_modified(AbstractObject $object) { */ function hook_islandora_object_purged($pid) { } - /** * Notify modules that the given object was purged/deleted. * @@ -280,7 +260,6 @@ function hook_islandora_object_purged($pid) { */ function hook_cmodel_pid_islandora_object_purged($pid) { } - /** * Notify modules that the given datastream was ingested. * @@ -297,7 +276,6 @@ function hook_cmodel_pid_islandora_object_purged($pid) { */ function hook_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { } - /** * Notify modules that the given datastream was ingested. * @@ -305,7 +283,6 @@ function hook_islandora_datastream_ingested(AbstractObject $object, AbstractData */ function hook_cmodel_pid_dsid_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { } - /** * Notify modules that the given datastream was modified. * @@ -324,7 +301,6 @@ function hook_cmodel_pid_dsid_islandora_datastream_ingested(AbstractObject $obje */ function hook_islandora_datastream_modified(AbstractObject $object, AbstractDatastream $datastream) { } - /** * Notify modules that the given datastream was modified. * @@ -332,7 +308,6 @@ function hook_islandora_datastream_modified(AbstractObject $object, AbstractData */ function hook_cmodel_pid_islandora_datastream_modified(AbstractObject $object, AbstractDatastream $datastream) { } - /** * Notify modules that the given datastream was purged/deleted. * @@ -346,7 +321,6 @@ function hook_cmodel_pid_islandora_datastream_modified(AbstractObject $object, A */ function hook_islandora_datastream_purged(AbstractObject $object, $dsid) { } - /** * Notify modules that the given datastream was purged/deleted. * @@ -354,18 +328,27 @@ function hook_islandora_datastream_purged(AbstractObject $object, $dsid) { */ function hook_cmodel_pid_islandora_datastream_purged(AbstractObject $object, $dsid) { } - /** * Register a datastream edit route/form. * * @param AbstractObject $object * The object to check. * @param string $dsid - * todo + * A string indicating the datastream for which to get the registry. + * + * @return array + * An array of associative arrays, each mapping: + * - name: A string containg a human-readable name for the entry. + * - url: A string containing the URL to which to the user will be routed. */ function hook_islandora_edit_datastream_registry($object, $dsid) { + $routes = array(); + $routes[] = array( + 'name' => t('My Awesome Edit Route'), + 'url' => "go/edit/here/{$object->id}/{$dsid}", + ); + return $routes; } - /** * Registry hook for required objects. * @@ -379,7 +362,6 @@ function hook_islandora_edit_datastream_registry($object, $dsid) { */ function hook_islandora_required_objects() { } - /** * Registry hook for viewers that can be implemented by solution packs. * @@ -391,7 +373,6 @@ function hook_islandora_required_objects() { */ function hook_islandora_viewer_info() { } - /** * Returns a list of datastreams that are determined to be undeletable. * @@ -406,7 +387,6 @@ function hook_islandora_viewer_info() { function hook_islandora_undeletable_datastreams(array $models) { return array('DC', 'MODS'); } - /** * Define steps used in the islandora_ingest_form() ingest process. * @@ -466,7 +446,6 @@ function hook_islandora_ingest_steps(array $form_state) { ), ); } - /** * Alter the generated ingest steps. * @@ -478,7 +457,6 @@ function hook_islandora_ingest_steps(array $form_state) { */ function hook_islandora_ingest_steps_alter(array &$steps, array &$form_state) { } - /** * Content model specific version of hook_islandora_ingest_steps(). * @@ -491,7 +469,6 @@ function hook_islandora_ingest_steps_alter(array &$steps, array &$form_state) { */ function hook_cmodel_pid_islandora_ingest_steps(array $form_state) { } - /** * Alter the generated ingest steps for the given content model. * @@ -503,7 +480,6 @@ function hook_cmodel_pid_islandora_ingest_steps(array $form_state) { */ function hook_cmodel_pid_islandora_ingest_steps_alter(array &$steps, array &$form_state) { } - /** * Object-level access callback hook. * @@ -525,16 +501,12 @@ function hook_islandora_object_access($op, $object, $user) { switch ($op) { case 'create stuff': return TRUE; - case 'break stuff': return FALSE; - case 'do a barrel roll!': return NULL; - } } - /** * Content model specific version of hook_islandora_object_access(). * @@ -542,7 +514,6 @@ function hook_islandora_object_access($op, $object, $user) { */ function hook_cmodel_pid_islandora_object_access($op, $object, $user) { } - /** * Datastream-level access callback hook. * @@ -564,16 +535,12 @@ function hook_islandora_datastream_access($op, $object, $user) { switch ($op) { case 'create stuff': return TRUE; - case 'break stuff': return FALSE; - case 'do a barrel roll!': return NULL; - } } - /** * Content model specific version of hook_islandora_datastream_access(). * @@ -581,14 +548,12 @@ function hook_islandora_datastream_access($op, $object, $user) { */ function hook_cmodel_pid_islandora_datastream_access($op, $object, $user) { } - /** * Lets one add to the overview tab in object management. */ function hook_islandora_overview_object(AbstractObject $object) { return drupal_render(drupal_get_form('some_form', $object)); } - /** * Lets one add to the overview tab in object management. * @@ -603,21 +568,14 @@ function hook_cmodel_pid_islandora_overview_object(AbstractObject $object) { function hook_islandora_overview_object_alter(AbstractObject &$object, &$output) { $output = $output . drupal_render(drupal_get_form('some_form', $object)); } - /** * Lets one alter the overview tab in object management. * * Content model specific. */ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object, &$output) { - $view = views_embed_view('usage_collection'); - $form['islandora_manage_overview_object'] = array( - '#type' => 'item', - '#markup' => $view, - ); - $output = $output . $form . drupal_render(drupal_get_form('some_form', $object)); + $output = $output . drupal_render(drupal_get_form('some_form', $object)); } - /** * Defines derivative functions to be executed based on certain conditions. * @@ -661,7 +619,6 @@ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object * is being called from. */ function hook_islandora_derivative(AbstractObject $object = NULL) { - $derivatives[] = array( 'source_dsid' => 'OBJ', 'destination_dsid' => 'DERIV', @@ -681,7 +638,6 @@ function hook_islandora_derivative(AbstractObject $object = NULL) { ), ); } - $derivatives[] = array( 'source_dsid' => NULL, 'destination_dsid' => 'NOSOURCE', @@ -690,19 +646,15 @@ function hook_islandora_derivative(AbstractObject $object = NULL) { 'islandora_derivatives_test_create_nosource_datastream', ), ); - return $derivatives; } - /** * Content model specific version of hook_islandora_derivative(). * * @see hook_islandora_derivative() */ function hook_cmodel_pid_islandora_derivative() { - } - /** * Retrieves PIDS of related objects for property updating. * @@ -728,9 +680,7 @@ function hook_islandora_update_related_objects_properties(AbstractObject $object * (Optional) AbstractObject representing object providing breadcrumb path */ function hook_islandora_breadcrumbs_alter(&$breadcrumbs, $context, $object = NULL) { - } - /** * Registry hook for metadata display viewers. * @@ -763,3 +713,5 @@ function hook_islandora_metadata_display_info() { ), ); } +Status API Training Shop Blog About +© 2015 GitHub, Inc. Terms Privacy Security Contact From 8866fbe548ca0fc9c93dfb6fa36e1d8cbafd6380 Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Thu, 2 Apr 2015 11:06:27 -0300 Subject: [PATCH 06/10] cleaning up islandora.api.php --- islandora.api.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/islandora.api.php b/islandora.api.php index f06a0786..a912991c 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -713,5 +713,3 @@ function hook_islandora_metadata_display_info() { ), ); } -Status API Training Shop Blog About -© 2015 GitHub, Inc. Terms Privacy Security Contact From f02214f95e9ea00c5463ac2b5a33dd04a608ad04 Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Thu, 2 Apr 2015 11:23:40 -0300 Subject: [PATCH 07/10] Tidying up module --- islandora.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/islandora.module b/islandora.module index a7d0cdee..cfd045e1 100644 --- a/islandora.module +++ b/islandora.module @@ -1819,14 +1819,14 @@ function islandora_form_simpletest_test_form_alter(array &$form) { $filter_status = is_writable($filter_path); if ($filter_status) { $filter_status_message = theme_image(array('path' => 'misc/watchdog-ok.png', 'attributes' => array())) . " "; - $filter_status_message .= t("Drupal filter at !filter_path is writable by the server.", array( - '!filter_path' => $filter_path, + $filter_status_message .= t("Drupal filter at @filter_path is writable by the server.", array( + '@filter_path' => $filter_path, )); } else { $filter_status_message = theme_image(array('path' => 'misc/watchdog-error.png', 'attributes' => array())) . " "; - $filter_status_message .= t("Drupal filter at !filter_path is not writable by the server. Please make sure your webserver has permission to write to the Drupal filter. If the path given is incorrect, you will need to change it in your server's test config file, located in the Islandora module's 'tests' folder as test_config.ini or default.test_config.ini.", array( - '!filter_path' => $filter_path, + $filter_status_message .= t("Drupal filter at @filter_path is not writable by the server. Please make sure your webserver has permission to write to the Drupal filter. If the path given is incorrect, you will need to change it in your server's test config file, located in the Islandora module's 'tests' folder as test_config.ini or default.test_config.ini.", array( + '@filter_path' => $filter_path, )); } From d2e53b6b5abb0a32af99b8923b16396a36134876 Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 6 Apr 2015 11:18:47 -0300 Subject: [PATCH 08/10] cleaning up --- includes/admin.form.inc | 6 ++++ islandora.api.php | 80 +++++++++++++++++++++++++++++++++-------- 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/includes/admin.form.inc b/includes/admin.form.inc index 0d932697..5db13f73 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -74,6 +74,12 @@ function islandora_repository_admin(array $form, array &$form_state) { '#description' => t('Displays an extra print tab, allowing an object to be printed'), '#default_value' => variable_get('islandora_show_print_option', FALSE), ), + 'islandora_render_drupal_breadcrumbs' => array( + '#type' => 'checkbox', + '#title' => t('Render Drupal breadcrumbs'), + '#description' => t('Larger sites may experience a notable performance improvement when disabled due to how breadcrumbs are constructed.'), + '#default_value' => variable_get('islandora_render_drupal_breadcrumbs', TRUE), + ), ), 'islandora_namespace' => array( '#type' => 'fieldset', diff --git a/islandora.api.php b/islandora.api.php index a912991c..95e08f1d 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -1,8 +1,10 @@ $object->label, 'path' => $resource_url, ); + // Theme the image seperatly. $variables['islandora_img'] = theme('image', $params); $output = theme('islandora_default_print', array( 'islandora_content' => $variables['islandora_img'])); } + return $output; } /** @@ -55,6 +59,8 @@ function hook_islandora_view_print_object($object) { */ function hook_cmodel_pid_islandora_view_object($object) { } + + /** * Alter display output after it has been generated. * @@ -65,6 +71,7 @@ function hook_cmodel_pid_islandora_view_object($object) { */ function hook_islandora_view_object_alter(&$object, &$rendered) { } + /** * Alter display output if the object has the given model. * @@ -77,6 +84,7 @@ function hook_islandora_view_object_alter(&$object, &$rendered) { */ function hook_cmodel_pid_islandora_view_object_alter(&$object, &$rendered) { } + /** * Generate an object's datastreams management display. * @@ -88,6 +96,7 @@ function hook_cmodel_pid_islandora_view_object_alter(&$object, &$rendered) { */ function hook_islandora_edit_object($object) { } + /** * Generate an object's datastreams management display based on content model. * @@ -102,6 +111,7 @@ function hook_islandora_edit_object($object) { */ function hook_cmodel_pid_islandora_edit_object($object) { } + /** * Allow datastreams management display output to be altered. * @@ -112,6 +122,7 @@ function hook_cmodel_pid_islandora_edit_object($object) { */ function hook_islandora_edit_object_alter(&$object, &$rendered) { } + /** * Allows modules to alter the object or block/modify the given action. * @@ -143,6 +154,7 @@ function hook_islandora_edit_object_alter(&$object, &$rendered) { */ function hook_islandora_object_alter(AbstractObject $object, array &$context) { } + /** * Allows modules to alter the object or block/modify the given action. * @@ -150,6 +162,7 @@ function hook_islandora_object_alter(AbstractObject $object, array &$context) { */ function hook_cmodel_pid_islandora_object_alter(AbstractObject $object, array &$context) { } + /** * Allows modules to alter the datastream or block/modify the given action. * @@ -190,6 +203,7 @@ function hook_cmodel_pid_islandora_object_alter(AbstractObject $object, array &$ */ function hook_islandora_datastream_alter(AbstractObject $object, AbstractDatastream $datastream, array &$context) { } + /** * Allows modules to alter the datastream or block/modify the given action. * @@ -197,6 +211,7 @@ function hook_islandora_datastream_alter(AbstractObject $object, AbstractDatastr */ function hook_cmodel_pid_dsid_islandora_datastream_alter(AbstractObject $object, AbstractDatastream $datastream, array &$context) { } + /** * Notify modules that the given object was ingested. * @@ -212,6 +227,7 @@ function hook_cmodel_pid_dsid_islandora_datastream_alter(AbstractObject $object, */ function hook_islandora_object_ingested(AbstractObject $object) { } + /** * Notify modules that the given object was ingested. * @@ -219,6 +235,7 @@ function hook_islandora_object_ingested(AbstractObject $object) { */ function hook_cmodel_pid_islandora_object_ingested(AbstractObject $object) { } + /** * Notify modules that the given object was modified. * @@ -228,20 +245,22 @@ function hook_cmodel_pid_islandora_object_ingested(AbstractObject $object) { * modifications, where as manipulating an object's datstreams are not. * * @param AbstractObject $object - * The object that was modified. + * The object that was ingested. * * @todo We should also include what changes were made in a additional * parameter. */ function hook_islandora_object_modified(AbstractObject $object) { } + /** - * Notify modules that the given object was modified. + * Notify modules that the given object was ingested. * * @see hook_islandora_object_modified() */ function hook_cmodel_pid_islandora_object_modified(AbstractObject $object) { } + /** * Notify modules that the given object was purged/deleted. * @@ -253,6 +272,7 @@ function hook_cmodel_pid_islandora_object_modified(AbstractObject $object) { */ function hook_islandora_object_purged($pid) { } + /** * Notify modules that the given object was purged/deleted. * @@ -260,6 +280,7 @@ function hook_islandora_object_purged($pid) { */ function hook_cmodel_pid_islandora_object_purged($pid) { } + /** * Notify modules that the given datastream was ingested. * @@ -276,6 +297,7 @@ function hook_cmodel_pid_islandora_object_purged($pid) { */ function hook_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { } + /** * Notify modules that the given datastream was ingested. * @@ -283,6 +305,7 @@ function hook_islandora_datastream_ingested(AbstractObject $object, AbstractData */ function hook_cmodel_pid_dsid_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { } + /** * Notify modules that the given datastream was modified. * @@ -301,6 +324,7 @@ function hook_cmodel_pid_dsid_islandora_datastream_ingested(AbstractObject $obje */ function hook_islandora_datastream_modified(AbstractObject $object, AbstractDatastream $datastream) { } + /** * Notify modules that the given datastream was modified. * @@ -308,6 +332,7 @@ function hook_islandora_datastream_modified(AbstractObject $object, AbstractData */ function hook_cmodel_pid_islandora_datastream_modified(AbstractObject $object, AbstractDatastream $datastream) { } + /** * Notify modules that the given datastream was purged/deleted. * @@ -321,6 +346,7 @@ function hook_cmodel_pid_islandora_datastream_modified(AbstractObject $object, A */ function hook_islandora_datastream_purged(AbstractObject $object, $dsid) { } + /** * Notify modules that the given datastream was purged/deleted. * @@ -328,27 +354,18 @@ function hook_islandora_datastream_purged(AbstractObject $object, $dsid) { */ function hook_cmodel_pid_islandora_datastream_purged(AbstractObject $object, $dsid) { } + /** * Register a datastream edit route/form. * * @param AbstractObject $object * The object to check. * @param string $dsid - * A string indicating the datastream for which to get the registry. - * - * @return array - * An array of associative arrays, each mapping: - * - name: A string containg a human-readable name for the entry. - * - url: A string containing the URL to which to the user will be routed. + * todo */ function hook_islandora_edit_datastream_registry($object, $dsid) { - $routes = array(); - $routes[] = array( - 'name' => t('My Awesome Edit Route'), - 'url' => "go/edit/here/{$object->id}/{$dsid}", - ); - return $routes; } + /** * Registry hook for required objects. * @@ -362,6 +379,7 @@ function hook_islandora_edit_datastream_registry($object, $dsid) { */ function hook_islandora_required_objects() { } + /** * Registry hook for viewers that can be implemented by solution packs. * @@ -373,6 +391,7 @@ function hook_islandora_required_objects() { */ function hook_islandora_viewer_info() { } + /** * Returns a list of datastreams that are determined to be undeletable. * @@ -387,6 +406,7 @@ function hook_islandora_viewer_info() { function hook_islandora_undeletable_datastreams(array $models) { return array('DC', 'MODS'); } + /** * Define steps used in the islandora_ingest_form() ingest process. * @@ -446,6 +466,7 @@ function hook_islandora_ingest_steps(array $form_state) { ), ); } + /** * Alter the generated ingest steps. * @@ -457,6 +478,7 @@ function hook_islandora_ingest_steps(array $form_state) { */ function hook_islandora_ingest_steps_alter(array &$steps, array &$form_state) { } + /** * Content model specific version of hook_islandora_ingest_steps(). * @@ -469,6 +491,7 @@ function hook_islandora_ingest_steps_alter(array &$steps, array &$form_state) { */ function hook_cmodel_pid_islandora_ingest_steps(array $form_state) { } + /** * Alter the generated ingest steps for the given content model. * @@ -480,6 +503,7 @@ function hook_cmodel_pid_islandora_ingest_steps(array $form_state) { */ function hook_cmodel_pid_islandora_ingest_steps_alter(array &$steps, array &$form_state) { } + /** * Object-level access callback hook. * @@ -501,12 +525,16 @@ function hook_islandora_object_access($op, $object, $user) { switch ($op) { case 'create stuff': return TRUE; + case 'break stuff': return FALSE; + case 'do a barrel roll!': return NULL; + } } + /** * Content model specific version of hook_islandora_object_access(). * @@ -514,6 +542,7 @@ function hook_islandora_object_access($op, $object, $user) { */ function hook_cmodel_pid_islandora_object_access($op, $object, $user) { } + /** * Datastream-level access callback hook. * @@ -535,12 +564,16 @@ function hook_islandora_datastream_access($op, $object, $user) { switch ($op) { case 'create stuff': return TRUE; + case 'break stuff': return FALSE; + case 'do a barrel roll!': return NULL; + } } + /** * Content model specific version of hook_islandora_datastream_access(). * @@ -548,12 +581,14 @@ function hook_islandora_datastream_access($op, $object, $user) { */ function hook_cmodel_pid_islandora_datastream_access($op, $object, $user) { } + /** * Lets one add to the overview tab in object management. */ function hook_islandora_overview_object(AbstractObject $object) { return drupal_render(drupal_get_form('some_form', $object)); } + /** * Lets one add to the overview tab in object management. * @@ -568,14 +603,21 @@ function hook_cmodel_pid_islandora_overview_object(AbstractObject $object) { function hook_islandora_overview_object_alter(AbstractObject &$object, &$output) { $output = $output . drupal_render(drupal_get_form('some_form', $object)); } + /** * Lets one alter the overview tab in object management. * * Content model specific. */ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object, &$output) { - $output = $output . drupal_render(drupal_get_form('some_form', $object)); + $view = views_embed_view('usage_collection'); + $form['islandora_manage_overview_object'] = array( + '#type' => 'item', + '#markup' => $view, + ); + $output = $output . $form . drupal_render(drupal_get_form('some_form', $object)); } + /** * Defines derivative functions to be executed based on certain conditions. * @@ -619,6 +661,7 @@ function hook_cmodel_pid_islandora_overview_object_alter(AbstractObject &$object * is being called from. */ function hook_islandora_derivative(AbstractObject $object = NULL) { + $derivatives[] = array( 'source_dsid' => 'OBJ', 'destination_dsid' => 'DERIV', @@ -638,6 +681,7 @@ function hook_islandora_derivative(AbstractObject $object = NULL) { ), ); } + $derivatives[] = array( 'source_dsid' => NULL, 'destination_dsid' => 'NOSOURCE', @@ -646,15 +690,19 @@ function hook_islandora_derivative(AbstractObject $object = NULL) { 'islandora_derivatives_test_create_nosource_datastream', ), ); + return $derivatives; } + /** * Content model specific version of hook_islandora_derivative(). * * @see hook_islandora_derivative() */ function hook_cmodel_pid_islandora_derivative() { + } + /** * Retrieves PIDS of related objects for property updating. * @@ -680,7 +728,9 @@ function hook_islandora_update_related_objects_properties(AbstractObject $object * (Optional) AbstractObject representing object providing breadcrumb path */ function hook_islandora_breadcrumbs_alter(&$breadcrumbs, $context, $object = NULL) { + } + /** * Registry hook for metadata display viewers. * From 57ccee7a780c0ddcc4c7751a7d9c23867959eed1 Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 6 Apr 2015 11:49:08 -0300 Subject: [PATCH 09/10] cleaning up commits --- includes/admin.form.inc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/includes/admin.form.inc b/includes/admin.form.inc index 5db13f73..0d932697 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -74,12 +74,6 @@ function islandora_repository_admin(array $form, array &$form_state) { '#description' => t('Displays an extra print tab, allowing an object to be printed'), '#default_value' => variable_get('islandora_show_print_option', FALSE), ), - 'islandora_render_drupal_breadcrumbs' => array( - '#type' => 'checkbox', - '#title' => t('Render Drupal breadcrumbs'), - '#description' => t('Larger sites may experience a notable performance improvement when disabled due to how breadcrumbs are constructed.'), - '#default_value' => variable_get('islandora_render_drupal_breadcrumbs', TRUE), - ), ), 'islandora_namespace' => array( '#type' => 'fieldset', From a5af26c3ce98792e325691e74138ae279cb22d66 Mon Sep 17 00:00:00 2001 From: Kylea Jackson Date: Mon, 6 Apr 2015 11:52:06 -0300 Subject: [PATCH 10/10] cleaning up commits --- includes/admin.form.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/admin.form.inc b/includes/admin.form.inc index 0d932697..5db13f73 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -74,6 +74,12 @@ function islandora_repository_admin(array $form, array &$form_state) { '#description' => t('Displays an extra print tab, allowing an object to be printed'), '#default_value' => variable_get('islandora_show_print_option', FALSE), ), + 'islandora_render_drupal_breadcrumbs' => array( + '#type' => 'checkbox', + '#title' => t('Render Drupal breadcrumbs'), + '#description' => t('Larger sites may experience a notable performance improvement when disabled due to how breadcrumbs are constructed.'), + '#default_value' => variable_get('islandora_render_drupal_breadcrumbs', TRUE), + ), ), 'islandora_namespace' => array( '#type' => 'fieldset',