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

Cornelius Herzog typo3 at corneliusherzog.de
Sun Mar 5 19:18:27 CET 2006


Hallo Joey,

Ich hab nicht die ganze class gepostet. Da werden nämlich noch ein paar
andere sachen mit den bildern gemacht und bei denen wüsste ich net wie das
in ts geht.

Grüße

Cornelius

-----Ursprüngliche Nachricht-----
Von: typo3-german-bounces at lists.netfielders.de
[mailto:typo3-german-bounces at lists.netfielders.de] Im Auftrag von JoH
Gesendet: Sonntag, 5. März 2006 15:56
An: typo3-german at lists.netfielders.de
Betreff: Re: [TYPO3-german]Auf Klick vergrv_ern in PHP Script


> 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