From: pdontthink Date: Thu, 26 Mar 2009 21:05:53 +0000 (+0000) Subject: Fix for accesskey getting set to 'NONE' in somem cases X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c12535f66d320a6054ad7ce89f396b0841ae03fc;p=squirrelmail.git Fix for accesskey getting set to 'NONE' in somem cases git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13453 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/page_header.php b/functions/page_header.php index 31885edd..ecb1aabc 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -172,7 +172,7 @@ EOS; * @param string $target The target frame for this link * @param string $accesskey The access key to be used, if any */ -function makeInternalLink($path, $text, $target='', $accesskey='') { +function makeInternalLink($path, $text, $target='', $accesskey='NONE') { global $base_uri, $oTemplate; // sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); @@ -187,7 +187,9 @@ function makeInternalLink($path, $text, $target='', $accesskey='') { return create_hyperlink($base_uri . $path, $text, $target, '', '', '', '', - (empty($accesskey) ? array() : array('accesskey' => $accesskey))); + ($accesskey == 'NONE' + ? array() + : array('accesskey' => $accesskey))); } /** diff --git a/functions/strings.php b/functions/strings.php index b4b69eba..d582cdc0 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -745,7 +745,7 @@ function quoteimap($str) { * * @since 1.4.2 */ -function makeComposeLink($url, $text = null, $target='', $accesskey='') { +function makeComposeLink($url, $text = null, $target='', $accesskey='NONE') { global $compose_new_win, $compose_width, $compose_height, $oTemplate; @@ -770,7 +770,9 @@ function makeComposeLink($url, $text = null, $target='', $accesskey='') { return create_hyperlink('javascript:void(0)', $text, '', "comp_in_new('$compuri','$compose_width','$compose_height')", '', '', '', - (empty($accesskey) ? array() : array('accesskey' => $accesskey))); + ($accesskey == 'NONE' + ? array() + : array('accesskey' => $accesskey))); } // otherwise, just open new window using regular HTML diff --git a/functions/template/paginator_util.php b/functions/template/paginator_util.php index 24279199..fdff9115 100644 --- a/functions/template/paginator_util.php +++ b/functions/template/paginator_util.php @@ -30,7 +30,9 @@ function get_paginator_link($box, $start_msg, $text, $accesskey='NONE') { sqgetGlobalVar('PHP_SELF',$php_self,SQ_SERVER); return create_hyperlink("$php_self?startMessage=$start_msg&mailbox=$box", $text, '', '', '', '', '', - array('accesskey' => $accesskey)); + ($accesskey == 'NONE' + ? array() + : array('accesskey' => $accesskey))); } @@ -92,20 +94,20 @@ function get_compact_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll, if (($next_grp <= $iTotal) && ($prev_grp >= 0)) { $prv_str = get_paginator_link($box, $prev_grp, '<', ($accesskeys_constructed - ? '' : $accesskey_mailbox_previous)); + ? 'NONE' : $accesskey_mailbox_previous)); $nxt_str = get_paginator_link($box, $next_grp, '>', ($accesskeys_constructed - ? '' : $accesskey_mailbox_next)); + ? 'NONE' : $accesskey_mailbox_next)); } else if (($next_grp > $iTotal) && ($prev_grp >= 0)) { $prv_str = get_paginator_link($box, $prev_grp, '<', ($accesskeys_constructed - ? '' : $accesskey_mailbox_previous)); + ? 'NONE' : $accesskey_mailbox_previous)); $nxt_str = '>'; } else if (($next_grp <= $iTotal) && ($prev_grp < 0)) { $prv_str = '<'; $nxt_str = get_paginator_link($box, $next_grp, '>', ($accesskeys_constructed - ? '' : $accesskey_mailbox_next)); + ? 'NONE' : $accesskey_mailbox_next)); } /* Page selector block. Following code computes page links. */ @@ -120,7 +122,8 @@ function get_compact_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll, } } else { global $accesskey_mailbox_all_paginate; - $pg_str = create_hyperlink("$php_self?showall=0&startMessage=1&mailbox=$box", _("Paginate"), '', '', '', '', '', array('accesskey' => ($accesskeys_constructed ? 'NONE' : $accesskey_mailbox_all_paginate))); + $pg_str = create_hyperlink("$php_self?showall=0&startMessage=1&mailbox=$box", _("Paginate"), '', '', '', '', '', ($accesskeys_constructed ? array() : array('accesskey' => +$accesskey_mailbox_all_paginate))); } /* Put all the pieces of the paginator string together. */ @@ -133,7 +136,7 @@ function get_compact_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll, /* Compute the 'show all' string. */ global $accesskey_mailbox_all_paginate; - $all_str = create_hyperlink("$php_self?showall=1&startMessage=1&mailbox=$box", _("Show All"), '', '', '', '', '', array('accesskey' => ($accesskeys_constructed ? 'NONE' : $accesskey_mailbox_all_paginate))); + $all_str = create_hyperlink("$php_self?showall=1&startMessage=1&mailbox=$box", _("Show All"), '', '', '', '', '', ($accesskeys_constructed ? array() : array('accesskey' => $accesskey_mailbox_all_paginate))); $result .= '[' . get_paginator_link($box, 1, '<<') . ']'; $result .= '[' . $prv_str . ']'; @@ -234,20 +237,20 @@ function get_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll,$page_sel if (($next_grp <= $iTotal) && ($prev_grp >= 0)) { $prv_str = get_paginator_link($box, $prev_grp, _("Previous"), ($accesskeys_constructed - ? '' : $accesskey_mailbox_previous)); + ? 'NONE' : $accesskey_mailbox_previous)); $nxt_str = get_paginator_link($box, $next_grp, _("Next"), ($accesskeys_constructed - ? '' : $accesskey_mailbox_next)); + ? 'NONE' : $accesskey_mailbox_next)); } else if (($next_grp > $iTotal) && ($prev_grp >= 0)) { $prv_str = get_paginator_link($box, $prev_grp, _("Previous"), ($accesskeys_constructed - ? '' : $accesskey_mailbox_previous)); + ? 'NONE' : $accesskey_mailbox_previous)); $nxt_str = _("Next"); } else if (($next_grp <= $iTotal) && ($prev_grp < 0)) { $prv_str = _("Previous"); $nxt_str = get_paginator_link($box, $next_grp, _("Next"), ($accesskeys_constructed - ? '' : $accesskey_mailbox_next)); + ? 'NONE' : $accesskey_mailbox_next)); } /* Page selector block. Following code computes page links. */ @@ -369,7 +372,8 @@ function get_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll,$page_sel } } else { global $accesskey_mailbox_all_paginate; - $pg_str = create_hyperlink("$php_self?showall=0&startMessage=1&mailbox=$box", _("Paginate"), '', '', '', '', '', array('accesskey' => ($accesskeys_constructed ? 'NONE' : $accesskey_mailbox_all_paginate))); + $pg_str = create_hyperlink("$php_self?showall=0&startMessage=1&mailbox=$box", _("Paginate"), '', '', '', '', '', ($accesskeys_constructed ? array() : array('accesskey' => +$accesskey_mailbox_all_paginate))); } /* Put all the pieces of the paginator string together. */ @@ -382,7 +386,8 @@ function get_paginator_str($box, $iOffset, $iTotal, $iLimit, $bShowAll,$page_sel /* Compute the 'show all' string. */ global $accesskey_mailbox_all_paginate; - $all_str = create_hyperlink("$php_self?showall=1&startMessage=1&mailbox=$box", _("Show All"), '', '', '', '', '', array('accesskey' => ($accesskeys_constructed ? 'NONE' : $accesskey_mailbox_all_paginate))); + $all_str = create_hyperlink("$php_self?showall=1&startMessage=1&mailbox=$box", _("Show All"), '', '', '', '', '', ($accesskeys_constructed ? array() : array('accesskey' => +$accesskey_mailbox_all_paginate))); $result .= '['; $result .= ($prv_str != '' ? $prv_str . $nbsp . $sep . $nbsp : '');