diff options
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/Misc.php | 12 | ||||
| -rw-r--r-- | classes/PluginManager.php | 15 |
2 files changed, 22 insertions, 5 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..203808f1 100644 --- a/classes/PluginManager.php +++ b/classes/PluginManager.php @@ -11,12 +11,14 @@ class PluginManager { */ private $plugins_list = array(); private $available_hooks = array( + 'head', 'toplinks', 'tabs', 'trail', 'navlinks', 'actionbuttons', - 'tree' + 'tree', + 'logout' ); private $actions = array(); private $hooks = array(); @@ -37,8 +39,13 @@ class PluginManager { // Verify is the activated plugin exists if (file_exists($plugin_file)) { include_once($plugin_file); - $plugin = new $activated_plugin($language); - $this->add_plugin($plugin); + try { + $plugin = new $activated_plugin($language); + $this->add_plugin($plugin); + } + catch (Exception $e) { + continue; + } } else { printf($lang['strpluginnotfound']."\t\n", $activated_plugin); exit; @@ -109,7 +116,7 @@ class PluginManager { if (!isset($this->plugins_list[$plugin_name])) { // Show an error and stop the application - printf($lang['strpluginnotfound']."\t\n", $name); + printf($lang['strpluginnotfound']."\t\n", $plugin_name); exit; } $plugin = $this->plugins_list[$plugin_name]; |
