From 83cd4b871a063992589d0ff3245747036b310744 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 1 May 2012 14:46:45 -0300 Subject: [PATCH] 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}, ) --- fedora_repository.module | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index fec7256e..7a1c7946 100644 --- a/fedora_repository.module +++ b/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); }