SpecialUserPrefs: fixed: userprefs_body hook only allowed first loaded plugin to work
authorDan
Sat, 04 Apr 2009 22:34:12 -0400
changeset 893 b24601274cd2
parent 892 668e6a9adf99
child 894 83d180d87f3c
SpecialUserPrefs: fixed: userprefs_body hook only allowed first loaded plugin to work
includes/plugins.php
plugins/SpecialUserPrefs.php
--- a/includes/plugins.php	Sat Apr 04 22:24:49 2009 -0400
+++ b/includes/plugins.php	Sat Apr 04 22:34:12 2009 -0400
@@ -54,7 +54,7 @@
    * @var array
    */
   
-  var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialRecentChanges.php', 'DemoMode.php');
+  var $system_plugins = Array('SpecialUserFuncs.php','SpecialUserPrefs.php','SpecialPageFuncs.php','SpecialAdmin.php','SpecialCSS.php','SpecialUpdownload.php','SpecialSearch.php','PrivateMessages.php','SpecialGroups.php', 'SpecialLog.php', 'DemoMode.php');
   
   /**
    * Name kept for compatibility. Effectively a constructor. Calculates the list of plugins that should be loaded
@@ -122,10 +122,13 @@
    * @param array Deprecated.
    */
   
-  function setHook($name, $opts = Array())
+  function setHook($name, $dont_split = false)
   {
     if ( !empty($this->hook_list[$name]) && is_array($this->hook_list[$name]) )
     {
+      if ( $dont_split )
+        return $this->hook_list[$name];
+      
       return array(implode("\n", $this->hook_list[$name]));
     }
     else
--- a/plugins/SpecialUserPrefs.php	Sat Apr 04 22:24:49 2009 -0400
+++ b/plugins/SpecialUserPrefs.php	Sat Apr 04 22:34:12 2009 -0400
@@ -1040,7 +1040,7 @@
       break;
     default:
       $good = false;
-      $code = $plugins->setHook('userprefs_body');
+      $code = $plugins->setHook('userprefs_body', true);
       foreach ( $code as $cmd )
       {
         if ( eval($cmd) )