No need to pass UI object to widget code
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 7 Apr 2010 14:19:29 +0000 (08:19 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 7 Apr 2010 14:19:29 +0000 (08:19 -0600)
framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php
gollem/lib/Application.php
imp/lib/Prefs/Ui.php
kronolith/lib/Application.php
turba/lib/Application.php
whups/lib/Application.php

index 6b1800b..7c8c487 100644 (file)
@@ -18,10 +18,8 @@ class Horde_Core_Prefs_Ui_Widgets
 
     /**
      * Code to run on init.
-     *
-     * @param Horde_Core_Prefs_Ui $ui  The UI object.
      */
-    static public function sourceInit($ui)
+    static public function sourceInit()
     {
         Horde::addScriptFile('sourceselect.js', 'horde');
     }
@@ -35,8 +33,7 @@ class Horde_Core_Prefs_Ui_Widgets
      * will contain a list of arrays; each subarray contains the source name
      * and the list of selected values (JSON encoded).
      *
-     * @param Horde_Core_Prefs_Ui $ui  The UI object.
-     * @param array $data              Data items:
+     * @param array $data  Data items:
      * <pre>
      * 'mainlabel' - (string) Main label.
      * 'selectlabel' - (array) Selected label.
@@ -49,7 +46,7 @@ class Horde_Core_Prefs_Ui_Widgets
      *
      * @return string  HTML UI code.
      */
-    static public function source($ui, $data = array())
+    static public function source($data)
     {
         $t = $GLOBALS['injector']->createInstance('Horde_Template');
 
@@ -110,12 +107,10 @@ class Horde_Core_Prefs_Ui_Widgets
 
     /**
      * Code to run on init for addressbook selection.
-     *
-     * @param Horde_Core_Prefs_Ui $ui  The UI object.
      */
-    static public function addressbooksInit($ui)
+    static public function addressbooksInit()
     {
-        self::sourceInit($ui);
+        self::sourceInit();
         Horde::addScriptFile('addressbooksprefs.js', 'horde');
     }
 
@@ -127,11 +122,9 @@ class Horde_Core_Prefs_Ui_Widgets
      * search_fields contains a hash containing sources as keys and an array
      * of search fields as the value.
      *
-     * @param Horde_Core_Prefs_Ui $ui  The UI object.
-     *
      * @return string  HTML UI code.
      */
-    static public function addressbooks($ui)
+    static public function addressbooks()
     {
         global $prefs, $registry;
 
@@ -176,7 +169,7 @@ class Horde_Core_Prefs_Ui_Widgets
         }
 
         if (!empty($selected) || !empty($unselected)) {
-            $out = Horde_Core_Prefs_Ui_Widgets::source($ui, array(
+            $out = Horde_Core_Prefs_Ui_Widgets::source(array(
                   'mainlabel' => _("Choose the order of address books to search when expanding addresses."),
                   'selectlabel' => _("Selected address books:"),
                   'sources' => array(array(
index e7e7c25..7a2d18a 100644 (file)
@@ -107,7 +107,7 @@ class Gollem_Application extends Horde_Registry_Application
         switch ($ui->group) {
         case 'display':
             if (!$prefs->isLocked('columns')) {
-                Horde_Core_Prefs_Ui_Widgets::sourceInit($ui);
+                Horde_Core_Prefs_Ui_Widgets::sourceInit();
             }
             break;
         }
@@ -147,7 +147,7 @@ class Gollem_Application extends Horde_Registry_Application
                 );
             }
 
-            return Horde_Core_Prefs_Ui_Widgets::source($ui, array(
+            return Horde_Core_Prefs_Ui_Widgets::source(array(
                 'mainlabel' => _("Choose which address books to display, and in what order:"),
                 'selectlabel' => _("These addressbooks will display in this order:"),
                 'sourcelabel' => _("Select a backend:"),
index ef67968..7c1e65d 100644 (file)
@@ -38,7 +38,7 @@ class IMP_Prefs_Ui
 
         case 'addressbooks':
             if (!$prefs->isLocked('sourceselect')) {
-                Horde_Core_Prefs_Ui_Widgets::addressbooksInit($ui);
+                Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
             }
 
             if (!$prefs->isLocked('add_source')) {
@@ -308,7 +308,7 @@ class IMP_Prefs_Ui
             return $this->_sound();
 
         case 'sourceselect':
-            return Horde_Core_Prefs_Ui_Widgets::addressbooks($ui);
+            return Horde_Core_Prefs_Ui_Widgets::addressbooks();
 
         case 'spamselect':
             return $this->_spam();
index f82f4ae..e30bcfa 100644 (file)
@@ -120,7 +120,7 @@ class Kronolith_Application extends Horde_Registry_Application
         switch ($ui->group) {
         case 'addressbooks':
             if (!$prefs->isLocked('sourceselect')) {
-                Horde_Core_Prefs_Ui_Widgets::addressbooksInit($ui);
+                Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
             }
             break;
 
@@ -202,7 +202,7 @@ class Kronolith_Application extends Horde_Registry_Application
             return $this->_defaultAlarmManagement($ui);
 
         case 'sourceselect':
-            return Horde_Core_Prefs_Ui_Widgets::addressbooks($ui);
+            return Horde_Core_Prefs_Ui_Widgets::addressbooks();
         }
 
         return '';
index 13960d2..c257353 100644 (file)
@@ -168,7 +168,7 @@ class Turba_Application extends Horde_Registry_Application
 
         switch ($ui->group) {
         case 'addressbooks':
-            Horde_Core_Prefs_Ui_Widgets::sourceInit($ui);
+            Horde_Core_Prefs_Ui_Widgets::sourceInit();
 
             if (!$prefs->isLocked('default_dir')) {
                 $out = array();
@@ -229,7 +229,7 @@ class Turba_Application extends Horde_Registry_Application
                 $selected[$val] = $GLOBALS['cfgSources'][$val]['title'];
             }
 
-            return Horde_Core_Prefs_Ui_Widgets::source($ui, array(
+            return Horde_Core_Prefs_Ui_Widgets::source(array(
                 'mainlabel' => _("Choose which address books to display, and in what order:"),
                 'selected' => $selected,
                 'selectlabel' => _("These addressbooks will display in this order:"),
index 6e79634..34cc3f1 100644 (file)
@@ -131,7 +131,7 @@ class Whups_Application extends Horde_Registry_Application
     {
         switch ($ui->group) {
         case 'addressbooks':
-            Horde_Core_Prefs_Ui_Widgets::addressbooksInit($ui);
+            Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
             break;
         }
 
@@ -152,7 +152,7 @@ class Whups_Application extends Horde_Registry_Application
     {
         switch ($item) {
         case 'sourceselect':
-            return Horde_Core_Prefs_Ui_Widgets::addressbooks($ui);
+            return Horde_Core_Prefs_Ui_Widgets::addressbooks();
         }
 
         return '';