diff options
author | Jehan-Guillaume (ioguix) de Rorthais | 2013-03-25 15:37:06 +0000 |
---|---|---|
committer | Robert Treat | 2013-03-26 17:57:11 +0000 |
commit | 3f212d646ee7c94efbd2b6b7b7d18450d531e33d (patch) | |
tree | b649733498439aa3e62b5465704e722913b96ba3 | |
parent | 202be379e6e7cf7ad217d945d367fff448cb7256 (diff) |
Add plugin hook 'head'.
Allows to add tags in <head /> from plugins
-rw-r--r-- | classes/Misc.php | 12 | ||||
-rw-r--r-- | classes/PluginManager.php | 1 |
2 files changed, 12 insertions, 1 deletions
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 "</title>\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 "</head>\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', |