From 9669833431103d4467075c4fbe59ba26238a657d Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 26 Mar 2009 10:27:24 +0000 Subject: [PATCH] Add access keys to main options page git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13450 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/load_prefs.php | 9 ++++ include/options/accessibility.php | 63 +++++++++++++++++++++---- src/options.php | 72 ++++++++++++++++++----------- templates/default/option_groups.tpl | 11 +++-- 4 files changed, 114 insertions(+), 41 deletions(-) diff --git a/include/load_prefs.php b/include/load_prefs.php index d23bcf98..a11feae7 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -396,6 +396,15 @@ $accesskey_folders_purge_trash = getPref($data_dir, $username, 'accesskey_folder $accesskey_folders_inbox = getPref($data_dir, $username, 'accesskey_folders_inbox', 'i'); +$accesskey_options_personal = getPref($data_dir, $username, 'accesskey_options_personal', 'p'); +$accesskey_options_display = getPref($data_dir, $username, 'accesskey_options_display', 'd'); +$accesskey_options_highlighting = getPref($data_dir, $username, 'accesskey_options_highlighting', 'h'); +$accesskey_options_folders = getPref($data_dir, $username, 'accesskey_options_folders', 'f'); +$accesskey_options_index_order = getPref($data_dir, $username, 'accesskey_options_index_order', 'x'); +$accesskey_options_compose = getPref($data_dir, $username, 'accesskey_options_compose', 'e'); +$accesskey_options_accessibility = getPref($data_dir, $username, 'accesskey_options_accessibility', 'a'); + + /** * Height of iframe that displays html formated emails * @since 1.5.1 diff --git a/include/options/accessibility.php b/include/options/accessibility.php index 8593d587..9e91ec55 100644 --- a/include/options/accessibility.php +++ b/include/options/accessibility.php @@ -363,14 +363,61 @@ function load_optpage_data_accessibility() { $optgrps[SMOPT_GRP_ACCESSKEYS_OPTIONS] = _("Access Keys For Options Screen"); $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS] = array(); -//FIXME -- TODO... -// $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( -// 'name' => 'accesskey_options_XXXXXXXXXXXXXXXXXXXXXXX', -// 'caption' => _("XXXXXXXXXXXXXXX"), -// 'type' => SMOPT_TYPE_STRLIST, -// 'refresh' => SMOPT_REFRESH_NONE, -// 'posvals' => $my_a_to_z, -// ); + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_personal', + 'caption' => _("Personal Information"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_display', + 'caption' => _("Display Preferences"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_highlighting', + 'caption' => _("Message Highlighting"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_folders', + 'caption' => _("Folder Preferences"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_index_order', + 'caption' => _("Index Order"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_compose', + 'caption' => _("Compose Preferences"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_OPTIONS][] = array( + 'name' => 'accesskey_options_accessibility', + 'caption' => _("Accessibility Preferences"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); /* Assemble all this together and return it as our result. */ diff --git a/src/options.php b/src/options.php index ad4c99cb..383c3d54 100644 --- a/src/options.php +++ b/src/options.php @@ -323,60 +323,73 @@ if ($optpage == SMOPT_PAGE_MAIN) { /******************************************/ $optpage_blocks = array(); + // access keys... + global $accesskey_options_personal, $accesskey_options_display, + $accesskey_options_highlighting, $accesskey_options_folders, + $accesskey_options_index_order, $accesskey_options_compose, + $accesskey_options_accessibility; + /* Build a section for Personal Options. */ $optpage_blocks[] = array( - 'name' => _("Personal Information"), - 'url' => 'options.php?optpage=' . SMOPT_PAGE_PERSONAL, - 'desc' => _("This contains personal information about yourself such as your name, your email address, etc."), - 'js' => false + 'name' => _("Personal Information"), + 'url' => 'options.php?optpage=' . SMOPT_PAGE_PERSONAL, + 'desc' => _("This contains personal information about yourself such as your name, your email address, etc."), + 'js' => false, + 'accesskey' => $accesskey_options_personal, ); /* Build a section for Display Options. */ $optpage_blocks[] = array( - 'name' => _("Display Preferences"), - 'url' => 'options.php?optpage=' . SMOPT_PAGE_DISPLAY, - 'desc' => _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings."), - 'js' => false + 'name' => _("Display Preferences"), + 'url' => 'options.php?optpage=' . SMOPT_PAGE_DISPLAY, + 'desc' => _("You can change the way that SquirrelMail looks and displays information to you, such as the colors, the language, and other settings."), + 'js' => false, + 'accesskey' => $accesskey_options_display, ); /* Build a section for Message Highlighting Options. */ $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."), - 'js' => false + '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."), + 'js' => false, + 'accesskey' => $accesskey_options_highlighting, ); /* Build a section for Folder Options. */ $optpage_blocks[] = array( - 'name' => _("Folder Preferences"), - 'url' => 'options.php?optpage=' . SMOPT_PAGE_FOLDER, - 'desc' => _("These settings change the way your folders are displayed and manipulated."), - 'js' => false + 'name' => _("Folder Preferences"), + 'url' => 'options.php?optpage=' . SMOPT_PAGE_FOLDER, + 'desc' => _("These settings change the way your folders are displayed and manipulated."), + 'js' => false, + 'accesskey' => $accesskey_options_folders, ); /* Build a section for Index Order Options. */ $optpage_blocks[] = array( - 'name' => _("Index Order"), - 'url' => 'options_order.php', - 'desc' => _("The order of the message index can be rearranged and changed to contain the headers in any order you want."), - 'js' => false + 'name' => _("Index Order"), + 'url' => 'options_order.php', + 'desc' => _("The order of the message index can be rearranged and changed to contain the headers in any order you want."), + 'js' => false, + 'accesskey' => $accesskey_options_index_order, ); /* 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 + '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, + 'accesskey' => $accesskey_options_compose, ); /* Build a section for Accessibility Options. */ $optpage_blocks[] = array( - 'name' => _("Accessibility Preferences"), - 'url' => 'options.php?optpage=' . SMOPT_PAGE_ACCESSIBILITY, - 'desc' => _("You can configure features that improve interface usability."), - 'js' => false + 'name' => _("Accessibility Preferences"), + 'url' => 'options.php?optpage=' . SMOPT_PAGE_ACCESSIBILITY, + 'desc' => _("You can configure features that improve interface usability."), + 'js' => false, + 'accesskey' => $accesskey_options_accessibility, ); /* Build a section for plugins wanting to register an optionpage. */ @@ -388,6 +401,9 @@ if ($optpage == SMOPT_PAGE_MAIN) { $js_optpage_blocks = array(); $reg_optpage_blocks = array(); foreach ($optpage_blocks as $cur_optpage) { + if (!isset($cur_optpage['accesskey'])) { + $cur_optpage['accesskey'] = 'NONE'; + } if (!isset($cur_optpage['js']) || !$cur_optpage['js']) { $reg_optpage_blocks[] = $cur_optpage; } else if (checkForJavascript()) { diff --git a/templates/default/option_groups.tpl b/templates/default/option_groups.tpl index c1a8acfb..11b3ce2b 100644 --- a/templates/default/option_groups.tpl +++ b/templates/default/option_groups.tpl @@ -8,10 +8,11 @@ * $page_title - string containing the title element for this page * $options - array containing option blocks to be displayed. Each * element in the array will contain the following fields: - * $el['url'] - The URL of the link to display that option page - * $el['name'] - The name of the option page - * $el['desc'] - string containing the description of that option block - * $el['js'] - boolean TRUE if the element requires javascript being enabled. + * $el['url'] - The URL of the link to display that option page + * $el['name'] - The name of the option page + * $el['desc'] - string containing the description of that option block + * $el['js'] - boolean TRUE if the element requires javascript being enabled. + * $el['accesskey'] - an access key, if one exists (if not, it will be "NONE") * * @copyright © 2006 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License @@ -38,7 +39,7 @@ extract($t); -- 2.25.1
- > + >