'.
- "$optpage_title \n".
- ''.
- "\n";
-
/*******************************************************************/
/* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */
/*******************************************************************/
@@ -221,16 +210,19 @@ if ($optmode == SMOPT_MODE_SUBMIT) {
case SMOPT_PAGE_DISPLAY:
$save_hook_name = 'options_display_save';
break;
+ case SMOPT_PAGE_COMPOSE:
+ $save_hook_name = 'options_compose_save';
+ break;
case SMOPT_PAGE_FOLDER:
$save_hook_name = 'options_folder_save';
break;
- default:
+ default:
$save_hook_name = 'options_save';
break;
}
/* Run the options save hook. */
- do_hook($save_hook_name);
+ do_hook($save_hook_name, $null);
}
/***************************************************************/
@@ -248,6 +240,8 @@ if ($optmode == SMOPT_MODE_SUBMIT) {
/* Finally, display whatever page we are supposed to show now. */
/***************************************************************/
+displayPageHeader($color, null, (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : ''));
+
/*
* The main option page has a different layout then the rest of the option
* pages. Therefore, we create it here first, then the others below.
@@ -256,21 +250,48 @@ if ($optpage == SMOPT_PAGE_MAIN) {
/**********************************************************/
/* First, display the results of a submission, if needed. */
/**********************************************************/
+ $notice = '';
if ($optmode == SMOPT_MODE_SUBMIT) {
if (!isset($frame_top)) {
$frame_top = '_top';
}
- /* Display a message indicating a successful save. */
- echo '' . _("Successfully Saved Options") . ": $optpage_name \n";
+
+ if (isset($optpage_save_error) && $optpage_save_error!=array()) {
+//FIXME: REMOVE HTML FROM CORE
+ $notice = _("Error(s) occurred while saving your options") . " \n\n";
+ foreach ($optpage_save_error as $error_message) {
+ $notice.= '- ' . $error_message . "
\n";
+ }
+ $notice.= " \n" . _("Some of your preference changes were not applied.") . "\n";
+ } else {
+ /* Display a message indicating a successful save. */
+ $notice = _("Successfully Saved Options") . ": $optpage_name \n";
+ }
/* If $max_refresh != SMOPT_REFRESH_NONE, provide a refresh link. */
if ( !isset( $max_refresh ) ) {
} else if ($max_refresh == SMOPT_REFRESH_FOLDERLIST) {
- echo '' . _("Refresh Folder List") . ' ';
+//FIXME: REMOVE HTML FROM CORE - when migrating, keep in mind that the javascript below assumes the folder list is in a separate sibling frame under the same parent, and it is called "left"
+ if (checkForJavascript()) {
+ $notice .= sprintf(_("Folder list should automatically %srefresh%s."), '', '') . ' \n";
+ } else {
+ $notice .= '' . _("Refresh Folder List") . ' ';
+ }
} else if ($max_refresh) {
- echo '' . _("Refresh Page") . ' ';
+ if (checkForJavascript()) {
+//FIXME: REMOVE HTML FROM CORE - when migrating, keep in mind that the javascript below assumes the parent is the top-most SM frame and is what should be refreshed with webmail.php
+ $notice .= sprintf(_("This page should automatically %srefresh%s."), '', '') . ' \n";
+ } else {
+ $notice .= '' . _("Refresh Page") . ' ';
+ }
}
}
+
+ if (!empty($notice)) {
+ $oTemplate->assign('note', $notice);
+ $oTemplate->display('note.tpl');
+ }
+
/******************************************/
/* Build our array of Option Page Blocks. */
/******************************************/
@@ -296,7 +317,7 @@ if ($optpage == SMOPT_PAGE_MAIN) {
$optpage_blocks[] = array(
'name' =>_("Message Highlighting"),
'url' => 'options_highlight.php',
- 'desc' =>_("Based upon given criteria, incoming messages can have different background colors in the message list. This helps to easily distinguish who the messages are from, especially for mailing lists."),
+ 'desc' =>_("Based upon given criteria, incoming messages can have different background colors in the message list. This helps to easily distinguish who the messages are from, especially for mailing lists."),
'js' => false
);
@@ -316,8 +337,16 @@ if ($optpage == SMOPT_PAGE_MAIN) {
'js' => false
);
+ /* Build a section for Compose Options. */
+ $optpage_blocks[] = array(
+ 'name' => _("Compose Preferences"),
+ 'url' => 'options.php?optpage=' . SMOPT_PAGE_COMPOSE,
+ 'desc' => _("Control the behaviour and layout of writing new mail messages, replying to and forwarding messages."),
+ 'js' => false
+ );
+
/* Build a section for plugins wanting to register an optionpage. */
- do_hook('optpage_register_block');
+ do_hook('optpage_register_block', $null);
/*****************************************************/
/* Let's sort Javascript Option Pages to the bottom. */
@@ -325,9 +354,9 @@ if ($optpage == SMOPT_PAGE_MAIN) {
$js_optpage_blocks = array();
$reg_optpage_blocks = array();
foreach ($optpage_blocks as $cur_optpage) {
- if (!$cur_optpage['js']) {
+ if (!isset($cur_optpage['js']) || !$cur_optpage['js']) {
$reg_optpage_blocks[] = $cur_optpage;
- } else if ($javascript_on == SMPREF_JS_ON) {
+ } else if (checkForJavascript()) {
$js_optpage_blocks[] = $cur_optpage;
}
}
@@ -336,40 +365,18 @@ if ($optpage == SMOPT_PAGE_MAIN) {
/********************************************/
/* Now, print out each option page section. */
/********************************************/
- $first_optpage = false;
- echo "" .
- '' .
- "";
- foreach ($optpage_blocks as $next_optpage) {
- if ($first_optpage == false) {
- $first_optpage = $next_optpage;
- } else {
- print_optionpages_row($first_optpage, $next_optpage);
- $first_optpage = false;
- }
- }
-
- if ($first_optpage != false) {
- print_optionpages_row($first_optpage);
- }
-
- echo " |
| \n";
+ $oTemplate->assign('page_title', $optpage_title);
+ $oTemplate->assign('options', $optpage_blocks);
- do_hook('options_link_and_description');
+ $oTemplate->display('option_groups.tpl');
+
+ do_hook('options_link_and_description', $null);
/*************************************************************************/
/* If we are not looking at the main option page, display the page here. */
/*************************************************************************/
} else {
- echo '\n";
/* If it is not empty, trigger the bottom hook. */
if ($bottom_hook_name != '') {
- do_hook($bottom_hook_name);
+ do_hook($bottom_hook_name, $null);
}
+
}
-echo ' | ' .
- ' '.
- ' |
'.
- '