| 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 | * $options - array of options as built by SquirrelMail. Important fields |
| 9 | * in this array include (but are not limited to): |
| 10 | * $el['name'] - The name of the option group |
| 11 | * $el['options'] - array of squirrelOption objects |
| 12 | * |
| 13 | * @copyright © 1999-2006 The SquirrelMail Project Team |
| 14 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
| 15 | * @version $Id$ |
| 16 | * @package squirrelmail |
| 17 | * @subpackage templates |
| 18 | */ |
| 19 | |
| 20 | /** add required includes */ |
| 21 | |
| 22 | /** extract variables */ |
| 23 | extract($t); |
| 24 | |
| 25 | |
| 26 | if ( !empty($topmessage) ) { |
| 27 | echo "<div id=\"optionMessage\">\n$topmessage\n</div>\n\n"; |
| 28 | } |
| 29 | ?> |
| 30 | |
| 31 | <div id="optionDisplay"> |
| 32 | <?php |
| 33 | foreach ($options as $option) { |
| 34 | echo "<table cellspacing=\"0\">\n"; |
| 35 | |
| 36 | if (!empty($option['name'])) { |
| 37 | echo " <tr>\n" . |
| 38 | " <td class=\"header1\" colspan=\"2\">\n" . |
| 39 | " ".$option['name']."\n" . |
| 40 | " </td>\n" . |
| 41 | " </tr>\n"; |
| 42 | } |
| 43 | |
| 44 | foreach ($option['options'] as $opt) { |
| 45 | if ($opt->type != SMOPT_TYPE_HIDDEN) { |
| 46 | echo "<tr>\n" . |
| 47 | " <td class=\"optionName\">\n "; |
| 48 | |
| 49 | if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX |
| 50 | || $opt->type == SMOPT_TYPE_BOOLEAN) { |
| 51 | echo '<label for="new_' . $opt->name . '">' |
| 52 | . $opt->caption . '</label>'; |
| 53 | } else { |
| 54 | echo $opt->caption; |
| 55 | } |
| 56 | |
| 57 | echo "\n </td>\n" . |
| 58 | " <td class=\"optionValue\">\n" . |
| 59 | " ".$opt->createWidget()."\n" . |
| 60 | " </td>\n" . |
| 61 | "</tr>\n"; |
| 62 | } else { |
| 63 | echo $opt->createWidget(); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | echo " <tr>\n <td colspan=\"2\" align=\"right\">\n" |
| 68 | . " <input type=\"submit\" value=\"" . _("Submit") |
| 69 | . "\" name=\"" . $submit_name . "\" /> \n </td>\n </tr>\n"; |
| 70 | |
| 71 | echo "</table>\n"; |
| 72 | } |
| 73 | ?> |
| 74 | </div> |