Browse Source

added object for context in hook

pull/442/head
Alan Stanley 11 years ago
parent
commit
545cc9d708
  1. 6
      includes/breadcrumb.inc
  2. 4
      islandora.api.php

6
includes/breadcrumb.inc

@ -28,7 +28,7 @@ function islandora_get_breadcrumbs($object) {
$breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository); $breadcrumbs = islandora_get_breadcrumbs_recursive($object->id, $object->repository);
array_pop($breadcrumbs); array_pop($breadcrumbs);
$context = 'islandora'; $context = 'islandora';
drupal_alter('islandora_breadcrumbs', $breadcrumbs, $context); drupal_alter('islandora_breadcrumbs', $breadcrumbs, $context, $object);
return $breadcrumbs; return $breadcrumbs;
} }
@ -114,9 +114,7 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository,
// render the last two links and break (on the next pass). // render the last two links and break (on the next pass).
return array_merge( return array_merge(
islandora_get_breadcrumbs_recursive($root, $repository, $context), islandora_get_breadcrumbs_recursive($root, $repository, $context),
array( array('...')
'...',
)
); );
} }
} }

4
islandora.api.php

@ -691,8 +691,10 @@ function hook_islandora_update_related_objects_properties(AbstractObject $object
* Breadcrumbs array to be altered by reference. Each element is markup. * Breadcrumbs array to be altered by reference. Each element is markup.
* @param string $context * @param string $context
* Where the alter is originating from for distinguishing. * Where the alter is originating from for distinguishing.
* @param AbstractObject $object
* AbstractObject representing object providing breadcrumb path
*/ */
function hook_islandora_breadcrumbs_alter(&$breadcrumbs, $context) { function hook_islandora_breadcrumbs_alter(&$breadcrumbs, $context, $object) {
} }

Loading…
Cancel
Save