'.
- "$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 +197,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 +227,16 @@ 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'] : ''));
+
+echo html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"' ) . "\n" .
+ html_tag( 'tr' ) . "\n" .
+ html_tag( 'td', '', 'center' ) .
+ "$optpage_title \n".
+ html_tag( 'table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"' ) . "\n" .
+ html_tag( 'tr' ) . "\n" .
+ html_tag( 'td', '', 'center', $color[4] ) . "\n";
+
/*
* 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 +245,35 @@ 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") . ' ';
}
}
+ $oTemplate->assign('notice',$notice);
+
/******************************************/
/* Build our array of Option Page Blocks. */
/******************************************/
@@ -296,7 +299,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 +319,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 +336,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,24 +347,10 @@ 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('color',$color);
+ $oTemplate->assign('optpage_blocks',$optpage_blocks);
+ $oTemplate->display('option_groups.tpl');
do_hook('options_link_and_description');
@@ -362,10 +359,10 @@ if ($optpage == SMOPT_PAGE_MAIN) {
/* If we are not looking at the main option page, display the page here. */
/*************************************************************************/
} else {
- echo '';
+ echo ' | ';
/* If it is not empty, trigger the bottom hook. */
if ($bottom_hook_name != '') {
- do_hook($bottom_hook_name);
+ do_hook($bottom_hook_name);
}
+ if (isset($max_refresh)) $oTemplate->assign('max_refresh',$max_refresh);
+ $oTemplate->assign('color',$color);
+ $oTemplate->assign('optpage',$optpage);
+ $oTemplate->assign('optpage_name',$optpage_name);
+ $oTemplate->assign('optpage_data',$optpage_data);
+ $oTemplate->assign('optmode',$optmode);
+ $oTemplate->display('options.tpl');
}
-echo ' |
' .
- '