Fix saving multienum prefs that have their enums provided by prefsInit().
authorJan Schneider <jan@horde.org>
Tue, 6 Apr 2010 14:41:13 +0000 (16:41 +0200)
committerJan Schneider <jan@horde.org>
Tue, 6 Apr 2010 21:02:08 +0000 (23:02 +0200)
framework/Prefs/lib/Horde/Prefs/Ui.php

index 2531da0..f29b27c 100644 (file)
@@ -114,6 +114,15 @@ class Horde_Prefs_Ui
                     case 'multienum':
                         $vals = Horde_Util::getPost($pref);
                         $set = array();
+                        if (empty($_prefs[$pref]['enum'])) {
+                            if ($registry->hasAppMethod($app, 'prefsInit')) {
+                                $result = $registry->callAppMethod($app, 'prefsInit', array('args' => array($group)));
+                                if (!empty($result)) {
+                                    extract($result);
+                                }
+                            }
+                            $_prefs[$pref]['enum'] = Horde_Util::nonInputVar($pref . '_options');
+                        }
                         if (is_array($vals)) {
                             foreach ($vals as $val) {
                                 if (isset($_prefs[$pref]['enum'][$val])) {