diff --git a/html/themes/breezy/form.css b/html/themes/breezy/form.css index 8c9c143da268f2d6f88fd41513f173da468eb70b..b5971827135e77f570154e8737b2928fe370cfa8 100644 --- a/html/themes/breezy/form.css +++ b/html/themes/breezy/form.css @@ -5,8 +5,17 @@ textarea, textarea:focus { font-size: 12px; } -input[type=text], +input[type=color], +input[type=date], +input[type=datetime-local], +input[type=email], +input[type=number], input[type=password], +input[type=search], +input[type=tel], +input[type=text], +input[type=time], +input[type=url], select { padding: 2px; } @@ -15,8 +24,17 @@ input[type=number] { } /* On small screens */ @media (max-width: 640px) { - input[type=text], + input[type=color], + input[type=date], + input[type=datetime-local], + input[type=email], + input[type=number], input[type=password], + input[type=search], + input[type=tel], + input[type=text], + input[type=time], + input[type=url], input[type=file], textarea, select { diff --git a/html/themes/breezy/less/form.less b/html/themes/breezy/less/form.less index a9b0043221ba0cb97159f338143ae4df08e23389..912f98f41415aacb80a9352be7bfd62db6ea0f38 100644 --- a/html/themes/breezy/less/form.less +++ b/html/themes/breezy/less/form.less @@ -4,7 +4,8 @@ input, input:focus, select, textarea, textarea:focus { font-size: @text-font-size; } -input[type=text], input[type=password], select { + +input[type=color], input[type=date], input[type=datetime-local], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], select { padding: 2px; } @@ -14,7 +15,8 @@ input[type=number] { /* On small screens */ @media (max-width: 640px) { - input[type=text], input[type=password], input[type=file], textarea, select { + input[type=color], input[type=date], input[type=datetime-local], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], + input[type=file], textarea, select { max-width: 100%; } input.base-selector { diff --git a/include/simpleplugin/attributes/class_IntAttribute.inc b/include/simpleplugin/attributes/class_IntAttribute.inc index d54cab6bb72cd5a960e8124596a1bcd75e294ad2..4ee6404f2bbe1ac649663f86b27e12e8cd34e0ba 100644 --- a/include/simpleplugin/attributes/class_IntAttribute.inc +++ b/include/simpleplugin/attributes/class_IntAttribute.inc @@ -120,12 +120,13 @@ class IntAttribute extends Attribute function renderTemplateInput () { $id = $this->getHtmlId(); - $display = $this->renderInputField( - 'text', $id, - array( - 'value' => '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}' - ) + $attributes = array( + 'value' => '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}' ); + if ($this->isSubAttribute) { + $attributes['class'] = 'subattribute'; + } + $display = $this->renderInputField('text', $id, $attributes); return $this->renderAcl($display); } } diff --git a/include/simpleplugin/attributes/class_StringAttribute.inc b/include/simpleplugin/attributes/class_StringAttribute.inc index a51f6406861a4aebb982aaa4e36b8d8f403b0089..9ea60c5cb0a104fc571d0d00992a4b5186346f0f 100644 --- a/include/simpleplugin/attributes/class_StringAttribute.inc +++ b/include/simpleplugin/attributes/class_StringAttribute.inc @@ -91,6 +91,22 @@ class StringAttribute extends Attribute return $this->renderAcl($display); } + function renderTemplateInput () + { + $id = $this->getHtmlId(); + $attributes = array( + 'value' => '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}' + ); + if ($this->autocomplete !== NULL) { + $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' ); + } + if ($this->isSubAttribute) { + $attributes['class'] = 'subattribute'; + } + $display = $this->renderInputField('text', $id, $attributes); + return $this->renderAcl($display); + } + function fixPostValue ($value) { /* Replace CRLF by LF, to avoid non-ASCII chars in multiline values (mainly useful for textarea) */ @@ -166,6 +182,17 @@ class TextAreaAttribute extends StringAttribute '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}</textarea>'; return $this->renderAcl($display); } + + function renderTemplateInput () + { + $id = $this->getHtmlId(); + $display = '<textarea name="'.$id.'" id="'.$id.'"'. + ($this->disabled ? ' disabled="disabled"' : ''). + ($this->isSubAttribute ? ' class="subattribute"' : ''). + '>'. + '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}</textarea>'; + return $this->renderAcl($display); + } } /*! \brief This class allow to handle easily a String LDAP attribute that contains a password @@ -174,25 +201,14 @@ class TextAreaAttribute extends StringAttribute class PasswordAttribute extends StringAttribute { protected $autocomplete = FALSE; + protected $inputType = 'password'; function renderFormInput () { - $id = $this->getHtmlId(); - $display = $this->renderInputField( - 'password', $id, - array( - 'value' => '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}', - 'autocomplete' => ($this->autocomplete ? 'on' : 'off'), - ) - ); + $display = parent::renderFormInput(); if ($this->autocomplete === FALSE) { $display = '{literal}<input autocomplete="off" value="foolautocompleteworkaround" type="text" style="display:none;"/>{/literal}'.$display; } - return $this->renderAcl($display); - } - - function renderTemplateInput () - { - return parent::renderFormInput(); + return $display; } }