[TYPO3] I don't understand the documentation concerning hooks

tapio tapio.markula at dnainternet.net
Sat Mar 4 16:54:38 CET 2006


Hi

Sometimes explations are really awfull:

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/current/view/3/4/

*TOO MUCH*
1 ...

2  ...

3 ...



Extremely difficult to catch what to do. Not a good instruction.
I have *VERY BIG DIFFICULTIES TO UNDERSTAND HOOK EXPLANATIONS*
I have seldom this kind of difficulties but this is really one of the 
explanations, which I have have serious difficulties to understand.

I have spend many hours tryin to understand the document. Frustrating - 
because the documentation is visually messy. It is simple too difficult 
for me and I would like someone to help understanding how to create hooks.
	
Here my trial for class.ux_sc_alt_doc.php

/*

$TYPO3_CONF_VARS['EXTCONF'][ extension_key ][ sub_key ] = value
$TYPO3_CONF_VARS['EXTCONF']['tm_contentaccess']['hasAccess'] = value

  $_procObj = array();
if(is_array($TYPO3_CONF_VARS['EXTCONF']['tm_contentaccess']['hasAccess'])) 
    {
foreach ($TYPO3_CONF_VARS['EXTCONF']['tm_contentaccess']['hasAccess'] as 
$hasAccessControl) {
	 $_procObj = &t3lib_div::getUserObj($hasAccessControl);			
}
}

ext_localconf.php
require_once(t3lib_extMgm::extPath('tm_contentaccess').'class.tx_tm_contentaccess.php');
$TYPO3_CONF_VARS['EXTCONF']['tm_contentaccess']['hasAccess'][] = 
'tx_tm_contentaccess->hasAccess';

$GLOBALS 
['TYPO3_CONF_VARS']['EXTCONF']['tm_contentaccess']['hasAccess'][] = 
'EXT:tm_contentaccess/class.tx_tm_contentaccess.php:tx_tm_contentaccess';

				$hookObjectsArr = array();
		if (is_array 
($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'])) 
{
			foreach 
($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] 
as $classRef) {
				$hookObjectsArr[] = &t3lib_div::getUserObj($classRef);
			}
*/






                                         // Check internals regarding 
access:
                                     if ($hasAccess)    {
                                         $hasAccess = 
$BE_USER->recordEditAccessInternals($table, $calcPRec);
                                         if($hasAccess==1)
                                             {

/*********** I would like this to use a hook - starts **************/
 
if($BE_USER->user['admin']==0 && $calcPRec['editlock']==1)
                                             $hasAccess=0;


/*********** I would like this to use a hook - ends **************/
                                             }

                                         $deniedAccessReason = 
$BE_USER->errorMsg;
                                     }



More information about the TYPO3-english mailing list