[TYPO3-german]Auf Klick vergrößern in PHP Script

JoH info at cybercraft.de
Sun Mar 5 15:55:56 CET 2006


> Wer sucht der findet. Hier für alle zum nachlesen:
>
> if($GLOBALS['TSFE']->sys_language_uid == 0) {
> $alt = "Zum Vergrößern des Bildes klicken";
> }elseif($GLOBALS['TSFE']->sys_language_uid == 1) {
> $alt = "Click to enlarge the image";
> }elseif($GLOBALS['TSFE']->sys_language_uid == 2) {
> $alt = "Cliquez ici pour agrandir l'image";
> }
>
> $string = '<img src="www.123.de/'.$img.'.jpg" border="0"
> alt="'.$alt.'">'; $imageFile =
> 'fileadmin/df-stables.com/spots/'.$img.'_big.jpg';
>
> $info = getimagesize($imageFile);
>
> //imageLinkWrap Configuration:
> $conf['bodyTag'] = '<body bgColor=white leftmargin="0" topmargin="0"
> marginwidth="0" marginheight="0">';
> $conf['wrap'] = '<a href="javascript: close();"> | </a>';
> $conf['width'] = $info[0];
> $conf['height'] = $info[1] ;
> $conf['JSwindow'] = '1';
> $conf['JSwindow.newWindow'] = '0';
> $conf['JSwindow.expand'] = '0,0';
> $conf['title'] = 'df-stables.com';
> $conf['enable'] = '1';
>
>
> $obj = new tslib_cObj();
> $res = $obj->imageLinkWrap($string,$imageFile,$conf);
> return $res;

Und jetzt erklär mir mal, warum Du das in PHP hardcodest anstatt es in Dein
TypoScript Template zu schreiben.
Im Prinzip machst Du hier nämlich nichts anderes, als das TypoScript zu
simulieren, das sonst in $conf übergeben worden wäre.
Mit dem kleinen Unterschied, daß bei Deiner Lösung jeder mit dem leben muß,
was Du vorgibst, während "echtes" TypoScript es dem Admin überlässt, das bei
Bedarf anzupassen.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de





More information about the TYPO3-german mailing list