[TYPO3-core] RFC: custom toolbar icons in the Page module
Franz Holzinger
franz at fholzinger.com
Thu Aug 23 14:24:28 CEST 2007
Hello Dmitry,
>> Description:
>> We needed to extend the tool bar of the page module. the best way to
>> assure this is providing a hook which doesn't exist right now. A patch for
>> this is provided. In this way extension icons can be registered.
>> Branches: Trunk 4.2
>
> I like the idea in general but it will be problematic to alter toolbar
> if anyone wants so. For example, how do you remove edit icons?
> foreach+strpos() for edit command? Ineffective and complex.
>
> I guess $toolBarArray should not take texts but structures. Something like:
>
> $toolBarArray[] = array(
> 'action' => 'edit',
> 'icon' => array(
> 'src' => 'edit.gif',
> 'width' => 10,
> 'height' => 20,
> 'title' => 'bum!',
> 'attrs' => 'hspace="2"',
> ),
> 'link' => array(
> 'url' => 'edit.php',
> 'onclick' => 'alert("Bum!")',
> 'title' => 'Click to BUM!',
> ),
> );
>
> And later it should be combined into a real string. This way anyone can
> do whatever he wants:
> - remove command completely (by looking at 'action' field)
> - change icon
> - perform extra javascript processing
> - etc
>
> More complex but more usable. What do you think?
I have written a new patch which gives you more enhanced flexibility for the
future. Maybe parts of this code could be used also with arrays coming from
TypoScript or anything similar, so I have use the $tmp['a.'] array notation.
I will rewrite the API documentation on the wiki when the code has been
approved.
- Franz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pageToolbar.diff
Type: text/x-patch
Size: 8894 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070823/4feb9eb5/attachment.bin
More information about the TYPO3-team-core
mailing list