[TYPO3-dev] I don't understand the documentation for creating hooks
tapio
tapio.markula at dnainternet.net
Wed Mar 8 09:38:27 CET 2006
Rico Moorman wrote:
> I think a hook on the suggested place could be really helpful or maybe
> also inside the function recordEditAccessInternals()
>
> Did you get already some response about it tapio?
No. The place is ok. I found also another pages, which explains hooks.
They were a little bit better (several pages instead of one big).
The hook might be like
}
$_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);
}
}
and in ext_localconf.php something like
$GLOBALS
['TYPO3_CONF_VARS']['EXTCONF']['tm_contentaccess']['hasAccess'][] =
'EXT:tm_contentaccess/class.tx_tm_contentaccess.php:tx_tm_contentaccess';
But I didn't get further. The existing functionality, which I add seems
to be reasonable to keep as such.
If I would put it into a separate page, I have difficulties to get
necessary variables. All variable except the field information base
on processed data in the function, where the check below exists.
// Check internals regarding access:
if ($hasAccess) {
$hasAccess = $BE_USER->recordEditAccessInternals($table,
$calcPRec);
if($hasAccess==1)
{
if($BE_USER->user['admin']==0 && $calcPRec['editlock']==1)
$hasAccess=0;
}
if($hasAccess==1){
/*
hook here - just any extension, that could have condition(s) to turn
from $hasAccess=1 to $hasAccess=0
*/
}
$deniedAccessReason = $BE_USER->errorMsg;
}
} else $hasAccess = 0;
More information about the TYPO3-dev
mailing list