Browse Source

another approach to getting the breadcrumb to display the link title

pull/348/head
Nelson Hart 11 years ago
parent
commit
44792a0b09
  1. 11
      includes/breadcrumb.inc
  2. 14
      islandora.module

11
includes/breadcrumb.inc

@ -57,10 +57,17 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository,
$root = variable_get('islandora_repository_pid', 'islandora:root'); $root = variable_get('islandora_repository_pid', 'islandora:root');
if ($pid == $root) { if ($pid == $root) {
$item = menu_get_item('islandora'); $title = 'Islandora Repository';
$trail = menu_get_active_trail();
foreach ($trail as $key => $item) {
if ($item['link_path'] == 'islandora') {
$title = $item['link_title'];
break;
}
}
return array( return array(
l(t('Home'), '<front>'), l(t('Home'), '<front>'),
l($item['title'], 'islandora'), l($title, 'islandora'),
); );
} }
else { else {

14
islandora.module

@ -88,7 +88,7 @@ function islandora_menu() {
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); );
$items['islandora'] = array( $items['islandora'] = array(
'title callback' => 'islandora_repository_root_label', 'title' => 'Islandora Repository',
'page callback' => 'islandora_view_default_object', 'page callback' => 'islandora_view_default_object',
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
'access arguments' => array(FEDORA_VIEW_OBJECTS), 'access arguments' => array(FEDORA_VIEW_OBJECTS),
@ -1126,15 +1126,3 @@ function islandora_file_mimetype_mapping_alter(&$mapping) {
$mapping['extensions'][$ext] = key($mapping['mimetypes']); $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);
$label = ($object ? $object->label : 'Islandora Repository');
return $label;
}

Loading…
Cancel
Save