Changeset 1883

Show
Ignore:
Timestamp:
01/31/2008 08:59:21 AM (11 months ago)
Author:
Shadowhand
Message:

Fixing #357, thanks SuicidalWeasel?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/form.php

    r1809 r1883  
    6868 
    6969        /** 
     70         * Generates a fieldset opening tag. 
     71         * 
     72         * @param   array   html attributes 
     73         * @param   string  a string to be attached to the end of the attributes 
     74         * @return  string 
     75         */ 
     76        public static function open_fieldset($data, $extra = '') 
     77        { 
     78                if ( ! empty($extra)) 
     79                { 
     80                        // Make sure there is 1 space before extra 
     81                        $extra = ' '.ltrim($extra); 
     82                } 
     83 
     84                return '<fieldset'.html::attributes((array) $data).$extra.'>'."\n"; 
     85        } 
     86 
     87        /** 
     88         * Generates a fieldset closing tag. 
     89         * 
     90         * @return  string 
     91         */ 
     92        public static function close_fieldset() 
     93        { 
     94                return '</fieldset>'."\n"; 
     95        } 
     96 
     97        /** 
     98         * Generates a legend tag for use with a fieldset. 
     99         * 
     100         * @param   string  legend text 
     101         * @param   array   HTML attributes 
     102         * @param   string  a string to be attached to the end of the attributes 
     103         * @return  string 
     104         */ 
     105        public static function legend($text = '', $data = array(), $extra = '') 
     106        { 
     107                if ( ! empty($extra)) 
     108                { 
     109                        // Make sure there is 1 space before extra 
     110                        $extra = ' '.ltrim($extra); 
     111                } 
     112 
     113                return '<legend'.self::attributes((array) $data).$extra.'>'.$text.'</legend>'."\n"; 
     114        } 
     115 
     116        /** 
    70117         * Generates hidden form fields. 
    71118         * You can pass a simple key/value string or an associative array with multiple values. 
     
    123170                ); 
    124171 
    125                 // Form elements should have the same id as name 
    126172                if ( ! empty($extra)) 
    127173                {