Browse Source

Introduce hook_islandora_tabs_alter().

Called just before return of drupal_render()'d markup.  Passed the
tabset and associative array of the parameters with which
hook_islandora_tabs() was called; that is:
array(
  'content_models' => {an array of ContentModel objects},
  'pid' => {the PID of the object being rendered},
  'page' => {the page of the object to be displayed},
)
pull/126/head
Adam Vessey 13 years ago committed by Adam Vessey
parent
commit
67bd855852
  1. 13
      fedora_repository.module

13
fedora_repository.module

@ -1086,13 +1086,24 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
$content_models = $objectHelper->get_content_models_list($pid); $content_models = $objectHelper->get_content_models_list($pid);
//Get the tabs from all modules...
$hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid, $page_number); $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid, $page_number);
$cmodels_tabs = array( $cmodels_tabs = array(
'#type' => 'tabset', '#type' => 'tabset',
); );
$cmodels_tabs = array_merge($cmodels_tabs, $hook_tabs); $cmodels_tabs = array_merge($cmodels_tabs, $hook_tabs);
//Assemble parameters, to pass during alter
$params = array(
'content_models' => $content_models,
'pid' => $pid,
'page' => $page_number,
);
//Allow returned tabs to be altered, before return.
drupal_alter('islandora_tabs', $cmodels_tabs, $params);
return tabs_render($cmodels_tabs); return tabs_render($cmodels_tabs);
} }

Loading…
Cancel
Save