}
/* Set the default save function. */
- if (($type != SMOPT_TYPE_HIDDEN) && ($type != SMOPT_TYPE_COMMENT)) {
+ if ($type != SMOPT_TYPE_HIDDEN
+ && $type != SMOPT_TYPE_INFO
+ && $type != SMOPT_TYPE_COMMENT) {
$this->save_function = SMOPT_SAVE_DEFAULT;
} else {
$this->save_function = SMOPT_SAVE_NOOP;
case SMOPT_TYPE_SUBMIT:
$result = $this->createWidget_Submit();
break;
+ case SMOPT_TYPE_INFO:
+ $result = $this->createWidget_Info();
+ break;
default:
error_box (
sprintf(_("Option Type '%s' Not Found"), $this->type)
return $result;
}
+ /**
+ * Creates info block
+ * @return string html formated output
+ */
+ function createWidget_Info() {
+ return sq_htmlspecialchars($this->value);
+ }
+
/**
* Create string field
* @return string html formated option field
define('SMOPT_TYPE_BOOLEAN_RADIO', 13);
define('SMOPT_TYPE_STRLIST_RADIO', 14);
define('SMOPT_TYPE_SUBMIT', 15);
+define('SMOPT_TYPE_INFO', 16);
// Define constants for the layout scheme for edit lists
define('SMOPT_EDIT_LIST_LAYOUT_LIST', 0);
. create_optmode_element(SMOPT_MODE_SUBMIT);
// This is the only variable that is needed by *just* the template.
- $oTemplate->assign('options', $optpage_data['options']);
+ $oTemplate->assign('option_groups', $optpage_data['options']);
global $ask_user_info, $org_name;
if ( $optpage == SMOPT_PAGE_PERSONAL && $ask_user_info
height: 100%;
}
+#optionDisplay table.optionInfo {
+ width: 80%;
+ text-align: left;
+ border: 0px;
+}
#optionGroups td.optionName {
background: #ababab;
* Template for rendering the options page
*
* The following variables are available to this template:
- * $options - array of options as built by SquirrelMail. Important fields
- * in this array include (but are not limited to):
- * $el['name'] - The name of the option group
- * $el['options'] - array of squirrelOption objects
+ * $option_groups - array of option groups and their options as
+ * built by SquirrelMail. Important fields
+ * in this array include (but are not limited to):
+ * ['name'] - The name of the option group
+ * ['options'] - array of squirrelOption objects
*
* @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
<div id="optionDisplay">
<?php
-foreach ($options as $option) {
+foreach ($option_groups as $option) {
echo "<table cellspacing=\"0\">\n";
if (!empty($option['name'])) {
$hidden_widgets = '';
foreach ($option['options'] as $opt) {
- if ($opt->type != SMOPT_TYPE_HIDDEN) {
+ if ($opt->type == SMOPT_TYPE_INFO) {
+ echo "<tr>\n"
+ . " <td colspan=\"2\">\n"
+ . " <table class=\"optionInfo\">\n"
+ . " <tr>\n"
+ . " <td>\n"
+ . $opt->createWidget() . "\n"
+ . " </td>\n"
+ . " </tr>\n"
+ . " </table>\n"
+ . " </td>\n"
+ . "</tr>\n";
+
+ } else if ($opt->type != SMOPT_TYPE_HIDDEN) {
echo "<tr>\n" .
" <td class=\"optionName\"" . ($opt->caption_wrap ? '' : ' style="white-space:nowrap"') . ">\n ";