From: pdontthink Date: Thu, 26 Mar 2009 08:40:48 +0000 (+0000) Subject: Add access keys for menubar X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fbffe02466a1035df70719c3db14052c9ce7c520;p=squirrelmail.git Add access keys for menubar git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13447 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/page_header.php b/functions/page_header.php index fb53d0da..31885edd 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -276,6 +276,21 @@ function displayPageHeader($color, $mailbox='', $sHeaderJs='', $sOnload = '') { $oTemplate->assign('urlMailbox', $urlMailbox); $oTemplate->assign('startMessage', $startMessage); $oTemplate->assign('hide_sm_attributions', $hide_sm_attributions); + + // access keys + // + global $accesskey_menubar_compose, $accesskey_menubar_addresses, + $accesskey_menubar_folders, $accesskey_menubar_options, + $accesskey_menubar_search, $accesskey_menubar_help, + $accesskey_menubar_signout; + $oTemplate->assign('accesskey_menubar_compose', $accesskey_menubar_compose); + $oTemplate->assign('accesskey_menubar_addresses', $accesskey_menubar_addresses); + $oTemplate->assign('accesskey_menubar_folders', $accesskey_menubar_folders); + $oTemplate->assign('accesskey_menubar_options', $accesskey_menubar_options); + $oTemplate->assign('accesskey_menubar_search', $accesskey_menubar_search); + $oTemplate->assign('accesskey_menubar_help', $accesskey_menubar_help); + $oTemplate->assign('accesskey_menubar_signout', $accesskey_menubar_signout); + $oTemplate->display('page_header.tpl'); global $null; diff --git a/include/load_prefs.php b/include/load_prefs.php index e43a6c68..7016d2b3 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -353,6 +353,15 @@ $delete_prev_next_display = getPref($data_dir, $username, 'delete_prev_next_disp * Access keys * @since 1.5.2 */ +$accesskey_menubar_compose = getPref($data_dir, $username, 'accesskey_menubar_compose', 'c'); +$accesskey_menubar_addresses = getPref($data_dir, $username, 'accesskey_menubar_addresses', 'NONE'); +$accesskey_menubar_folders = getPref($data_dir, $username, 'accesskey_menubar_folders', 'NONE'); +$accesskey_menubar_options = getPref($data_dir, $username, 'accesskey_menubar_options', 'o'); +$accesskey_menubar_search = getPref($data_dir, $username, 'accesskey_menubar_search', 'NONE'); +$accesskey_menubar_help = getPref($data_dir, $username, 'accesskey_menubar_help', 'NONE'); +$accesskey_menubar_signout = getPref($data_dir, $username, 'accesskey_menubar_signout', 'z'); + + $accesskey_read_msg_reply = getPref($data_dir, $username, 'accesskey_read_msg_reply', 'r'); $accesskey_read_msg_reply_all = getPref($data_dir, $username, 'accesskey_read_msg_reply_all', 'a'); $accesskey_read_msg_forward = getPref($data_dir, $username, 'accesskey_read_msg_forward', 'f'); @@ -361,12 +370,13 @@ $accesskey_read_msg_delete = getPref($data_dir, $username, 'accesskey_read_msg_d $accesskey_read_msg_bypass_trash = getPref($data_dir, $username, 'accesskey_read_msg_bypass_trash', 'b'); $accesskey_read_msg_move_to = getPref($data_dir, $username, 'accesskey_read_msg_move_to', 't'); $accesskey_read_msg_move = getPref($data_dir, $username, 'accesskey_read_msg_move', 'm'); -$accesskey_read_msg_copy = getPref($data_dir, $username, 'accesskey_read_msg_copy', 'c'); +$accesskey_read_msg_copy = getPref($data_dir, $username, 'accesskey_read_msg_copy', 'y'); + $accesskey_compose_identity = getPref($data_dir, $username, 'accesskey_compose_identity', 'f'); $accesskey_compose_to = getPref($data_dir, $username, 'accesskey_compose_to', 't'); -$accesskey_compose_cc = getPref($data_dir, $username, 'accesskey_compose_cc', 'c'); -$accesskey_compose_bcc = getPref($data_dir, $username, 'accesskey_compose_bcc', 'o'); +$accesskey_compose_cc = getPref($data_dir, $username, 'accesskey_compose_cc', 'x'); +$accesskey_compose_bcc = getPref($data_dir, $username, 'accesskey_compose_bcc', 'y'); $accesskey_compose_subject = getPref($data_dir, $username, 'accesskey_compose_subject', 'j'); $accesskey_compose_priority = getPref($data_dir, $username, 'accesskey_compose_priority', 'p'); $accesskey_compose_on_read = getPref($data_dir, $username, 'accesskey_compose_on_read', 'r'); diff --git a/include/options/accessibility.php b/include/options/accessibility.php index 70bdf1ac..30a5966a 100644 --- a/include/options/accessibility.php +++ b/include/options/accessibility.php @@ -12,8 +12,10 @@ */ /** Define the group constants for this options page. */ -define('SMOPT_GRP_ACCESSKEYS_READ_MESSAGE', 0); -define('SMOPT_GRP_ACCESSKEYS_COMPOSE', 1); +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); /** * This function builds an array with all the information about @@ -41,6 +43,81 @@ function load_optpage_data_accessibility() { /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */ /******************************************************/ + /*** Load the Access Key Options for the Menubar into the array ***/ + $optgrps[SMOPT_GRP_ACCESSKEYS_MENUBAR] = _("Access Keys For Top Menu (All Screens)"); + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR] = array(); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_compose', + 'caption' => _("Compose"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_addresses', + 'caption' => _("Addresses"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_folders', + 'caption' => _("Folders"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_options', + 'caption' => _("Options"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_search', + 'caption' => _("Search"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_help', + 'caption' => _("Help"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + $optvals[SMOPT_GRP_ACCESSKEYS_MENUBAR][] = array( + 'name' => 'accesskey_menubar_signout', + 'caption' => _("Sign Out"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => $my_a_to_z, + ); + + + /*** Load the Access Key Options for the Mailbox page into the array ***/ + $optgrps[SMOPT_GRP_ACCESSKEYS_MAILBOX] = _("Access Keys For Message List Screen"); + $optvals[SMOPT_GRP_ACCESSKEYS_MAILBOX] = array(); + +//FIXME -- TODO... +// $optvals[SMOPT_GRP_ACCESSKEYS_MAILBOX][] = array( +// 'name' => 'accesskey_mailbox_XXXXXXXXXXXXXXXXXXXXXXX', +// 'caption' => _("XXXXXXXXXXXXXXX"), +// 'type' => SMOPT_TYPE_STRLIST, +// 'refresh' => SMOPT_REFRESH_NONE, +// 'posvals' => $my_a_to_z, +// ); + + /*** Load the Access Key Options for the Read Message page into the array ***/ $optgrps[SMOPT_GRP_ACCESSKEYS_READ_MESSAGE] = _("Access Keys For Read Message Screen"); $optvals[SMOPT_GRP_ACCESSKEYS_READ_MESSAGE] = array(); diff --git a/templates/default/page_header.tpl b/templates/default/page_header.tpl index dc469bfd..375847ff 100644 --- a/templates/default/page_header.tpl +++ b/templates/default/page_header.tpl @@ -51,13 +51,21 @@ $options_str = $options_link_default; $search_str = $search_link_default; $help_str = $help_link_default; -$compose_link = makeComposeLink ('src/compose.php?mailbox='.$urlMailbox.'&startMessage='.$startMessage, $compose_str); -$signout_link = makeInternalLink ('src/signout.php', $signout_str, $frame_top); -$address_link = makeInternalLink ('src/addressbook.php', $address_str); -$folders_link = makeInternalLink ('src/folders.php', $folders_str); -$search_link = makeInternalLink ('src/search.php?mailbox='.$urlMailbox, $search_str); -$options_link = makeInternalLink ('src/options.php', $options_str); -$help_link = makeInternalLink ('src/help.php', $help_str); +$compose_link = makeComposeLink('src/compose.php?mailbox=' . $urlMailbox + . '&startMessage=' . $startMessage, + $compose_str, '', $accesskey_menubar_compose); +$signout_link = makeInternalLink('src/signout.php', $signout_str, $frame_top, + $accesskey_menubar_signout); +$address_link = makeInternalLink('src/addressbook.php', $address_str, '', + $accesskey_menubar_addresses); +$folders_link = makeInternalLink('src/folders.php', $folders_str, '', + $accesskey_menubar_folders); +$search_link = makeInternalLink('src/search.php?mailbox='.$urlMailbox, + $search_str, '', $accesskey_menubar_search); +$options_link = makeInternalLink('src/options.php', $options_str, '', + $accesskey_menubar_options); +$help_link = makeInternalLink('src/help.php', $help_str, '', + $accesskey_menubar_help); ?> > diff --git a/templates/default_advanced/page_header.tpl b/templates/default_advanced/page_header.tpl index 185a6744..dfd431b7 100644 --- a/templates/default_advanced/page_header.tpl +++ b/templates/default_advanced/page_header.tpl @@ -51,13 +51,21 @@ $options_str = $options_link_default; $search_str = $search_link_default; $help_str = $help_link_default; -$compose_link = makeComposeLink ('src/compose.php?mailbox='.$urlMailbox.'&startMessage='.$startMessage, $compose_str); -$signout_link = makeInternalLink ('src/signout.php', $signout_str, $frame_top); -$address_link = makeInternalLink ('src/addressbook.php', $address_str); -$folders_link = makeInternalLink ('src/folders.php', $folders_str); -$search_link = makeInternalLink ('src/search.php?mailbox='.$urlMailbox, $search_str); -$options_link = makeInternalLink ('src/options.php', $options_str); -$help_link = makeInternalLink ('src/help.php', $help_str); +$compose_link = makeComposeLink('src/compose.php?mailbox=' . $urlMailbox + . '&startMessage=' . $startMessage, + $compose_str, '', $accesskey_menubar_compose); +$signout_link = makeInternalLink('src/signout.php', $signout_str, $frame_top, + $accesskey_menubar_signout); +$address_link = makeInternalLink('src/addressbook.php', $address_str, '', + $accesskey_menubar_addresses); +$folders_link = makeInternalLink('src/folders.php', $folders_str, '', + $accesskey_menubar_folders); +$search_link = makeInternalLink('src/search.php?mailbox='.$urlMailbox, + $search_str, '', $accesskey_menubar_search); +$options_link = makeInternalLink('src/options.php', $options_str, '', + $accesskey_menubar_options); +$help_link = makeInternalLink('src/help.php', $help_str, '', + $accesskey_menubar_help); ?> >