Add support for 'trail' hooks in the plugin architecture.
authorLeonardo Sapiras <l.sapiras@gmail.com>
Tue, 6 Dec 2011 10:34:44 +0000 (11:34 +0100)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 22 Aug 2012 10:23:50 +0000 (12:23 +0200)
By Leonardo Sapiras during the GSoC 2011, reviewed, patched, integrated
and commited by ioguix

classes/Misc.php
classes/PluginManager.php

index 4664dee197e830e99e213a974ba4f85c2c5be101..7ba4a125a8c5735f9915ad4be62327e1560085c3 100644 (file)
                 * @param $object The type of object at the end of the trail.
                 */
                function getTrail($subject = null) {
-                       global $lang, $conf, $data, $appName;
+                       global $lang, $conf, $data, $appName, $plugin_manager;
 
                        $trail = array();
                        $vars = '';
                                }
                        }
 
+                       // Trail hook's place
+                       $plugin_functions_parameters = array(
+                               'trail' => &$trail,
+                               'section' => $subject
+                       );
+
+                       $plugin_manager->do_hook('trail', $plugin_functions_parameters);
+
                        return $trail;
                }
 
index ce26d21919d5344eeba60bd6ec8d359b0708f107..14ac543f76a8e4e59f1eec342f63aea6116e03f5 100644 (file)
@@ -10,7 +10,7 @@ class PluginManager {
         * Attributes
         */
        private $plugins_list = array();
-       private $available_hooks = array('toplinks', 'tabs' /* wip, more hooks to come in next commits */);
+       private $available_hooks = array('toplinks', 'tabs', 'trail' /* wip, more hooks to come in next commits */);
        private $actions = array();
        private $hooks = array();