Project

General

Profile

Bug #14566 ยป 0000828-ilw_replacement.txt

Administrator Admin, 2005-02-22 12:00

 
function imageLinkWrap($string,$imageFile,$conf) {
$a1='';
$a2='';
$content=$string;
if ($this->stdWrap($conf['enable'],$conf['enable.'])) {
$content=$this->typolink($string, $conf['typolink.']);
// imageFileLink:
if ($content==$string && @is_file($imageFile)) {
$params = '';
if ($conf['width']) {$params.='&width='.rawurlencode($conf['width']);}
if ($conf['height']) {$params.='&height='.rawurlencode($conf['height']);}
if ($conf['effects']) {$params.='&effects='.rawurlencode($conf['effects']);}
if ($conf['sample']) {$params.='&sample=1';}
if ($conf['alternativeTempPath']) {$params.='&alternativeTempPath='.rawurlencode($conf['alternativeTempPath']);}

if ($conf['bodyTag']) {$params.='&bodyTag='.rawurlencode($conf['bodyTag']);}
if ($conf['title']) {$params.='&title='.rawurlencode($conf['title']);}
if ($conf['wrap']) {$params.='&wrap='.rawurlencode($conf['wrap']);}

$md5_value = md5($imageFile.'|'.$conf['width'].'|'.$conf['height'].'|'.$conf['effects'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'].'|');

$params.= '&md5='.$md5_value;
$url = $GLOBALS['TSFE']->absRefPrefix.'showpic.php?file='.rawurlencode($imageFile).$params;
if ($conf['JSwindow.']['altUrl'] || $conf['JSwindow.']['altUrl.']) {
$altUrl = $this->stdWrap($conf['JSwindow.']['altUrl'], $conf['JSwindow.']['altUrl.']);
if ($altUrl) {
$url=$altUrl;
}
}

if ($conf['JSwindow']) {
$gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
$gifCreator->init();
$gifCreator->mayScaleUp = 0;
$dims = $gifCreator->getImageScale($gifCreator->getImageDimensions($imageFile),$conf['width'],$conf['height'],'');
$offset = t3lib_div::intExplode(',',$conf['JSwindow.']['expand'].',');
$jsurl = htmlspecialchars('openPic(\''.$GLOBALS['TSFE']->baseUrlWrap($url).'\',\''.($conf['JSwindow.']['newWindow']?md5($url):'thePicture').'\',\'width='.($dims[0]+$offset[0]).',height='.($dims[1]+$offset[1]).',status=0,menubar=0\'); return false;');
$a1='<a href="'.htmlspecialchars($url).'" onclick="'.$jsurl.'" onkeypress="'.$jsurl.'"'.$GLOBALS['TSFE']->ATagParams.'>';
$a2='</a>';
$GLOBALS['TSFE']->setJS('openPic');
} else {
$target = ' target="thePicture"';
if (isset($conf['target'])) {
$target= $conf['target'] ? ' target="'.$conf['target'].'"' : '';
}
$a1='<a href="'.htmlspecialchars($url).'"'.$target.$GLOBALS['TSFE']->ATagParams.'>';
$a2='</a>';
}
$content=$a1.$string.$a2;
}
}

return $content;
}
}
    (1-1/1)