Happy New Year
[squirrelmail.git] / templates / default / form.tpl
CommitLineData
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 *
f197ec88 24 * @copyright 1999-2016 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//
34extract($t);
35
36
37if (!isset($aAttribs['id']) && !empty($name))
38 $aAttribs['id'] = $name;
39
40
41echo '<form';
42if (!empty($action)) echo ' action="' . $action . '"';
43if (!empty($name)) echo ' name="' . $name . '"';
44if (!empty($method)) echo ' method="' . $method . '"';
45if (!empty($charset)) echo ' accept-charset="' . $charset . '"';
46if (!empty($enctype)) echo ' enctype="' . $enctype . '"';
47foreach ($aAttribs as $key => $value) {
48 echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
49}
50echo ">\n";
51
52