X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=bdd5df1303642564a8f75d7909a9ddda7ce6eef0;hb=ba0d44609ab8bc4e5ec05d0846dfa055705ee039;hp=85598f107123c76774dbf2d57ec776bed42b529f;hpb=fced39943f8619e7f0c59df6039043c040fefd19;p=squirrelmail.git
diff --git a/functions/options.php b/functions/options.php
index 85598f10..bdd5df13 100644
--- a/functions/options.php
+++ b/functions/options.php
@@ -62,6 +62,7 @@ class SquirrelOption {
var $size;
var $comment;
var $script;
+ var $post_script;
/* The name of the Save Function for this option. */
var $save_function;
@@ -72,7 +73,7 @@ class SquirrelOption {
var $possible_values;
function SquirrelOption
- ($name, $caption, $type, $refresh_level, $possible_values = '') {
+ ($name, $caption, $type, $refresh_level, $initial_value = '', $possible_values = '') {
/* Set the basic stuff. */
$this->name = $name;
$this->caption = $caption;
@@ -82,9 +83,12 @@ class SquirrelOption {
$this->size = SMOPT_SIZE_MEDIUM;
$this->comment = '';
$this->script = '';
+ $this->post_script = '';
/* Check for a current value. */
- if (isset($GLOBALS[$name])) {
+ if (!empty($initial_value)) {
+ $this->value = $initial_value;
+ } else if (isset($GLOBALS[$name])) {
$this->value = $GLOBALS[$name];
} else {
$this->value = '';
@@ -128,6 +132,11 @@ class SquirrelOption {
$this->script = $script;
}
+ /* Set the "post script" for this option. */
+ function setPostScript($post_script) {
+ $this->post_script = $post_script;
+ }
+
/* Set the save function for this option. */
function setSaveFunction($save_function) {
$this->save_function = $save_function;
@@ -171,9 +180,9 @@ class SquirrelOption {
. '';
}
- /* Add the script for this option. */
- $result .= $this->script;
-
+ /* Add the "post script" for this option. */
+ $result .= $this->post_script;
+
/* Now, return the created widget. */
return ($result);
}
@@ -197,13 +206,13 @@ class SquirrelOption {
$width = 25;
}
- $result = "name\" value=\"$this->value\" size=\"$width\">";
+ $result = "name\" value=\"$this->value\" size=\"$width\" $this->script>";
return ($result);
}
function createWidget_StrList() {
/* Begin the select tag. */
- $result = "