Branch 'kolab-webadmin-3.1' - lib/kolab_html.php

Aleksander Machniak machniak at kolabsys.com
Thu Nov 7 12:44:08 CET 2013


 lib/kolab_html.php |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

New commits:
commit c74fa4d2b0b106b007b31e8a3d5e052f9b8fad64
Author: Aleksander Machniak <alec at alec.pl>
Date:   Thu Nov 7 12:41:01 2013 +0100

    Finally fix readonly quota input (Bug #2414)

diff --git a/lib/kolab_html.php b/lib/kolab_html.php
index 8567bb0..1107d4b 100644
--- a/lib/kolab_html.php
+++ b/lib/kolab_html.php
@@ -173,10 +173,21 @@ class kolab_html
             }
         }
 
+        if (empty($attribs['size'])) {
+            $attribs['size'] = 10;
+        }
+
+        // show no select dropdown box if value is readonly
+        if (!empty($attribs['readonly'])) {
+            if ($unit) {
+                $attribs['value'] .= ' ' . strtoupper($unit);
+            }
+
+            return self::input($attribs);
+        }
+
         $select = array(
             'name'     => $attribs['name'] . '-unit',
-            'readonly' => !empty($attribs['readonly']),
-            'disabled' => !empty($attribs['readonly']),
             'options'  => array(),
         );
 
@@ -190,10 +201,6 @@ class kolab_html
 
         $attribs['data-type'] = 'quota';
 
-        if (empty($attribs['size'])) {
-            $attribs['size'] = 10;
-        }
-
         return self::input($attribs) . self::select($select);
     }
 




More information about the commits mailing list