From b1f340a7041a92541b4e4220fa6c780f596dcc39 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Dec 2009 00:49:02 +0000 Subject: improved the plugin hooks --- pages/viewalbum.php | 2 +- start.php | 2 +- views/default/object/image.php | 19 ++++++++----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pages/viewalbum.php b/pages/viewalbum.php index 9ebc31fae..050b124cb 100644 --- a/pages/viewalbum.php +++ b/pages/viewalbum.php @@ -33,7 +33,7 @@ } // allow other plugins to override the slideshow - $slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', $album, null); + $slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array('album' => $album), null); if ($slideshow_link) { add_submenu_item(elgg_echo('album:slideshow'), $slideshow_link, diff --git a/start.php b/start.php index f2732b3de..7b6e46805 100644 --- a/start.php +++ b/start.php @@ -401,7 +401,7 @@ * @param $hook - 'tidypics:slideshow' * @param $entity_type - 'album' * @param $returnvalue - if set, return because another plugin has used the hook - * @param $params - album entity + * @param $params - arry containing album entity * @return unknown_type */ function tidypics_slideshow($hook, $entity_type, $returnvalue, $params) { diff --git a/views/default/object/image.php b/views/default/object/image.php index 02444eaad..ee81d800f 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -69,7 +69,7 @@ $image), $image_html); + $image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('image' => $image), $image_html); if ($image_html) { echo $image_html; @@ -161,20 +161,17 @@
\"{$title}\""; + $image_html = ""; + $image_html .= "\"{$title}\""; + $image_html .= ""; } else { - // no link for this image - echo "\"{$title}\""; + $image_html = "\"{$title}\""; } + // does any plugin want to override the link + $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html); + echo $image_html; ?>
-- cgit v1.2.3