Added 'trailing text' for options that SM builds, which is placed after a text input...
[squirrelmail.git] / functions / options.php
index 3a3ed2e..7fadcbc 100644 (file)
@@ -62,6 +62,7 @@ class SquirrelOption {
     var $type;
     var $refresh_level;
     var $size;
+    var $trailing_text;
     var $comment;
     var $script;
     var $post_script;
@@ -83,6 +84,7 @@ class SquirrelOption {
         $this->refresh_level = $refresh_level;
         $this->possible_values = $possible_values;
         $this->size = SMOPT_SIZE_MEDIUM;
+        $this->trailing_text = '';
         $this->comment = '';
         $this->script = '';
         $this->post_script = '';
@@ -124,6 +126,11 @@ class SquirrelOption {
         $this->size = $size;
     }
 
+    /* Set the trailing_text for this option. */
+    function setTrailingText($trailing_text) {
+        $this->trailing_text = $trailing_text;
+    }
+
     /* Set the comment for this option. */
     function setComment($comment) {
         $this->comment = $comment;
@@ -210,7 +217,7 @@ class SquirrelOption {
 
         $result = "<input type=\"text\" name=\"new_$this->name\" value=\"" .
             htmlspecialchars($this->value) . 
-            "\" size=\"$width\" $this->script />\n";
+            "\" size=\"$width\" $this->script />$this->trailing_text\n";
         return ($result);
     }
 
@@ -237,7 +244,7 @@ class SquirrelOption {
         }
 
         /* Close the select tag and return our happy result. */
-        $result .= "</select>\n";
+        $result .= "</select>$this->trailing_text\n";
         return ($result);
     }
 
@@ -436,6 +443,11 @@ function create_option_groups($optgrps, $optvals) {
                 $next_option->setSize($optset['size']);
             }
 
+            /* If provided, set the trailing_text for this option. */
+            if (isset($optset['trailing_text'])) {
+                $next_option->setTrailingText($optset['trailing_text']);
+            }
+
             /* If provided, set the comment for this option. */
             if (isset($optset['comment'])) {
                 $next_option->setComment($optset['comment']);