| | 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 | /** |