]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
improved the plugin hooks
authorCash Costello <cash.costello@gmail.com>
Sun, 13 Dec 2009 00:49:02 +0000 (00:49 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 13 Dec 2009 00:49:02 +0000 (00:49 +0000)
pages/viewalbum.php
start.php
views/default/object/image.php

index 9ebc31faef89eb33aba344e16aad2ca1301cc8ef..050b124cb54270f0ea8f014f0e8accccec5244aa 100644 (file)
@@ -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,
index f2732b3de34b695feb8193bd8df245cb7729993f..7b6e46805b83746018bf744a326a28ff93ed1a90 100644 (file)
--- a/start.php
+++ b/start.php
         * @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) {
index 02444eaadf089a81f56955dc1b60d974587ce35f..ee81d800fe3efa6420252eddb625419a8007b7f4 100644 (file)
@@ -69,7 +69,7 @@
 <?php 
        // plugins can override the image link to add lightbox code here
        $image_html = false;
-       $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html);
+       $image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('image' => $image), $image_html);
        
        if ($image_html) {
                echo $image_html;
                <div id="tidypics_image_wrapper">
                        <?php
                                // this code controls whether the photo is a hyperlink or not and what it links to 
-                               $image_link = false;
                                if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
                                        // admin allows downloads so default to inline download link
-                                       $image_link = $vars['url'] . "pg/photos/download/{$image_guid}/inline/";
-                               }
-                               // does any plugin want to override the link
-                               $image_link = trigger_plugin_hook('tp_image_link', 'image', $image, $image_link);                               
-                               // add link if set
-                               if ($image_link) {
-                                       echo "<a href=\"{$image_link}\" title=\"{$title}\"><img id=\"tidypics_image\"  src=\"{$vars['url']}mod/tidypics/thumbnail.php?file_guid={$image_guid}&amp;size=large\" alt=\"{$title}\" /></a>";
+                                       $image_html = "<a href=\"{$vars['url']}pg/photos/download/{$image_guid}/inline/\" title=\"{$title}\" >";
+                                       $image_html .= "<img id=\"tidypics_image\"  src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$title}\" />";
+                                       $image_html .= "</a>";
                                } else {
-                                       // no link for this image
-                                       echo "<img id=\"tidypics_image\"  src=\"{$vars['url']}mod/tidypics/thumbnail.php?file_guid={$image_guid}&amp;size=large\" alt=\"{$title}\" />";
+                                       $image_html = "<img id=\"tidypics_image\"  src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$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;
                                ?>
                        <div class="clearfloat"></div>
                </div>