[TYPO3-core] OBTS hook

Bernhard Kraft kraftb at kraftb.at
Tue Apr 11 16:23:26 CEST 2006


Hello,


This is a CVS patch request.


Type: Feature


Branch: 4.1 (can wait till :)


I was wondering if it would be possible to change the "hook" made especially for OBTS of
Dan Frost in "tslib_content::cObjGetSingle" to some more general hook which also other
extensions can use.

Currently it get's checked for t3lib_extMgm::isLoaded('obts') .... So I can either
just name my own plugin which requires to have a new COBJ type "obts" and never put it in
TER ... or do like I do now and ask for a modification :)


Attached is the hook as I would propse it. It leaves the original hook of Dan intact but
just adds another -general- one in front.

The costs are one more if statement which has to get evaluated for each cObjGetSingle call
(if one of the new hooks is set) and little overhead in the "start" method to get the hook
array.

I used a class variable for storing the hook objects as I tought tslib_content is rather instanciated
for a long time (no use-just-a-single-method object) and thus it would be better to instanciate all hook
objects only once.


The hook is set up a little differently than "normal" hooks as not only a class reference is required but
also a cObject name for which this hook is used for.


Example usage in ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'][] = array('COA_MINT', 
'EXT:kb_nntp_if/class.tx_kbnntpif_cobject.php:&tx_kbnntpif_cobject');



greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cObjGetSingle_hook_2006-04-11.diff
Type: text/x-patch
Size: 1814 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060411/83bcc9e1/attachment.bin 


More information about the TYPO3-team-core mailing list