Custom option page values now repopulate correctly when save action goes back to...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Jul 2004 12:36:36 +0000 (12:36 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Jul 2004 12:36:36 +0000 (12:36 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7780 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/options.php

index 7831dc2f4b2d28e729821195bfcc0359eb7b932d..5c4239c85ba830b2b56c89c177daecf8522aaef6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@ Version 1.5.1 -- CVS
   - Removed html_top and html_bottom hooks.  No longer used/needed.
   - Added "trailing text" for options built by SquirrelMail (text placed
     after text and select list inputs on options pages)
+  - Custom option page values now repopulate correctly
 
 Version 1.5.0
 --------------------
index 7fadcbc6165a23f05cbd16d95928765fa1820ed1..5ae717a04fa6f4bf2236436f860442296aeb53e7 100644 (file)
@@ -154,6 +154,12 @@ class SquirrelOption {
     function createHTMLWidget() {
         global $javascript_on;
 
+        // Use new value if available 
+        if (!empty($this->new_value)) {
+            $tempValue = $this->value;
+            $this->value = $this->new_value;
+        }
+
         /* Get the widget for this option type. */
         switch ($this->type) {
             case SMOPT_TYPE_STRING:
@@ -192,6 +198,11 @@ class SquirrelOption {
         /* Add the "post script" for this option. */
         $result .= $this->post_script;
         
+        // put correct value back if need be
+        if (!empty($this->new_value)) {
+            $this->value = $tempValue;
+        }
+
         /* Now, return the created widget. */
         return ($result);
     }