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/101/head
Adam Vessey 13 years ago
parent
commit
83cd4b871a
  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);
//Get the tabs from all modules...
$hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid, $page_number);
$cmodels_tabs = array(
'#type' => 'tabset',
);
$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);
}

Loading…
Cancel
Save