]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
cleaned up events and plugin hooks
authorCash Costello <cash.costello@gmail.com>
Sat, 3 Oct 2009 18:20:59 +0000 (18:20 +0000)
committerCash Costello <cash.costello@gmail.com>
Sat, 3 Oct 2009 18:20:59 +0000 (18:20 +0000)
actions/delete.php
actions/edit.php
docs/extending_tidypics.txt
pages/viewalbum.php
start.php

index 498c991c783646415bb48a67b567e05df5ee696a..1a518af9e979b3c5032ff5317525eebd240feecc 100644 (file)
                $forward_url = $container->getURL(); //forward back to album after deleting pictures\r
                $images = array($entity);\r
                // plugins can register to be told when a Tidypics image has been deleted\r
-               trigger_elgg_event('upload', 'tp_album', $entity);\r
+               trigger_elgg_event('delete', 'tp_image', $entity);\r
        } else { //deleting an album\r
                $owner_guid = $entity->container_guid;\r
                $forward_url = 'pg/photos/owned/' . $container->username;\r
                //get all the images from this album as long as less than 999 images\r
                $images = get_entities("object", "image", $guid, '', 999); \r
                // plugins can register to be told when a Tidypics album has been deleted\r
-               trigger_elgg_event('upload', 'tp_album', $entity);\r
+               trigger_elgg_event('delete', 'tp_album', $entity);\r
        }\r
 \r
        // make sure we decrease the repo size for the size quota\r
index e8f2e3aca22d841d2656b8fc2d174f1354881eb1..91c4658287328a8c0ac356c9c0864703d006be29 100644 (file)
@@ -74,7 +74,7 @@
        } else {\r
                system_message(elgg_echo('images:edited'));\r
                // plugins can register to be told when a Tidypics image has been updated\r
-               trigger_elgg_event('update', 'tp_album', $entity);\r
+               trigger_elgg_event('update', 'tp_image', $entity);\r
        }\r
 \r
        forward($entity->getURL());\r
index 8d3674cbdabf309b93f4dec2b9cea64acd3e6361..0fd544119cc92e8a9594efeeb18c0a3d8bdcef81 100644 (file)
@@ -1,9 +1,26 @@
 Extending Tidypics\r
 -----------------------------------\r
 \r
-We will include more information here in the future. For right now, we will \r
-mention that we have included some code to make it easy to put the latest\r
-photos on your front page. See tidypics/lib/tidypics.php and the function\r
-tp_get_latest_photos().\r
+*** DISPLAYING THE LATEST PHOTOS ***\r
+In tidypics/lib/tidypics.php, there is a function tp_get_latest_photos().\r
+It can be used to display the site-wide latest photos or an individual\r
+user's latest photos. The documentation explains how you could use that\r
+function to display the latest photos on your front page if you are using\r
+the custom front page tutorial plugin from Curverider. \r
 \r
\ No newline at end of file
+\r
+*** MAKING TIDYPICS MATCH YOUR THEME ***\r
+Please check the css guid found in this directory. This will list the \r
+different css elements and where they are used.\r
+\r
+\r
+*** TIDYPICS EVENTS ***\r
+1. album created: 'add', 'tp_album'\r
+2. album updated: 'update', 'tp_album'\r
+3. album deleted: 'delete', 'tp_album'\r
+4. photos uploaded: 'upload', 'tp_album'\r
+5. photo edited: 'update', 'tp_image'\r
+6. photo deleted: 'delete', 'tp_image'  \r
+\r
+*** TIDYPICS PLUGIN HOOKS ***\r
+1. album slideshow: 'tp_slideshow', 'album' - return false to not have a slideshow, otherwise return link to slideshow 
\ No newline at end of file
index 4b3e6d70318d044dc750b2de2ce2e433435bc98a..3cc854c94c097ab62814be810106e90d5542013e 100644 (file)
@@ -33,7 +33,7 @@
        }\r
        \r
        // allow other plugins to override the slideshow\r
-       $slideshow_link = trigger_plugin_hook('tidypics:slideshow', 'album', $album, false);\r
+       $slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', $album, null);\r
        if ($slideshow_link) {\r
                add_submenu_item(elgg_echo('album:slideshow'),\r
                                                $slideshow_link,\r
index 24189d44d4405db0449df8d274c73c4762791472..a15215118a7274ce021cf1fa4c334c6505e9220e 100644 (file)
--- a/start.php
+++ b/start.php
@@ -72,7 +72,7 @@
                }\r
                \r
                // slideshow plugin hook\r
-               register_plugin_hook('tidypics:slideshow', 'album', 'tidypics_slideshow');\r
+               register_plugin_hook('tp_slideshow', 'album', 'tidypics_slideshow');\r
        }\r
        \r
        /**\r
         */\r
        function tidypics_slideshow($hook, $entity_type, $returnvalue, $params) {\r
                \r
-               if ($returnvalue) {\r
-                       // someone has already added a slideshow\r
+               if ($returnvalue !== null) {\r
+                       // someone has already added a slideshow or requested that the slideshow is not used\r
                        return $returnvalue;\r
                }\r
                \r