Add info option widget type
[squirrelmail.git] / templates / default / options.tpl
CommitLineData
4a644734 1<?php
2/**
3 * options.tpl
4 *
5 * Template for rendering the options page
64033e1c 6 *
7 * The following variables are available to this template:
6c06cf54 8 * $option_groups - array of option groups and their options as
9 * built by SquirrelMail. Important fields
10 * in this array include (but are not limited to):
11 * ['name'] - The name of the option group
12 * ['options'] - array of squirrelOption objects
4a644734 13 *
14 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
15 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
16 * @version $Id$
17 * @package squirrelmail
18 * @subpackage templates
19 */
20
21/** add required includes */
22
4a644734 23/** extract variables */
24extract($t);
209e24bb 25
26
27if ( !empty($topmessage) ) {
28 echo "<div id=\"optionMessage\">\n$topmessage\n</div>\n\n";
29}
4a644734 30?>
209e24bb 31
64033e1c 32<div id="optionDisplay">
33<?php
6c06cf54 34foreach ($option_groups as $option) {
64033e1c 35 echo "<table cellspacing=\"0\">\n";
4a644734 36
64033e1c 37 if (!empty($option['name'])) {
38 echo " <tr>\n" .
39 " <td class=\"header1\" colspan=\"2\">\n" .
40 " ".$option['name']."\n" .
41 " </td>\n" .
42 " </tr>\n";
43 }
44
ce910bca 45 $hidden_widgets = '';
64033e1c 46 foreach ($option['options'] as $opt) {
6c06cf54 47 if ($opt->type == SMOPT_TYPE_INFO) {
48 echo "<tr>\n"
49 . " <td colspan=\"2\">\n"
50 . " <table class=\"optionInfo\">\n"
51 . " <tr>\n"
52 . " <td>\n"
53 . $opt->createWidget() . "\n"
54 . " </td>\n"
55 . " </tr>\n"
56 . " </table>\n"
57 . " </td>\n"
58 . "</tr>\n";
59
60 } else if ($opt->type != SMOPT_TYPE_HIDDEN) {
64033e1c 61 echo "<tr>\n" .
e40b0e8e 62 " <td class=\"optionName\"" . ($opt->caption_wrap ? '' : ' style="white-space:nowrap"') . ">\n ";
2eb944e8 63
3b6a455c 64 if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX
65 || $opt->type == SMOPT_TYPE_BOOLEAN) {
2eb944e8 66 echo '<label for="new_' . $opt->name . '">'
67 . $opt->caption . '</label>';
cb78a4d9 68 } else if ($opt->type == SMOPT_TYPE_TEXTAREA && !empty($opt->trailing_text)) {
e7d5cb0e 69 echo $opt->caption . '<br /><small>' . $opt->trailing_text . '</small>';
2eb944e8 70 } else {
71 echo $opt->caption;
72 }
73
74 echo "\n </td>\n" .
64033e1c 75 " <td class=\"optionValue\">\n" .
9786ea94 76 " ".$opt->createWidget()."\n" .
64033e1c 77 " </td>\n" .
78 "</tr>\n";
79 } else {
ce910bca 80 $hidden_widgets .= $opt->createWidget();
64033e1c 81 }
82 }
83
835db280 84 echo " <tr>\n <td colspan=\"2\" align=\"right\">\n"
ce910bca 85 . $hidden_widgets . " <input type=\"submit\" value=\"" . _("Submit")
835db280 86 . "\" name=\"" . $submit_name . "\" />&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n";
87
64033e1c 88 echo "</table>\n";
89}
90?>
835db280 91</div>