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

1.6. Hooks

I added hooks for access of content elements. Put the following hook call into ext_localconf.php:

  1. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['recordAccess'][]='EXT:my_plugin_name/class.my_class_file_class_name.php:my_class_file_class_name';

  2. Create related class-file and define class and class method (function) inside it.

  3. Define the function 'recordAccess' so, that it returns true or false.

This function has been handled last and it will take precedence over other conditions.

Added hooks also for frontend editing. Every section of the frontend menu can extend using following hooks (just return the desired content ant the end of each class method):

  1. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['addPageItems']

  2. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['addContentItems']

  3. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['addMediaItems']

  4. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['addAdvancedItems']

  5. $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TM_CONTENTACCESS_EXTkey]['addMiscellanaeousItems']

These functions get two parameters. First id of the page and second variable to control with TS configuration for users/user groups if new item is visible or not. Then as default new item is not visible,

for example.

Function addPageItems($id,$enableToolbarButtons) {

if(isset($enableToolbarButtons['myItem'])) {

...

}

}

This needs to be in mod.FE_BE.enableSpecialToolbarButtons=...,myItem.