| @@ 52-75 (lines=24) @@ | ||
| 49 | ||
| 50 | // ------------------------------------------------------------------------ |
|
| 51 | ||
| 52 | if ( ! function_exists('lang')) |
|
| 53 | { |
|
| 54 | /** |
|
| 55 | * Lang |
|
| 56 | * |
|
| 57 | * Fetches a language variable and optionally outputs a form label |
|
| 58 | * |
|
| 59 | * @param string $line The language line |
|
| 60 | * @param string $for The "for" value (id of the form element) |
|
| 61 | * @param array $attributes Any additional HTML attributes |
|
| 62 | * @return string |
|
| 63 | */ |
|
| 64 | function lang($line, $for = '', $attributes = array()) |
|
| 65 | { |
|
| 66 | $line = get_instance()->lang->line($line); |
|
| 67 | ||
| 68 | if ($for !== '') |
|
| 69 | { |
|
| 70 | $line = '<label for="'.$for.'"'._stringify_attributes($attributes).'>'.$line.'</label>'; |
|
| 71 | } |
|
| 72 | ||
| 73 | return $line; |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| @@ 243-264 (lines=22) @@ | ||
| 240 | ||
| 241 | // ------------------------------------------------------------------------ |
|
| 242 | ||
| 243 | if ( ! function_exists('mailto')) |
|
| 244 | { |
|
| 245 | /** |
|
| 246 | * Mailto Link |
|
| 247 | * |
|
| 248 | * @param string the email address |
|
| 249 | * @param string the link title |
|
| 250 | * @param mixed any attributes |
|
| 251 | * @return string |
|
| 252 | */ |
|
| 253 | function mailto($email, $title = '', $attributes = '') |
|
| 254 | { |
|
| 255 | $title = (string) $title; |
|
| 256 | ||
| 257 | if ($title === '') |
|
| 258 | { |
|
| 259 | $title = $email; |
|
| 260 | } |
|
| 261 | ||
| 262 | return '<a href="mailto:'.$email.'"'._stringify_attributes($attributes).'>'.$title.'</a>'; |
|
| 263 | } |
|
| 264 | } |
|
| 265 | ||
| 266 | // ------------------------------------------------------------------------ |
|
| 267 | ||