Added 'trailing text' for options that SM builds, which is placed after a text input...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 25 Jul 2004 13:40:52 +0000 (13:40 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 25 Jul 2004 13:40:52 +0000 (13:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7772 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
doc/plugin.txt
functions/options.php

index 27de142967070c9c7479ab7e7e2627c29aeae85a..7831dc2f4b2d28e729821195bfcc0359eb7b932d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,6 +70,8 @@ Version 1.5.1 -- CVS
   - Security: fix SQL injection vulnerability in addressbook
     (CVE ID: CAN-2004-0521).
   - 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)
 
 Version 1.5.0
 --------------------
index 404506a00496b48f9992a783d3f30e6a82fbaf10..938edb21295fadbdfa7d4e045377d3b139484a02 100644 (file)
@@ -598,6 +598,9 @@ for you.  This is the preferred method of building options lists going forward.
                         setting in the user's preferences
          caption        The text that prefaces this setting on the preferences
                         page
+         trailing_text  Text that follows a text input or select list input on
+                        the preferences page (useful for indicating units,
+                        meanings of special values, etc.)
          type           The type of INPUT element, which should be one of:
                            SMOPT_TYPE_STRING     String/text input
                            SMOPT_TYPE_STRLIST    Select list input
index 3a3ed2ee247ea300606aa1ef97f9de6bb6ef9819..7fadcbc6165a23f05cbd16d95928765fa1820ed1 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']);