[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14554] branches/SM-1_4-STABLE/squirrelmail/ functions/options.php
From:       pdontthink () users ! sourceforge ! net
Date:       2016-05-07 3:21:38
Message-ID: E1aysoH-0008Tt-KY () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14554
          http://sourceforge.net/p/squirrelmail/code/14554
Author:   pdontthink
Date:     2016-05-07 03:21:38 +0000 (Sat, 07 May 2016)
Log Message:
-----------
Allow option widget trailing text to be rendered smaller

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/functions/options.php

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/options.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/options.php	2016-05-06 20:12:50 UTC \
                (rev 14553)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/options.php	2016-05-07 03:21:38 UTC \
(rev 14554) @@ -83,6 +83,7 @@
     var $script;
     var $post_script;
     var $trailing_text;
+    var $trailing_text_small;
     var $yes_text;
     var $no_text;
     var $use_add_widget;
@@ -116,6 +117,7 @@
         $this->script = '';
         $this->post_script = '';
         $this->trailing_text = '';
+        $this->trailing_text_small = FALSE;
         $this->yes_text = '';
         $this->no_text = '';
         $this->use_add_widget = TRUE;
@@ -180,6 +182,11 @@
         $this->trailing_text = $trailing_text;
     }
 
+    /* Set the trailing text for this option. */
+    function setTrailingTextSmall($trailing_text_small) {
+        $this->trailing_text_small = $trailing_text_small;
+    }
+
     /* Set the yes text for this option. */
     function setYesText($yes_text) {
         $this->yes_text = $yes_text;
@@ -357,7 +364,10 @@
                 . "\" name=\"new_$this->name\" value=\""
                 . sm_encode_html_special_chars($this->value)
                 . "\" size=\"$width\" $this->script /> " 
-                . sm_encode_html_special_chars($this->trailing_text) . "\n";
+                . ($this->trailing_text_small ? '<small>' : '')
+                . sm_encode_html_special_chars($this->trailing_text)
+                . ($this->trailing_text_small ? '</small>' : '')
+                . "\n";
         return $result;
     }
 
@@ -475,7 +485,11 @@
         }
 
         /* Close the select tag and return our happy result. */
-        $result .= '</select> ' . sm_encode_html_special_chars($this->trailing_text) \
. "\n"; +        $result .= '</select> '
+                . ($this->trailing_text_small ? '<small>' : '')
+                . sm_encode_html_special_chars($this->trailing_text)
+                . ($this->trailing_text_small ? '</small>' : '')
+                . "\n";
         return $result;
     }
 
@@ -558,7 +572,11 @@
             $result .= $new_option;
         }
         /* Close the select tag and return our happy result. */
-        $result .= '</select> ' . sm_encode_html_special_chars($this->trailing_text) \
. "\n"; +        $result .= '</select> '
+                . ($this->trailing_text_small ? '<small>' : '')
+                . sm_encode_html_special_chars($this->trailing_text)
+                . ($this->trailing_text_small ? '</small>' : '')
+                . "\n";
         return $result;
     }
 
@@ -642,7 +660,10 @@
                     . '" id="new_' . $this->name . '" value="' . SMPREF_YES
                     . "\" $yes_chk " . $this->script . ' />&nbsp;'
                     . '<label for="new_' . $this->name . '">' 
-                    . sm_encode_html_special_chars($this->trailing_text) . \
'</label>'; +                    . ($this->trailing_text_small ? '<small>' : '')
+                    . sm_encode_html_special_chars($this->trailing_text)
+                    . ($this->trailing_text_small ? '</small>' : '')
+                    . '</label>';
         }
 
         // radio buttons...
@@ -1126,7 +1147,10 @@
         $result = "<input type=\"submit\" name=\"$this->name\" value=\""
                 . sm_encode_html_special_chars($this->comment)
                 . "\" $this->script /> "
-                . sm_encode_html_special_chars($this->trailing_text) . "\n";
+                . ($this->trailing_text_small ? '<small>' : '')
+                . sm_encode_html_special_chars($this->trailing_text)
+                . ($this->trailing_text_small ? '</small>' : '')
+                . "\n";
 
         return $result;
 
@@ -1348,6 +1372,11 @@
                 $next_option->setTrailingText($optset['trailing_text']);
             }
 
+            /* If provided, set whether the trailing_text should be rendered small \
for this option. */ +            if (isset($optset['trailing_text_small'])) {
+                $next_option->setTrailingTextSmall($optset['trailing_text_small']);
+            }
+
             /* If provided, set the yes_text for this option. */
             if (isset($optset['yes_text'])) {
                 $next_option->setYesText($optset['yes_text']);
@@ -1436,6 +1465,7 @@
                 // text area trailing text just goes under the caption
                 //
                 if ($option->type == SMOPT_TYPE_TEXTAREA && \
!empty($option->trailing_text)) +//TODO: I guess we should change this to obey \
                trailing_text_small, but that would break existing plugins
                     $option->caption .= '<br /><small>' . $option->trailing_text . \
'</small>';  
                 global $color;

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic