From 3f212d646ee7c94efbd2b6b7b7d18450d531e33d Mon Sep 17 00:00:00 2001 From: "Jehan-Guillaume (ioguix) de Rorthais" Date: Mon, 25 Mar 2013 16:37:06 +0100 Subject: [PATCH] Add plugin hook 'head'. Allows to add tags in from plugins --- classes/Misc.php | 12 +++++++++++- classes/PluginManager.php | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/Misc.php b/classes/Misc.php index 0457b4d8..cd22df8b 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -520,7 +520,7 @@ * @param $script script tag */ function printHeader($title = '', $script = null, $frameset = false) { - global $appName, $lang, $_no_output, $conf; + global $appName, $lang, $_no_output, $conf, $plugin_manager; if (!isset($_no_output)) { header("Content-Type: text/html; charset=utf-8"); @@ -549,6 +549,16 @@ echo "\n"; if ($script) echo "{$script}\n"; + + $plugins_head = array(); + $_params = array('heads' => &$plugins_head); + + $plugin_manager->do_hook('head', $_params); + + foreach($plugins_head as $tag) { + echo $tag; + } + echo "\n"; } } diff --git a/classes/PluginManager.php b/classes/PluginManager.php index 3bc1eb39..9634b412 100644 --- a/classes/PluginManager.php +++ b/classes/PluginManager.php @@ -11,6 +11,7 @@ class PluginManager { */ private $plugins_list = array(); private $available_hooks = array( + 'head', 'toplinks', 'tabs', 'trail', -- 2.39.5