misplaced labels
[squirrelmail.git] / templates / default / options.tpl
1 <?php
2 /**
3 * options.tpl
4 *
5 * Template for rendering the options page
6 *
7 * The following variables are available to this template:
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
13 *
14 * @copyright &copy; 1999-2009 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
23 /** extract variables */
24 extract($t);
25
26
27 if ( !empty($topmessage) ) {
28 echo "<div id=\"optionMessage\">\n$topmessage\n</div>\n\n";
29 }
30 ?>
31
32 <div id="optionDisplay">
33 <?php
34 foreach ($option_groups as $option) {
35 echo "<table cellspacing=\"0\">\n";
36
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
45 $hidden_widgets = '';
46 foreach ($option['options'] as $opt) {
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) {
61 echo "<tr>\n" .
62 " <td class=\"optionName\"" . ($opt->caption_wrap ? '' : ' style="white-space:nowrap"') . ">\n ";
63
64 if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX
65 || $opt->type == SMOPT_TYPE_BOOLEAN) {
66 echo '<label for="new_' . $opt->name . '">'
67 . $opt->caption . '</label>';
68 } else if ($opt->type == SMOPT_TYPE_TEXTAREA && !empty($opt->trailing_text)) {
69 echo $opt->caption . '<br /><small>' . $opt->trailing_text . '</small>';
70 } else {
71 echo $opt->caption;
72 }
73
74 echo "\n </td>\n" .
75 " <td class=\"optionValue\">\n" .
76 " ".$opt->createWidget()."\n" .
77 " </td>\n" .
78 "</tr>\n";
79 } else {
80 $hidden_widgets .= $opt->createWidget();
81 }
82 }
83
84 echo " <tr>\n <td colspan=\"2\" align=\"right\">\n"
85 . $hidden_widgets . " <input type=\"submit\" value=\"" . _("Submit")
86 . "\" name=\"" . $submit_name . "\" />&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n";
87
88 echo "</table>\n";
89 }
90 ?>
91 </div>