Feature #14564

Hooks in t3lib_tcemain::process_cmdmap (with patch)

Added by Tim Franz over 10 years ago. Updated almost 9 years ago.

Status:Closed Start date:2005-02-21
Priority:Should have Due date:
Assigned To:Michael Stucki % Done:

0%

Category:- Spent time: -
Target version:-
PHP Version: Sprint Focus:
Complexity:

Description

It would be nice to have also hooks in t3lib_tcemain::process_cmdmap.

In combination with the already existing hook in process_datamap are almost all record-related events in the backend controllable. Not only "new" and "update", but also "delete", "move", "copy" and so on.

I have include a diff against head.

(issue imported from #M823)

0000823-class.t3lib_tcemain.diff Magnifier (1.6 kB) Administrator Admin, 2005-02-21 14:53

0000823-class.t3lib_tcemain.diff Magnifier (1.6 kB) Administrator Admin, 2005-02-24 10:05

History

#1 Updated by Tim Franz over 10 years ago

Forgot to add global $TYPO3_CONF_VARS; as first line of function. Ouch!

#2 Updated by Ingmar Schlecht over 10 years ago

I just had a very quick look at it, but why does the hook have to be implemented independently for every case?

case 'move':
.....
case 'delete':

Can't you just place the hook after the whole switch statement?

cheers,
Ingmar

#3 Updated by Tim Franz over 10 years ago

originally the hook was implemented different for each case to make it cleaner. each case has different parameters to pass (some with $table, some not). and i thought it would be better to have a hook method for each distinct operation.

I have now changed the method signature to contain always $table (and the command). the hook implementor has to watch out which parameters are really useful for his case.

Now I moved the hook out of the switch statement. There are two calls:
processCmdmap_preProcess (before switch)
processCmdmap_postProcess (after switch)

greetings
Tim

#4 Updated by Michael Stucki over 10 years ago

Ingmar, will you add this patch or should I do so?

#5 Updated by Michael Stucki over 10 years ago

We just discussed the hook situation and decided to ask a few things before we add the hook:
- author name
- what is the reason for wishing this hook
- where is it used

Can you send me this information, please (either here or at )

#6 Updated by Tim Franz over 10 years ago

Well, I did not expect the spanish inquisition...

My name is Tim Franz,
the reason for this hook is already in the bug description: the ability to add additional functions to every record related action in the backend.

I am currently developing a bunch of extensions for the chair of finance and banking, university of essen, managing their whole teaching business within the typo3 backend. For that I need kind of a simple workflow.

For example: A staffmember adds a day of unavailability for him (As a calendar record). All other extensions hook into this and check wether this change affects their data. The course schedule extension adds a note about a dropped lecture (if there woud have been one), The staff list adds a note about a dropped consultation hour. A news item is generated and a newsletter prepared and sent.

This all needs the ability to control all actions possible with a record. If a record is deleted, the other extensions should know about that.

I hope this explanation suffices. Otherwise you are welcome to ask more.
But would you now please tell me the need of this information for the progress of TYPO3?

Greetings
Tim

#7 Updated by Michael Stucki over 10 years ago

Thanks Tim for the explanation. I just committed this to CVS HEAD.

Also available in: Atom PDF