Added Blue Gray theme
[squirrelmail.git] / functions / plugin.php
index 4b86b769824c00d8d8f76abce5745e87025edab4..a6371dfa62e1c744e720e055451b2051090fe31e 100644 (file)
  **/
 
 
-   $plugin_php = true;
+   if (defined('plugin_php'))
+      return;
+   define('plugin_php', true);
+
+   global $plugin_general_debug, $squirrelmail_plugin_hooks;
    $plugin_general_debug = false;
+   
+   $squirrelmail_plugin_hooks = array();
 
    // This function adds a plugin
    function use_plugin ($name) {
@@ -32,7 +38,7 @@
         {
            if ($plugin_general_debug)
               echo "plugin:  ---- Executing $function to init plugin<br>\n";
-            $function();
+            $function($plugin_general_debug);
         }
         elseif ($plugin_general_debug)
            echo "plugin:  -- Init function $function doesn't exist.<br>\n";
          use_plugin($name);
       }
 
+   if ($plugin_general_debug)
+   {
+      echo "plugin:  Hook list<br>\n";
+      foreach ($squirrelmail_plugin_hooks as $Hook => $Plugins)
+      {
+          foreach ($Plugins as $Name => $Func)
+         {
+             echo "[$Hook][$Name] = $Func<br>\n";
+         }
+      }
+   }
+
 ?>