--- /dev/null
+<?php
+
+/**
+ * form.tpl
+ *
+ * Template for constructing an opening form tag.
+ *
+ * The following variables are available in this template:
+ * + $name - The name of the form (the caller should ideally
+ * use id (in $aAttribs) instead) (optional; may not be provided)
+ * + $method - The HTTP method used to submit data (usually "get" or "post")
+ * + $action - The form action URI
+ * + $enctype - The content type that is used to submit data (this
+ * is optional and might be empty, in which case you
+ * should just let HTML default to "application/x-www-form-urlencoded"
+ * + $charset - The charset that is used for submitted data (optional; may
+ * not be provided)
+ * + $aAttribs - Any extra attributes: an associative array, where
+ * keys are attribute names, and values (which are
+ * optional and might be null) should be placed
+ * in double quotes as attribute values (optional;
+ * may not be provided)
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+if (!isset($aAttribs['id']) && !empty($name))
+ $aAttribs['id'] = $name;
+
+
+echo '<form';
+if (!empty($action)) echo ' action="' . $action . '"';
+if (!empty($name)) echo ' name="' . $name . '"';
+if (!empty($method)) echo ' method="' . $method . '"';
+if (!empty($charset)) echo ' accept-charset="' . $charset . '"';
+if (!empty($enctype)) echo ' enctype="' . $enctype . '"';
+foreach ($aAttribs as $key => $value) {
+ echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo ">\n";
+
+
--- /dev/null
+<?php
+
+/**
+ * input.tpl
+ *
+ * Template for constructing an input tag.
+ *
+ * The following variables are available in this template:
+ * + $type - The type of input tag being created
+ * + $aAttribs - Any extra attributes: an associative array, where
+ * keys are attribute names, and values (which are
+ * optional and might be null) should be placed
+ * in double quotes as attribute values (optional;
+ * may not be present)
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+echo '<input type="' . $type . '"';
+foreach ($aAttribs as $key => $value) {
+ echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo ' />';
+
+
--- /dev/null
+<?php
+
+/**
+ * select.tpl
+ *
+ * Template for constructing a select input tag.
+ *
+ * The following variables are available in this template:
+ * + $name - The name of the select input
+ * + $aValues - An associative array corresponding to each
+ * select option where keys must be used as
+ * the option value and the values must be used
+ * as the option text
+ * + $bUsekeys - When FALSE, the value of each option should
+ * be the same as the option text instead of
+ * using the array key for the option value
+ * + $default - The option value that should be selected by default
+ * + $aAttribs - Any extra attributes: an associative array, where
+ * keys are attribute names, and values (which are
+ * optional and might be null) should be placed
+ * in double quotes as attribute values (optional;
+ * may not be present)
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+if (isset($aAttribs['id'])) {
+ $label_open = '<label for="' . $aAttribs['id'] . '">';
+ $label_close = '</label>';
+} else {
+ $label_open = '';
+ $label_close = '';
+}
+
+
+echo '<select name="' . $name . '"';
+foreach ($aAttribs as $key => $value) {
+ echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo ">\n";
+
+
+foreach ($aValues as $key => $value) {
+ if (!$bUsekeys) $key = $value;
+ echo '<option value="' . $key . '"'
+ . (($default == $key) ? ' selected="selected"' : '')
+ . '>' . $label_open . $value . $label_close . "</option>\n";
+}
+echo "</select>\n";
+
+
--- /dev/null
+<?php
+
+/**
+ * textarea.tpl
+ *
+ * Template for constructing a textarea input tag.
+ *
+ * The following variables are available in this template:
+ * + $name - The name of the select input
+ * + $text - The initial value inside the textarea
+ * + $cols - The width of the textarea in characters
+ * + $rows - The height of the textarea in rows
+ * + $aAttribs - Any extra attributes: an associative array, where
+ * keys are attribute names, and values (which are
+ * optional and might be null) should be placed
+ * in double quotes as attribute values (optional;
+ * may not be present)
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+if (isset($aAttribs['id'])) {
+ $label_open = '<label for="' . $aAttribs['id'] . '">';
+ $label_close = '</label>';
+} else {
+ $label_open = '';
+ $label_close = '';
+}
+
+
+echo '<textarea name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '"';
+foreach ($aAttribs as $key => $value) {
+ echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+echo '>' . $label_open . $text . $label_close . "</textarea>\n";
+
+