Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source MagazineAOE Media

1.3. Adminstration

If you want users to be able to override accesskeys manually, install gov_accesskey. The user will be able to override the accesskey per page.

To use the accessibility features for some menu, install the cron_autoaccesskeys extention and add a call to “user_cronaccessiblemenus->makeAccessible” on the TMENU's IProcFunc. Activate the .dfn or .accessKeys feature as you like.

EXAMPLE

Generates a nested list menu:

temp.listMenu = TMENU
temp.listMenu {
  wrap = <ul> | </ul>
  noBlur = 1

  IProcFunc = user_cronaccessiblemenus->makeAccessible

  IProcFunc.accessKeys = 1

  IProcFunc.dfn = 1

  NO {

    allWrap = <li> | </li>
    stdWrap.htmlSpecialChars = 1
  }
  ACT = 1
  ACT {
    wrapItemAndSub = <li class="act"> | </li>
    stdWrap.htmlSpecialChars = 1
  }
  RO = 0
}

This will generate a menu. Each A-Tag will get an “accesskey”. First the accesskey from gov_accesskey will get used. If this is empty (“”), the cron_autoaccesskey extention will generate the accesskey on its own. Each item will be prepended with a <dfn> tag with the current nesting level.

Upgrading from cron_autoaccesskeys

If you use cron_autoaccesskeys, this extention will replace that one. To upgrade, just install the new extention and change your menu's in your TypoScript template:

Before (with cron_autoaccesskeys):

  IProcFunc = user_cronautoaccesskeys->addAccessKeys

After (with cron_accessiblemenus):

  IProcFunc = user_cronaccessiblemenus->makeAccessible

  IProcFunc.accessKeys = 1

  IProcFunc.dfn = 1

Hook

The makeAccessible function can be extented by other extentions using the included hook.

  1. Create a function that will transform the menuArray (and return it!)

  2. Add a hook to cron_accessiblemenus:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/cron_accessiblemenus/class.user_cronaccessiblemenus.php']['makeAccessible']) = <function>

Your function will be called with one parameter only: an array with a 'cObj' item, which will be a reference to the calling object. This will have a property called 'menuArray' and another called 'conf', with which you can work with. Don't forget to return the (possible transformed) menuArray!

Example: This will do nothing at all:

function user_AccessibleMenu { $parms}  {
  return $parms['cObj']->menuArray;
}