developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1002: 1002-jForms-htmlbuilders-cssclass-for-controls.diff

File 1002-jForms-htmlbuilders-cssclass-for-controls.diff, 2.6 KB (added by Julien, 11 years ago)
  • lib/jelix/plugins/jforms/html/html.jformsbuilder.php

    diff -r 9d30dc4ae7c6 lib/jelix/plugins/jforms/html/html.jformsbuilder.php
    a b  
    204204        if($ctrl->type == 'hidden') return;
    205205        $ro = $ctrl->isReadOnly();
    206206        $id = ' name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'"';
    207         $class = ($ctrl->required == false || $ro?'':' jforms-required');
    208         $class.= (isset($this->_form->getContainer()->errors[$ctrl->ref]) ?' jforms-error':'');
    209         $class.= ($ro && $ctrl->type != 'captcha'?' jforms-readonly':'');
     207        $class = 'jforms-ctrl-'.$ctrl->type;
     208        $class .= ($ctrl->required == false || $ro?'':' jforms-required');
     209        $class .= (isset($this->_form->getContainer()->errors[$ctrl->ref]) ?' jforms-error':'');
     210        $class .= ($ro && $ctrl->type != 'captcha'?' jforms-readonly':'');
    210211        $readonly = ($ro?' readonly="readonly"':'');
    211         if($class !='') $class = ' class="'.$class.'"';
     212        $class = ' class="'.$class.'"';
    212213        $hint = ($ctrl->hint == ''?'':' title="'.htmlspecialchars($ctrl->hint).'"');
    213214        $this->{'output'.$ctrl->type}($ctrl, $id, $class, $readonly, $hint);
    214215        $this->{'js'.$ctrl->type}($ctrl);
  • lib/jelix/plugins/jforms/htmllight/htmllight.jformsbuilder.php

    diff -r 9d30dc4ae7c6 lib/jelix/plugins/jforms/htmllight/htmllight.jformsbuilder.php
    a b  
    195195        if($ctrl->type == 'hidden') return;
    196196        $ro = $ctrl->isReadOnly();
    197197        $id = ' name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'"';
    198         $class = ($ctrl->required == false || $ro?'':' jforms-required');
    199         $class.= (isset($this->_form->getContainer()->errors[$ctrl->ref]) ?' jforms-error':'');
    200         $class.= ($ro && $ctrl->type != 'captcha'?' jforms-readonly':'');
     198        $class = 'jforms-ctrl-'.$ctrl->type;
     199        $class .= ($ctrl->required == false || $ro?'':' jforms-required');
     200        $class .= (isset($this->_form->getContainer()->errors[$ctrl->ref]) ?' jforms-error':'');
     201        $class .= ($ro && $ctrl->type != 'captcha'?' jforms-readonly':'');
    201202        $readonly = ($ro?' readonly="readonly"':'');
    202         if($class !='') $class = ' class="'.$class.'"';
     203        $class = ' class="'.$class.'"';
    203204        $hint = ($ctrl->hint == ''?'':' title="'.htmlspecialchars($ctrl->hint).'"');
    204205        $this->{'output'.$ctrl->type}($ctrl, $id, $class, $readonly, $hint);
    205206        $this->{'js'.$ctrl->type}($ctrl);