[TYPO3-core] RFC: custom toolbar icons in the Page module
Dmitry Dulepov [typo3]
dmitry at typo3.org
Mon Aug 20 10:50:02 CEST 2007
Hi!
Franz Holzinger wrote:
> This is a SVN patch request.
> Type: New feature
> 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.
> Detailed:
> For the editor a direct-mail icon had to be provided on the page module
> tool-bar. So the page could directly sent to the fetch function of
> Direct Mail.
> So there is now a hook for integrating own extension icons or even
> modifying the existing ones.
> 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?
--
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
More information about the TYPO3-team-core
mailing list