|
|
|
@ -30,8 +30,7 @@ function islandora_get_breadcrumbs(AbstractObject $object) { |
|
|
|
$backend = variable_get('islandora_breadcrumbs_backends', ISLANDORA_BREADCRUMB_LEGACY_BACKEND); |
|
|
|
$backend = variable_get('islandora_breadcrumbs_backends', ISLANDORA_BREADCRUMB_LEGACY_BACKEND); |
|
|
|
$backends = module_invoke_all('islandora_breadcrumbs_backends'); |
|
|
|
$backends = module_invoke_all('islandora_breadcrumbs_backends'); |
|
|
|
if ($backend === ISLANDORA_BREADCRUMB_LEGACY_BACKEND || !isset($backends[$backend])) { |
|
|
|
if ($backend === ISLANDORA_BREADCRUMB_LEGACY_BACKEND || !isset($backends[$backend])) { |
|
|
|
$breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository); |
|
|
|
$breadcrumbs = islandora_get_breadcrumbs_legacy($object->id, $object->repository); |
|
|
|
array_pop($breadcrumbs); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
if (isset($backends[$backend]['file'])) { |
|
|
|
if (isset($backends[$backend]['file'])) { |
|
|
|
@ -45,6 +44,22 @@ function islandora_get_breadcrumbs(AbstractObject $object) { |
|
|
|
return $breadcrumbs; |
|
|
|
return $breadcrumbs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Call the legacy SPARQL recursive function and return the correct breadcrumbs. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param $pid |
|
|
|
|
|
|
|
* The object id whose parent will be fetched for the next link. |
|
|
|
|
|
|
|
* @param \IslandoraFedoraRepository $repository |
|
|
|
|
|
|
|
* The fedora repository. |
|
|
|
|
|
|
|
* @return array |
|
|
|
|
|
|
|
* An array of links representing the breadcrumb trail, "root" first. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function islandora_get_breadcrumbs_legacy($pid, IslandoraFedoraRepository $repository) { |
|
|
|
|
|
|
|
$breadcrumbs = islandora_get_breadcrumbs_recursive($pid, $repository); |
|
|
|
|
|
|
|
array_pop($breadcrumbs); |
|
|
|
|
|
|
|
return $breadcrumbs; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Builds an array of drupal links for use in breadcrumbs. |
|
|
|
* Builds an array of drupal links for use in breadcrumbs. |
|
|
|
* |
|
|
|
* |
|
|
|
|