From f99c446918b4b7452891d487df62e871ea03f19b Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 26 Mar 2009 09:52:10 +0000 Subject: [PATCH] Add access keys for folder pane git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13449 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/load_prefs.php | 5 +++ include/options/accessibility.php | 45 ++++++++++++++++++++++++ src/left_main.php | 6 ++++ templates/default/left_main.tpl | 11 +++++- templates/default_advanced/left_main.tpl | 21 ++++++++--- 5 files changed, 82 insertions(+), 6 deletions(-) diff --git a/include/load_prefs.php b/include/load_prefs.php index 7016d2b3..d23bcf98 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -391,6 +391,11 @@ $accesskey_compose_attach = getPref($data_dir, $username, 'accesskey_compose_att $accesskey_compose_delete_attach = getPref($data_dir, $username, 'accesskey_compose_delete_attach', 'l'); +$accesskey_folders_refresh = getPref($data_dir, $username, 'accesskey_folders_refresh', 'NONE'); +$accesskey_folders_purge_trash = getPref($data_dir, $username, 'accesskey_folders_purge_trash', 'NONE'); +$accesskey_folders_inbox = getPref($data_dir, $username, 'accesskey_folders_inbox', 'i'); + + /** * 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 30a5966a..8593d587 100644 --- a/include/options/accessibility.php +++ b/include/options/accessibility.php @@ -16,6 +16,8 @@ define('SMOPT_GRP_ACCESSKEYS_MENUBAR', 0); define('SMOPT_GRP_ACCESSKEYS_MAILBOX', 1); define('SMOPT_GRP_ACCESSKEYS_READ_MESSAGE', 2); define('SMOPT_GRP_ACCESSKEYS_COMPOSE', 3); +define('SMOPT_GRP_ACCESSKEYS_FOLDER_LIST', 4); +define('SMOPT_GRP_ACCESSKEYS_OPTIONS', 5); /** * This function builds an array with all the information about @@ -328,6 +330,49 @@ function load_optpage_data_accessibility() { ); + /*** Load the Access Key Options for the Folder List page into the array ***/ + $optgrps[SMOPT_GRP_ACCESSKEYS_FOLDER_LIST] = _("Access Keys For Folder List Screen"); + $optvals[SMOPT_GRP_ACCESSKEYS_FOLDER_LIST] = array(); + + $optvals[SMOPT_GRP_ACCESSKEYS_FOLDER_LIST][] = array( + 'name' => 'accesskey_folders_refresh', + 'caption' => _("Refresh/Check Mail"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_FOLDER_LIST][] = array( + 'name' => 'accesskey_folders_purge_trash', + 'caption' => _("Purge Trash"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_FOLDER_LIST][] = array( + 'name' => 'accesskey_folders_inbox', + 'caption' => _("INBOX"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + + /*** Load the Access Key Options for the main Options page into the array ***/ + $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, +// ); + + /* Assemble all this together and return it as our result. */ $result = array( 'grps' => $optgrps, diff --git a/src/left_main.php b/src/left_main.php index de005537..a0206184 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -205,6 +205,12 @@ $settings['messageRecyclingEnabled'] = $move_to_trash; $settings['collapsableFoldersEnabled'] = $collapse_folders==1; $oTemplate->assign('settings', $settings); +//access keys +// +$oTemplate->assign('accesskey_folders_refresh', $accesskey_folders_refresh); +$oTemplate->assign('accesskey_folders_purge_trash', $accesskey_folders_purge_trash); +$oTemplate->assign('accesskey_folders_inbox', $accesskey_folders_inbox); + $oTemplate->display('left_main.tpl'); sqimap_logout($imapConnection); diff --git a/templates/default/left_main.tpl b/templates/default/left_main.tpl index 6d9169c7..cd2fb92f 100644 --- a/templates/default/left_main.tpl +++ b/templates/default/left_main.tpl @@ -162,12 +162,21 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0) } $pre .= $folder_icon; + // calculate if access key is needed + // + if ($box['IsInbox']) { + global $accesskey_folders_inbox; + $accesskey = $accesskey_folders_inbox; + } + else $accesskey = ''; + /* * The Trash folder should only be displayed if message recycling has * been enabled, i.e. when deleted is a message moved to the trash or * deleted forever? */ $view_link = ''; @@ -261,7 +270,7 @@ extract($t);
- [
] + [target="left">] diff --git a/templates/default_advanced/left_main.tpl b/templates/default_advanced/left_main.tpl index 47005eab..69681bd2 100644 --- a/templates/default_advanced/left_main.tpl +++ b/templates/default_advanced/left_main.tpl @@ -226,11 +226,19 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) { } if ($display_folder) { + + if ($box['IsInbox']) { + global $accesskey_folders_inbox; + $accesskey = $accesskey_folders_inbox; + } + else $accesskey = ''; + $out .= 'mailboxes.add('.$counter.', '.$parent_node.', ' . '"'.addslashes($name).'", "'.$url.'", "'.$title.'", ' . '"'.$target.'", ' . '"'.getIconPath($icon_theme_path, $img).'", ' . - '"'.getIconPath($icon_theme_path, $img_open).'"' . + '"'.getIconPath($icon_theme_path, $img_open).'", ' . + '"'.$accesskey.'"' . ');'."\n"; } } @@ -283,7 +291,7 @@ extract($t);
- [] + [target="left">] @@ -291,13 +299,16 @@ extract($t);

- +   |   - + '; - echo '' . _("Purge trash") . ''; + echo '' . _("Purge Trash") . ''; } ?>

-- 2.25.1