From 7fef116c00f55abbaa9dbbe6dd638e3bbb0c2927 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 3 Sep 2013 19:39:00 +0000 Subject: [PATCH 1/2] Add alterable breadcrumbs to Islandora. --- includes/breadcrumb.inc | 1 + islandora.api.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index 872eb70a..24b9fbbe 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -27,6 +27,7 @@ function islandora_get_breadcrumbs($object) { $breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository); array_pop($breadcrumbs); + drupal_alter('islandora_breadcrumbs', $breadcrumbs); return $breadcrumbs; } diff --git a/islandora.api.php b/islandora.api.php index 6d25bae3..1d6754c9 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -648,3 +648,10 @@ function hook_islandora_derivative() { function hook_CMODEL_PID_islandora_derivative() { } + +/** + * Alters breadcrumbs used on Solr search results and collection views. + */ +function hook_islandora_breadcrumbs_alter(&$breadcrumbs) { + +} From 0c50962a63e91276f21a543f098ff1f9a37d8815 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 3 Sep 2013 19:55:07 +0000 Subject: [PATCH 2/2] Add context for ease of use. --- includes/breadcrumb.inc | 3 ++- islandora.api.php | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index 24b9fbbe..05ab1bac 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -27,7 +27,8 @@ function islandora_get_breadcrumbs($object) { $breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository); array_pop($breadcrumbs); - drupal_alter('islandora_breadcrumbs', $breadcrumbs); + $context = 'islandora'; + drupal_alter('islandora_breadcrumbs', $breadcrumbs, $context); return $breadcrumbs; } diff --git a/islandora.api.php b/islandora.api.php index 1d6754c9..3a773e2b 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -650,8 +650,13 @@ function hook_CMODEL_PID_islandora_derivative() { } /** - * Alters breadcrumbs used on Solr search results and collection views. + * Alters breadcrumbs used on Solr search results and within Islandora views. + * + * @param array $breadcrumbs + * Breadcrumbs array to be altered by reference. Each element is markup. + * @param string $context + * Where the alter is originating from for distinguishing. */ -function hook_islandora_breadcrumbs_alter(&$breadcrumbs) { +function hook_islandora_breadcrumbs_alter(&$breadcrumbs, $context) { }