Include original configuration array in Option object; allows custom save handlers...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 2 May 2008 21:28:59 +0000 (21:28 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 2 May 2008 21:28:59 +0000 (21:28 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13080 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php

index 8311d6898c8dcd60bf3bbd5526b01e5ad52c1e38..1814e30364fffd43e90bf27d4e36134e67dcccc7 100644 (file)
@@ -60,6 +60,11 @@ define('SMOPT_SAVE_NOOP', 'save_option_noop');
  * @subpackage prefs
  */
 class SquirrelOption {
+    /**
+     * The original option configuration array
+     * @var array
+     */
+    var $raw_option_array;
     /**
      * The name of this setting
      * @var string
@@ -184,6 +189,7 @@ class SquirrelOption {
 
     /**
      * Constructor function
+     * @param array $raw_option_array
      * @param string $name
      * @param string $caption
      * @param integer $type
@@ -193,8 +199,9 @@ class SquirrelOption {
      * @param bool $htmlencoded
      */
     function SquirrelOption
-    ($name, $caption, $type, $refresh_level, $initial_value = '', $possible_values = '', $htmlencoded = false) {
+    ($raw_option_array, $name, $caption, $type, $refresh_level, $initial_value = '', $possible_values = '', $htmlencoded = false) {
         /* Set the basic stuff. */
+        $this->raw_option_array = $raw_option_array;
         $this->name = $name;
         $this->caption = $caption;
         $this->type = $type;
@@ -886,6 +893,7 @@ function create_option_groups($optgrps, $optvals) {
         foreach ($grpopts as $optset) {
             /* Create a new option with all values given. */
             $next_option = new SquirrelOption(
+                    $optset,
                     $optset['name'],
                     $optset['caption'],
                     $optset['type'],