'.
- "$optpage_title \n".
- ''.
- "\n";
-
/*******************************************************************/
/* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */
/*******************************************************************/
/* If in submit mode, select a save hook name and run it. */
-if ($optmode == SMOPT_MODE_SUBMIT) {
+if ($optmode == SMOPT_MODE_SUBMIT) {
/* Select a save hook name. */
switch ($optpage) {
case SMOPT_PAGE_PERSONAL:
@@ -221,10 +196,13 @@ 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;
}
@@ -248,6 +226,8 @@ if ($optmode == SMOPT_MODE_SUBMIT) {
/* Finally, display whatever page we are supposed to show now. */
/***************************************************************/
+displayPageHeader($color, 'None', (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 +236,37 @@ 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()) {
+ $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") . ' ';
+ $notice .= '' . _("Refresh Folder List") . ' ';
} else if ($max_refresh) {
- echo '' . _("Refresh Page") . ' ';
+ $notice .= '' . _("Refresh Page") . ' ';
}
}
+
+ if (!empty($notice)) {
+ $oTemplate->assign('note', $notice);
+ $oTemplate->display('note.tpl');
+ }
+
/******************************************/
/* Build our array of Option Page Blocks. */
/******************************************/
@@ -296,7 +292,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,6 +312,14 @@ 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');
@@ -325,7 +329,7 @@ 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) {
$js_optpage_blocks[] = $cur_optpage;
@@ -336,25 +340,11 @@ 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);
+ $oTemplate->display('option_groups.tpl');
+
do_hook('options_link_and_description');
@@ -362,14 +352,6 @@ if ($optpage == SMOPT_PAGE_MAIN) {
/* 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);
}
+
}
-echo ' | ' .
- ' '.
- ' |
'.
- '