From 2fad95fae22862b6488bfed2ec007419bc608cbe Mon Sep 17 00:00:00 2001 From: thomppj Date: Mon, 17 Dec 2001 19:53:26 +0000 Subject: [PATCH] Small fixes to option page stuff... git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1864 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 22 +++++++++++----------- src/options.php | 21 +++++++++------------ src/options_folder.php | 2 +- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/functions/options.php b/functions/options.php index 005aea75..e25f71d6 100644 --- a/functions/options.php +++ b/functions/options.php @@ -310,11 +310,6 @@ function create_hidden_element($name, $value) { return ($result); } - -function createOptionGroups($optgrps, $optvals) { - return create_option_groups($optgrps, $optvals); -} - function create_option_groups($optgrps, $optvals) { /* Build a simple array with which to start. */ $result = array(); @@ -377,14 +372,17 @@ function create_option_groups($optgrps, $optvals) { return ($result); } -function printOptionGroups($option_groups) { - print_option_groups($option_groups); -} - function print_option_groups($option_groups) { + /* Print each option group. */ foreach ($option_groups as $next_optgrp) { - echo '' - . $next_optgrp['name'] . "\n"; + /* If it is not blank, print the name for this option group. */ + if ($next_optgrp['name'] != '') { + echo '' + . $next_optgrp['name'] + . "\n"; + } + + /* Print each option in this option group. */ foreach ($next_optgrp['options'] as $option) { if ($option->type != SMOPT_TYPE_HIDDEN) { echo "\n"; @@ -396,6 +394,8 @@ function print_option_groups($option_groups) { echo $option->createHTMLWidget(); } } + + /* Print an empty row after this option group. */ echo " \n"; } } diff --git a/src/options.php b/src/options.php index f9f888e2..7cdb01fb 100644 --- a/src/options.php +++ b/src/options.php @@ -98,30 +98,30 @@ switch ($optpage) { case SMOPT_PAGE_MAIN: break; case SMOPT_PAGE_PERSONAL: $optpage_name = _("Personal Information"); - $optpage_file = 'options_personal.php'; + $optpage_file = '../src/options_personal.php'; $optpage_loader = 'load_optpage_data_personal'; break; case SMOPT_PAGE_DISPLAY: $optpage_name = _("Display Preferences"); - $optpage_file = 'options_display.php'; + $optpage_file = '../src/options_display.php'; $optpage_loader = 'load_optpage_data_display'; break; case SMOPT_PAGE_HIGHLIGHT: $optpage_name = _("Message Highlighting"); - $optpage_file = 'options_highlight.php'; + $optpage_file = '../src/options_highlight.php'; $optpage_loader = 'load_optpage_data_highlight'; break; case SMOPT_PAGE_FOLDER: $optpage_name = _("Folder Preferences"); - $optpage_file = 'options_folder.php'; + $optpage_file = '../src/options_folder.php'; $optpage_loader = 'load_optpage_data_folder'; break; case SMOPT_PAGE_ORDER: $optpage_name = _("Index Order"); - $optpage_file = 'options_order.php'; + $optpage_file = '../src/options_order.php'; $optpage_loader = 'load_optpage_data_order'; break; - default: do_hook('set_optpage_loadinfo'); + default: do_hook('optpage_set_loadinfo'); } /**********************************************************/ @@ -323,16 +323,13 @@ if ($optpage == SMOPT_PAGE_MAIN) { /*************************************************************************/ } else { echo '

' . "\n" - . '' . "\n" + . '
' . "\n" . create_optpage_element($optpage) . create_optmode_element(SMOPT_MODE_SUBMIT); /* Output the option groups for this page. */ print_option_groups($optpage_data['options']); - /*** FIXME: CURRENTLY, THIS NEXT SWITCH STATEMENT DOES NOT TAKE - *** INTO ACCOUNT FOR PLUGINS. NEED TO FIX IT. ***/ - /* Set the inside_hook_name and submit_name. */ switch ($optpage) { case SMOPT_PAGE_PERSONAL: @@ -347,12 +344,12 @@ if ($optpage == SMOPT_PAGE_MAIN) { break; case SMOPT_PAGE_HIGHLIGHT: $inside_hook_name = 'options_highlight_inside'; - $bottom_hook_name = 'options_display_bottom'; + $bottom_hook_name = 'options_highlight_bottom'; $submit_name = 'submit_highlight'; break; case SMOPT_PAGE_FOLDER: $inside_hook_name = 'options_folder_inside'; - $bottom_hook_name = 'options_display_bottom'; + $bottom_hook_name = 'options_folder_bottom'; $submit_name = 'submit_folder'; break; case SMOPT_PAGE_ORDER: diff --git a/src/options_folder.php b/src/options_folder.php index 18dc8d4b..099868cb 100644 --- a/src/options_folder.php +++ b/src/options_folder.php @@ -20,7 +20,7 @@ define('SMOPT_GRP_FOLDERLIST', 1); /* Define the optpage load function for the folder options page. */ function load_optpage_data_folder() { global $username, $key, $imapServerAddress, $imapPort; - global $folder_prefix, $default_folder_prefix; + global $folder_prefix, $default_folder_prefix, $show_prefix_option; /* Get some imap data we need later. */ $imapConnection = -- 2.25.1