From 65772a1c41fe83fb9f1b43b75164bfdb20ff06d8 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 29 Jan 2013 12:34:01 -0400 Subject: [PATCH] made viewer callback potentially aware of fedora object being displayed --- includes/solution_packs.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index bf50a1f5..fc696eb5 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -622,11 +622,14 @@ function theme_islandora_viewers_table($variables) { * Array or string with data the module needs in order to render a full viewer * @param string $variable_id * The id of the Drupal variable the viewer settings are saved in + * @param FedoraObject $fedora_object + * The tuque object representing the fedora object being displayed * @return * The callback to the viewer module. Returns a rendered viewer. Returns FALSE * if no viewer is set. */ -function islandora_get_viewer($params = NULL, $variable_id = NULL) { + +function islandora_get_viewer($params = NULL, $variable_id = NULL, $fedora_object = null) { // get viewer from settings $settings = variable_get($variable_id, array()); // make sure a viewer is set @@ -636,10 +639,10 @@ function islandora_get_viewer($params = NULL, $variable_id = NULL) { if ($viewer_id AND $params !== NULL) { $callback = islandora_get_viewer_callback($viewer_id); // call callback function - return $callback($params); + return $callback($params, $fedora_object); } } - return NULL; + return FALSE; } /**