b3c07fdc |
1 | <?php |
2 | |
3 | /** |
4 | * form.tpl |
5 | * |
6 | * Template for constructing an opening form tag. |
7 | * |
8 | * The following variables are available in this template: |
9 | * + $name - The name of the form (the caller should ideally |
10 | * use id (in $aAttribs) instead) (optional; may not be provided) |
11 | * + $method - The HTTP method used to submit data (usually "get" or "post") |
12 | * + $action - The form action URI |
13 | * + $enctype - The content type that is used to submit data (this |
14 | * is optional and might be empty, in which case you |
15 | * should just let HTML default to "application/x-www-form-urlencoded" |
16 | * + $charset - The charset that is used for submitted data (optional; may |
17 | * not be provided) |
18 | * + $aAttribs - Any extra attributes: an associative array, where |
19 | * keys are attribute names, and values (which are |
20 | * optional and might be null) should be placed |
21 | * in double quotes as attribute values (optional; |
22 | * may not be provided) |
23 | * |
33aab559 |
24 | * @copyright 1999-2024 The SquirrelMail Project Team |
b3c07fdc |
25 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
26 | * @version $Id$ |
27 | * @package squirrelmail |
28 | * @subpackage templates |
29 | */ |
30 | |
31 | |
32 | // retrieve the template vars |
33 | // |
34 | extract($t); |
35 | |
36 | |
37 | if (!isset($aAttribs['id']) && !empty($name)) |
38 | $aAttribs['id'] = $name; |
39 | |
40 | |
41 | echo '<form'; |
42 | if (!empty($action)) echo ' action="' . $action . '"'; |
43 | if (!empty($name)) echo ' name="' . $name . '"'; |
44 | if (!empty($method)) echo ' method="' . $method . '"'; |
45 | if (!empty($charset)) echo ' accept-charset="' . $charset . '"'; |
46 | if (!empty($enctype)) echo ' enctype="' . $enctype . '"'; |
47 | foreach ($aAttribs as $key => $value) { |
48 | echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"'); |
49 | } |
50 | echo ">\n"; |
51 | |
52 | |