* options.tpl
*
* Template for rendering the options page
+ *
+ * The following variables are available to this template:
+ * $options - array of options as built by SquirrelMail. Important fields
+ * in this array include (but are not limited to):
+ * $el['name'] - The name of the option group
+ * $el['options'] - array of squirrelOption objects
*
* @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
/** add required includes */
-
/** extract variables */
extract($t);
-
?>
-</td></tr>
-</table>
-</td></tr>
-</table>
+<div id="optionDisplay">
<?php
+foreach ($options as $option) {
+ echo "<table cellspacing=\"0\">\n";
-/**
- * $Log$
- * Revision 1.3 2006/07/15 12:01:19 tokul
- * removing trailing ?> from function scripts
- *
- * Revision 1.2 2006/07/13 18:49:44 tokul
- * reverting some templating changes. They broke plugin blocks.
- * moving display of option blocks to separate template
- *
- * Revision 1.1 2006/07/09 22:22:31 vanmer
- * - initial revision of a template for options output
- *
- *
-**/
+ if (!empty($option['name'])) {
+ echo " <tr>\n" .
+ " <td class=\"header1\" colspan=\"2\">\n" .
+ " ".$option['name']."\n" .
+ " </td>\n" .
+ " </tr>\n";
+ }
+
+ foreach ($option['options'] as $opt) {
+ if ($opt->type != SMOPT_TYPE_HIDDEN) {
+ echo "<tr>\n" .
+ " <td class=\"optionName\">\n" .
+ " ".$opt->caption."\n" .
+ " </td>\n" .
+ " <td class=\"optionValue\">\n" .
+ " ".$opt->createHTMLWidget()."\n" .
+ " </td>\n" .
+ "</tr>\n";
+ } else {
+ echo $opt->createHTMLWidget();
+ }
+ }
+
+ echo " <tr>\n <td colspan=\"2\" align=\"right\">\n"
+ . " <input type=\"submit\" value=\"" . _("Submit")
+ . "\" name=\"" . $submit_name . "\" /> \n </td>\n </tr>\n";
+
+ echo "</table>\n";
+}
+?>
+</div>