Allow control over white space wrapping of auto-generated SquirrelMail option widgets
[squirrelmail.git] / functions / options.php
index 84b8b9a..022cc22 100644 (file)
@@ -35,6 +35,11 @@ class SquirrelOption {
      */
     var $caption;
     /**
      */
     var $caption;
     /**
+     * Whether or not the caption text is allowed to wrap
+     * @var boolean
+     */
+    var $caption_wrap;
+    /**
      * The type of INPUT element
      *
      * See SMOPT_TYPE_* defines
      * The type of INPUT element
      *
      * See SMOPT_TYPE_* defines
@@ -177,6 +182,7 @@ class SquirrelOption {
         $this->raw_option_array = $raw_option_array;
         $this->name = $name;
         $this->caption = $caption;
         $this->raw_option_array = $raw_option_array;
         $this->name = $name;
         $this->caption = $caption;
+        $this->caption_wrap = TRUE;
         $this->type = $type;
         $this->refresh_level = $refresh_level;
         $this->possible_values = $possible_values;
         $this->type = $type;
         $this->refresh_level = $refresh_level;
         $this->possible_values = $possible_values;
@@ -239,6 +245,14 @@ class SquirrelOption {
     }
 
     /**
     }
 
     /**
+     * Set whether the caption is allowed to wrap for this option.
+     * @param boolean $caption_wrap
+     */
+    function setCaptionWrap($caption_wrap) {
+        $this->caption_wrap = $caption_wrap;
+    }
+
+    /**
      * Set the size for this option.
      * @param integer $size
      */
      * Set the size for this option.
      * @param integer $size
      */
@@ -910,6 +924,11 @@ function create_option_groups($optgrps, $optvals) {
                     (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false)
                     );
 
                     (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false)
                     );
 
+            /* If provided, set if the caption is allowed to wrap for this option. */
+            if (isset($optset['caption_wrap'])) {
+                $next_option->setCaptionWrap($optset['caption_wrap']);
+            }
+
             /* If provided, set the size for this option. */
             if (isset($optset['size'])) {
                 $next_option->setSize($optset['size']);
             /* If provided, set the size for this option. */
             if (isset($optset['size'])) {
                 $next_option->setSize($optset['size']);