X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fplugin.php;h=6e66aa60a1885aea62035c41fd9a7e9334e57c0b;hb=c3806a9dc07e4bf45491e7120a1c931332f2e555;hp=280e41464548018e5bb648031b10485eff6829c6;hpb=e83cfcef36555a0ab2bf7ef257441850f89aedc4;p=squirrelmail.git diff --git a/functions/plugin.php b/functions/plugin.php index 280e4146..6e66aa60 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -7,19 +7,12 @@ * * Documentation on how to write plugins might show up some time. * - * @copyright © 1999-2005 The SquirrelMail Project Team + * @copyright © 1999-2006 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ -/** Everything needs global.. */ -require_once(SM_PATH . 'functions/global.php'); -require_once(SM_PATH . 'functions/prefs.php'); - -global $squirrelmail_plugin_hooks; -$squirrelmail_plugin_hooks = array(); - /** * This function adds a plugin. * @param string $name Internal plugin name (ie. delete_move_next) @@ -199,11 +192,12 @@ function is_plugin_enabled($plugin_name) { global $plugins; /** - * check if variable is set. can't do is_array(), if variable is not set - * check if it is an array - * there is no need to call in_array() if $plugins array is empty + * check if variable is empty. if var is not set, php empty + * returns true without error notice. + * + * then check if it is an array */ - if (! isset($plugins) || ! is_array($plugins) || empty($plugins)) + if (empty($plugins) || ! is_array($plugins)) return false; if ( in_array($plugin_name,$plugins) ) { @@ -212,16 +206,4 @@ function is_plugin_enabled($plugin_name) { return false; } } - -/*************************************/ -/*** MAIN PLUGIN LOADING CODE HERE ***/ -/*************************************/ - -/* On startup, register all plugins configured for use. */ -if (isset($plugins) && is_array($plugins)) { - foreach ($plugins as $name) { - use_plugin($name); - } -} - -?> \ No newline at end of file +?>