Happy New Year
[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 *
c4faef33 14 * @copyright 1999-2020 The SquirrelMail Project Team
4a644734 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
a54c0e78 64 echo '<label for="new_' . $opt->name . '">' . $opt->caption;
65 if ($opt->type == SMOPT_TYPE_TEXTAREA && !empty($opt->trailing_text)) {
36cbff96 66// TODO: Is trailing_text already sanitized here? (sm_encode_html_special_chars()) Either way, we want to have an option to sanitize or not depending on $opt->trailing_text_is_html ---- note that this question may already be taken care of in functions/options.php and irrelevant here, but I'm not sure about that yet.... after looking a little, it does appear this is a problem, though where to solve it is not clear
a54c0e78 67 echo '<br /><small>' . $opt->trailing_text . '</small>';
2eb944e8 68 }
a54c0e78 69 echo '</label>';
2eb944e8 70
71 echo "\n </td>\n" .
64033e1c 72 " <td class=\"optionValue\">\n" .
9786ea94 73 " ".$opt->createWidget()."\n" .
64033e1c 74 " </td>\n" .
75 "</tr>\n";
76 } else {
ce910bca 77 $hidden_widgets .= $opt->createWidget();
64033e1c 78 }
79 }
80
835db280 81 echo " <tr>\n <td colspan=\"2\" align=\"right\">\n"
ce910bca 82 . $hidden_widgets . " <input type=\"submit\" value=\"" . _("Submit")
835db280 83 . "\" name=\"" . $submit_name . "\" />&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n";
84
64033e1c 85 echo "</table>\n";
86}
87?>
835db280 88</div>