b3c07fdc |
1 | <?php |
2 | |
3 | /** |
4 | * textarea.tpl |
5 | * |
6 | * Template for constructing a textarea input tag. |
7 | * |
8 | * The following variables are available in this template: |
9 | * + $name - The name of the select input |
10 | * + $text - The initial value inside the textarea |
11 | * + $cols - The width of the textarea in characters |
12 | * + $rows - The height of the textarea in rows |
13 | * + $aAttribs - Any extra attributes: an associative array, where |
14 | * keys are attribute names, and values (which are |
15 | * optional and might be null) should be placed |
16 | * in double quotes as attribute values (optional; |
17 | * may not be present) |
18 | * |
19 | * @copyright © 1999-2006 The SquirrelMail Project Team |
20 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
21 | * @version $Id$ |
22 | * @package squirrelmail |
23 | * @subpackage templates |
24 | */ |
25 | |
26 | |
27 | // retrieve the template vars |
28 | // |
29 | extract($t); |
30 | |
31 | |
32 | if (isset($aAttribs['id'])) { |
33 | $label_open = '<label for="' . $aAttribs['id'] . '">'; |
34 | $label_close = '</label>'; |
35 | } else { |
36 | $label_open = ''; |
37 | $label_close = ''; |
38 | } |
39 | |
40 | |
41 | echo '<textarea name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '"'; |
42 | foreach ($aAttribs as $key => $value) { |
43 | echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"'); |
44 | } |
45 | echo '>' . $label_open . $text . $label_close . "</textarea>\n"; |
46 | |
47 | |