Bug #20868 ยป 0011695.diff
sysext/cms/ext_localconf.php (working copy) | ||
---|---|---|
$TYPO3_CONF_VARS['SYS']['contentTable'] = 'tt_content';
|
||
$TYPO3_CONF_VARS['FE']['eID_include']['tx_cms_showpic'] = 'EXT:cms/tslib/showpic.php';
|
||
$TYPO3_CONF_VARS['EXTCONF']['tx_cms_showpic']['templateKeys']['DEFAULT'] = 'EXT:cms/tslib/templates/tx_cms_showpic.html';
|
||
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['cms'] = array(
|
||
'title' => 'CMS Frontend',
|
sysext/cms/tslib/templates/tx_cms_showpic.html (revision 0) | ||
---|---|---|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<title>###TITLE###</title>
|
||
###META###
|
||
</head>
|
||
<body>
|
||
<a href="javascript:window.close();">###IMAGE###</a>
|
||
</body>
|
||
</html>
|
sysext/cms/tslib/class.tslib_content.php (working copy) | ||
---|---|---|
if ($conf['bodyTag']) {$params.='&bodyTag='.rawurlencode($conf['bodyTag']);}
|
||
if ($conf['title']) {$params.='&title='.rawurlencode($conf['title']);}
|
||
if ($conf['wrap']) {$params.='&wrap='.rawurlencode($conf['wrap']);}
|
||
if ($conf['windowTemplateKey']) {$params.='&windowTemplateKey='.rawurlencode($conf['windowTemplateKey']);}
|
||
$md5_value = md5(
|
||
$imageFile.'|'.
|
||
... | ... | |
$conf['bodyTag'].'|'.
|
||
$conf['title'].'|'.
|
||
$conf['wrap'].'|'.
|
||
$conf['windowTemplateKey'].'|'.
|
||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'].'|');
|
||
$params.= '&md5='.$md5_value;
|
sysext/cms/tslib/showpic.php (working copy) | ||
---|---|---|
var $bodyTag;
|
||
var $title;
|
||
var $wrap;
|
||
var $md5;
|
||
var $windowTemplateKey;
|
||
var $md5;
|
||
/**
|
||
* Init function, setting the input vars in the global space.
|
||
... | ... | |
$this->bodyTag = t3lib_div::_GP('bodyTag');
|
||
$this->title = t3lib_div::_GP('title');
|
||
$this->wrap = t3lib_div::_GP('wrap');
|
||
$this->windowTemplateKey = t3lib_div::_GP('windowTemplateKey');
|
||
$this->md5 = t3lib_div::_GP('md5');
|
||
|
||
// ***********************
|
||
// Check parameters
|
||
... | ... | |
$this->bodyTag.'|'.
|
||
$this->title.'|'.
|
||
$this->wrap.'|'.
|
||
$this->windowTemplateKey.'|'.
|
||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'].'|');
|
||
if ($md5_value!=$this->md5) {
|
||
... | ... | |
$this->width = t3lib_div::intInRange($this->width,0);
|
||
if ($this->frame) {$this->frame = intval($this->frame);}
|
||
$imgInfo = $img->imageMagickConvert($this->file,'web',$this->width.$max,$this->height,$img->IMparams($this->effects),$this->frame,'');
|
||
// Create HTML output:
|
||
$this->content='';
|
||
$this->content.='
|
||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<title>'.htmlspecialchars($this->title ? $this->title : "Image").'</title>
|
||
' . ($this->title ? '' : '<meta name="robots" content="noindex,follow" />') . '
|
||
</head>
|
||
'.($this->bodyTag ? $this->bodyTag : '<body>');
|
||
|
||
$imageHTML = '';
|
||
if (is_array($imgInfo)) {
|
||
$wrapParts = explode('|',$this->wrap);
|
||
$this->content.=trim($wrapParts[0]).$img->imgTag($imgInfo).trim($wrapParts[1]);
|
||
$imageHTML = trim($wrapParts[0]).$img->imgTag($imgInfo).trim($wrapParts[1]);
|
||
}
|
||
$this->content.='
|
||
</body>
|
||
</html>';
|
||
$titleHTML = htmlspecialchars($this->title ? $this->title : "Image");
|
||
$metaHTML = ($this->title ? '' : '<meta name="robots" content="noindex,follow" />');
|
||
|
||
if ($this->windowTemplateKey && !empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tx_cms_showpic']['templateKeys'][$this->windowTemplateKey])) {
|
||
|
||
$fullFileName = t3lib_div::getFileAbsFileName($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tx_cms_showpic']['templateKeys'][$this->windowTemplateKey]);
|
||
|
||
$this->content = file_get_contents($fullFileName);
|
||
|
||
$search = array(
|
||
'###TITLE###',
|
||
'###META###',
|
||
'###IMAGE###'
|
||
);
|
||
$replace = array(
|
||
$titleHTML,
|
||
$metaHTML,
|
||
$imageHTML
|
||
);
|
||
|
||
$this->content = str_replace($search,$replace,$this->content);
|
||
|
||
} else {
|
||
// Create HTML output:
|
||
$this->content='';
|
||
$this->content.='
|
||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
||
<html>
|
||
<head>
|
||
<title>'.$titleHTML.'</title>
|
||
' . $metaHTML . '
|
||
</head>
|
||
'.($this->bodyTag ? $this->bodyTag : '<body>').'
|
||
'.$imageHTML.'
|
||
</body>
|
||
</html>';
|
||
}
|
||
}
|
||
/**
|