[TYPO3-core] RFC: #8152: Icons never created when noIconProc=0 and icon is present

Francois Suter fsuter at cobweb.ch
Fri Apr 18 22:11:26 CEST 2008


Hi,

> me again. Using skin image for makeIcon is very easy, adding one line before 
> function call makes it possible:
> 
> $icon = t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],$iconfile,'',1);
> $theRes = t3lib_iconWorks::makeIcon($icon, $string, $user, $protectSection, 
> $absfile, $iconFileName_stateTagged);
> 
> so new patch respect skinning API.

Did you test your patch with the old skin by any chance? It simply 
doesn't work. The error is that when you call 
t3lib_iconWorks::makeIcon() the 5th parameter ($absfile) is still set to 
the value of the icon without skinning. To have the skinned icon as a 
base, $absfile must contain an absolute path calculated with the skinned 
icon path as a base. The enclosed patch corrects this.

But that's not the end of the story. The path to the overlay icons is 
actually hardcoded as $GLOBALS['BACK_PATH'].'gfx/...' in 
t3lib_iconWorks::makeIcon(), so you get the old overlays over the new icons.

To circumvent that I added a new parameter at the end of the parameter 
list when calling t3lib_iconWorks::makeIcon(), which is an alternate 
path to the skinned overlays. It has an empty value by default, which 
makes it then use $GLOBALS['BACK_PATH']. So nothing is broken for all 
other calls to t3lib_iconWorks::makeIcon().

For the call Steffen added it is then a question of guessing the path to 
skin by extracting it from the path of the skin icon, making the 
assumption that the overlays are in a folder called "gfx/" (which I 
suppose they should). This works.

The main question is that making such a change at RC2 is maybe too much, 
although it can be considered a bugfix. It may be wiser to actually 
generate manually the missing icons and included them in t3skin. Then 
again it's a good opportunity to fix that and allow other skin makers to 
  have proper overlays too.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug8152.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080418/55d09867/attachment-0001.txt 


More information about the TYPO3-team-core mailing list