Fix minor glitch with menu access keys. Pass on access key of menu items to IProcFunc.
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Mon, 8 Oct 2007 20:15:47 +0000 (20:15 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Mon, 8 Oct 2007 20:15:47 +0000 (20:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2541 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_menu.php

index cbc9b13..70912c9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+
+2007-10-08  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Fix minor glitch with menu access keys
+       * Pass on access key of menu items to IProcFunc
+
 2007-10-08  Oliver Hader  <oh@inpublica.de>
 
        * (minor) Fixed bug #6032: Freeing SQL result sets (post patch)
index cebac46..c914be0 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -1433,13 +1433,15 @@ class tslib_menu {
                        // The global array ACCESSKEY is used to globally control if letters are already used!!
                $result = Array();
 
+               $title = trim($title);
                $titleLen = strlen($title);
                for ($a=0;$a<$titleLen;$a++)    {
-                       $key = strtoupper(trim(substr($title,$a,1)));
-                       if (preg_match('/[a-zA-Z]/', $key) && !isset($GLOBALS['TSFE']->accessKey[$key]))        {
-                               $GLOBALS['TSFE']->accessKey[$key]=1;
+                       $key = strtoupper(substr($title,$a,1));
+                       if (preg_match('/[A-Z]/', $key) && !isset($GLOBALS['TSFE']->accessKey[$key]))   {
+                               $GLOBALS['TSFE']->accessKey[$key] = 1;
                                $result['code'] = ' accesskey="'.$key.'"';
                                $result['alt'] = ' (ALT+'.$key.')';
+                               $result['key'] = $key;
                                break;
                        }
                }