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 | * |
f197ec88 |
14 | * @copyright 1999-2016 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 */ |
24 | extract($t); |
209e24bb |
25 | |
26 | |
27 | if ( !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 |
34 | foreach ($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)) { |
66 | echo '<br /><small>' . $opt->trailing_text . '</small>'; |
2eb944e8 |
67 | } |
a54c0e78 |
68 | echo '</label>'; |
2eb944e8 |
69 | |
70 | echo "\n </td>\n" . |
64033e1c |
71 | " <td class=\"optionValue\">\n" . |
9786ea94 |
72 | " ".$opt->createWidget()."\n" . |
64033e1c |
73 | " </td>\n" . |
74 | "</tr>\n"; |
75 | } else { |
ce910bca |
76 | $hidden_widgets .= $opt->createWidget(); |
64033e1c |
77 | } |
78 | } |
79 | |
835db280 |
80 | echo " <tr>\n <td colspan=\"2\" align=\"right\">\n" |
ce910bca |
81 | . $hidden_widgets . " <input type=\"submit\" value=\"" . _("Submit") |
835db280 |
82 | . "\" name=\"" . $submit_name . "\" /> \n </td>\n </tr>\n"; |
83 | |
64033e1c |
84 | echo "</table>\n"; |
85 | } |
86 | ?> |
835db280 |
87 | </div> |