[TASK] Add CSS Class to special input types in FORM
authorIngo Pfennigstorf <i.pfennigstorf@gmail.com>
Fri, 14 Oct 2011 11:34:02 +0000 (13:34 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Tue, 29 Nov 2011 12:18:47 +0000 (13:18 +0100)
All input elements are wrapped by a list element that only has one
css class containing the element id of the field. To avoid unneccesary
barriers to ie. hide inputs field of the type "hidden" an extra class
is added to the list element to determine the field type of the
wrapped element, ie. hidden, text, ... .

Change-Id: Ia14641d488f10e2a60f9ba0fafdc10f31d0eeb1d
Resolves: #30851
Releases: 4.6
Reviewed-on: http://review.typo3.org/5745
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/form/Classes/View/Form/Element/Abstract.php

index 6ae3ea3..4efc6d0 100644 (file)
@@ -385,14 +385,17 @@ abstract class tx_form_View_Form_Element_Abstract {
 
        /**
         * Return the id for the element wraps,
-        * like <li id="csc-form-"> ... </li>
+        * like <li class="csc-form-2 tx_form-hidden"> ... </li>
         *
         * @return string
         */
        public function getElementWrapId() {
                $elementId = (integer) $this->model->getElementId();
+               $fieldType = $this->model->getAttributes();
                $wrapId = 'csc-form-' . $elementId;
-
+               if (gettype($fieldType['type']) === 'object') {
+                       $wrapId .= ' tx_form-' . htmlspecialchars($fieldType['type']->getValue());
+               }
                return $wrapId;
        }