diff options
author | Leonardo Sapiras | 2011-12-06 10:34:44 +0000 |
---|---|---|
committer | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-22 10:23:50 +0000 |
commit | a51e57caac86fb2b618921d35f78500dabf52194 (patch) | |
tree | 1534b026ddaa3c142d7e1912bfd00f7a9dc5cd10 | |
parent | b43084e022695d6b506799a1815fb4735bd57d13 (diff) |
Add support for 'trail' hooks in the plugin architecture.
By Leonardo Sapiras during the GSoC 2011, reviewed, patched, integrated
and commited by ioguix
-rw-r--r-- | classes/Misc.php | 10 | ||||
-rw-r--r-- | classes/PluginManager.php | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/classes/Misc.php b/classes/Misc.php index 4664dee1..7ba4a125 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -1414,7 +1414,7 @@ * @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 = ''; @@ -1553,6 +1553,14 @@ } } + // Trail hook's place + $plugin_functions_parameters = array( + 'trail' => &$trail, + 'section' => $subject + ); + + $plugin_manager->do_hook('trail', $plugin_functions_parameters); + return $trail; } diff --git a/classes/PluginManager.php b/classes/PluginManager.php index ce26d219..14ac543f 100644 --- a/classes/PluginManager.php +++ b/classes/PluginManager.php @@ -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(); |