~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to web/wiki/inc/form.php

  • Committer: Chad Heuschober
  • Date: 2011-06-06 13:37:45 UTC
  • mfrom: (1.1.1244 trunk)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: chad.heuschober@mail.cuny.edu-20110606133745-850mdvnjtv392zta
Pulled in most recent batch of changes from the cuny sps trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
        global $lang;
253
253
        $form = '';
254
254
        $this->params['accept-charset'] = $lang['encoding'];
255
 
        $form .= '<form ' . html_attbuild($this->params) . '><div class="no">' . DOKU_LF;
 
255
        $form .= '<form ' . buildAttributes($this->params,false) . '><div class="no">' . DOKU_LF;
256
256
        if (!empty($this->_hidden)) {
257
257
            foreach ($this->_hidden as $name=>$value)
258
258
                $form .= form_hidden(array('name'=>$name, 'value'=>$value));
597
597
 * @author  Tom N Harris <tnharris@whoopdedo.org>
598
598
 */
599
599
function form_tag($attrs) {
600
 
    return '<'.$attrs['_tag'].' '.buildAttributes($attrs).'/>';
 
600
    return '<'.$attrs['_tag'].' '.buildAttributes($attrs,true).'/>';
601
601
}
602
602
 
603
603
/**
696
696
 */
697
697
function form_button($attrs) {
698
698
    $p = (!empty($attrs['_action'])) ? 'name="do['.$attrs['_action'].']" ' : '';
699
 
    return '<input '.$p.buildAttributes($attrs,true).'/>';
 
699
    return '<input '.$p.buildAttributes($attrs,true).' />';
700
700
}
701
701
 
702
702
/**
714
714
    if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
715
715
    if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
716
716
    $s .= '><span>'.$attrs['_text'].'</span>';
717
 
    $s .= ' <input '.buildAttributes($attrs,true).'/></label>';
 
717
    $s .= ' <input '.buildAttributes($attrs,true).' /></label>';
718
718
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
719
719
        $s .= '<br />';
720
720
    return $s;
734
734
    $s = '<label';
735
735
    if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
736
736
    if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
737
 
    $s .= '><input '.buildAttributes($attrs,true).'/>';
 
737
    $s .= '><input '.buildAttributes($attrs,true).' />';
738
738
    $s .= ' <span>'.$attrs['_text'].'</span></label>';
739
739
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
740
740
        $s .= '<br />';
758
758
    if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
759
759
    if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
760
760
    $s .= '><span>'.$attrs['_text'].'</span> ';
761
 
    $s .= '<input type="text" '.buildAttributes($attrs,true).'/></label>';
 
761
    $s .= '<input type="text" '.buildAttributes($attrs,true).' /></label>';
762
762
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
763
763
        $s .= '<br />';
764
764
    return $s;
781
781
    if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
782
782
    if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
783
783
    $s .= '><span>'.$attrs['_text'].'</span> ';
784
 
    $s .= '<input type="password" '.buildAttributes($attrs,true).'/></label>';
 
784
    $s .= '<input type="password" '.buildAttributes($attrs,true).' /></label>';
785
785
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
786
786
        $s .= '<br />';
787
787
    return $s;
807
807
    $s .= '<input type="file" '.buildAttributes($attrs,true);
808
808
    if (!empty($attrs['_maxlength'])) $s .= ' maxlength="'.$attrs['_maxlength'].'"';
809
809
    if (!empty($attrs['_accept'])) $s .= ' accept="'.$attrs['_accept'].'"';
810
 
    $s .= '/></label>';
 
810
    $s .= ' /></label>';
811
811
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
812
812
        $s .= '<br />';
813
813
    return $s;
837
837
                 . ' value="' . hsc($attrs['value'][1]) . '" />';
838
838
        $attrs['value'] = $attrs['value'][0];
839
839
    }
840
 
    $s .= '<input type="checkbox" '.buildAttributes($attrs,true).'/>';
 
840
    $s .= '<input type="checkbox" '.buildAttributes($attrs,true).' />';
841
841
    $s .= ' <span>'.$attrs['_text'].'</span></label>';
842
842
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
843
843
        $s .= '<br />';
860
860
    $s = '<label';
861
861
    if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
862
862
    if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
863
 
    $s .= '><input type="radio" '.buildAttributes($attrs,true).'/>';
 
863
    $s .= '><input type="radio" '.buildAttributes($attrs,true).' />';
864
864
    $s .= ' <span>'.$attrs['_text'].'</span></label>';
865
865
    if (preg_match('/(^| )block($| )/', $attrs['_class']))
866
866
        $s .= '<br />';