[TYPO3-core] RFC: Another hook request for db_list (#6738)

Ingo Renner ingo at typo3.org
Sat Nov 17 21:08:13 CET 2007


Bernhard Kraft wrote:
> Hi !
> 
> 
> This is an SVN patch request
> 
> 
> Bugtracker:
> http://bugs.typo3.org/view.php?id=6738
> 
> 
> Problem:
> In Web>List Extended view (when you are not using the clickmenu but have
> secondary options enabled using the checkbox at the bottom) there are quite
> a lof of icons now.
> 
> In T3 3.8.0 there was no "versions" icon - and AFAIR also some other icons
> havent been there.
> 
> It should be possible to modify/remove/add icons for each record.
> 
> 
> 
> Solution:
> The included patch (also in bugtracker) allows a hook-method/extension to
> modify the list of icons displayed for the control
> (View / Edit / Move / Delete / History / Version / Hide )
> and the list of icons for the clipboard
> (Copy / Cut / Paste)
> to get modified / removed / added.
> 
> I modified the $cells array of the calling methods (makeClip and 
> makeControl)
> in such a way that each element has an array-index now and can easily 
> get accessed
> by the hook-class/method.
> 
> I followed the style of Ingmar to create an interface class.

I know Ingo and Ingmar is very similar ;-)

* please rename t3lib_localRecordList_makeClip to 
t3lib_localRecordList_makeClipHook and also the file accordingly, this 
will make sure that one can find them easier as I hope to introduce more 
interfaces not only for hooks where it makes sense.

* here both mehtods concern one task (do they really do?) so that I'd 
put them into a single interface

* $cells['view_big'] => $cells['viewBig'], $cells['move_up'] => 
$cells['moveUp'], $cells['move_down'] => $cells['moveDown'], ...

* the second parameter in throw new Exception should be the current unix 
timestamp at the time you wrote that time (roughly) This will make sure 
to easily find the place where the exception was thrown (apart from the 
stack trace) as it seems to be unlikely that two devs will create a hook 
at the exact same second. The timestamp you used is from Thursday ...

* wouldn't it be better/cleaner/easier to understand if the methods 
wouldn't change the $cells array through a reference and instead return 
a new one (or in case they do not implement both methods they'd just 
return the original without change)

* when making it possible to change these icons/actions I'd like to also 
see another method:

There's an extension from Michael Feinbier that adds such an action to 
ve_guestbook comments to (un)mark them as spam and report them to some 
webservice by using an xclass. Now clicking each spam comment is a 
tedious task. When switching to clipboard 1 f.e. you get checkboxes to 
mark multiple records so that you can copy them all at a single click on 
the copy icon on top of the table.

So it would be just consequent to be able to add actions up there, too. 
Get what I mean?


other then that the patch looks good and will get my +1 after those changes.

Ingo


-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list