From 467f29786e36021c10b964b5ca622cdaaeeebdef Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Tue, 4 Jun 2013 12:00:36 -0300 Subject: [PATCH] display top level collection name as repo link. Also updates breadcrumb with top level collection name --- islandora.module | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index d6c89e99..4298f128 100644 --- a/islandora.module +++ b/islandora.module @@ -88,7 +88,7 @@ function islandora_menu() { 'type' => MENU_NORMAL_ITEM, ); $items['islandora'] = array( - 'title' => 'Islandora Repository', + 'title callback' => 'islandora_repository_root_label', 'page callback' => 'islandora_view_default_object', 'type' => MENU_NORMAL_ITEM, 'access arguments' => array(FEDORA_VIEW_OBJECTS), @@ -1126,3 +1126,17 @@ function islandora_file_mimetype_mapping_alter(&$mapping) { $mapping['extensions'][$ext] = key($mapping['mimetypes']); } } + +/** + * A callback to get the root collection label. + * + * + * @return text + * The object label of the root collection or the fallback + */ +function islandora_repository_root_label() { + $root = variable_get('islandora_repository_pid', 'islandora:root'); + $object = islandora_object_load($root); + $title = ($object ? $object->label : 'Islandora Repository'); + return $title; +}