Bug #16641
closedThe "click-to-enlarge" function of the image content element does not provide scrollbars to the new window.
0%
Description
This concerns the "click-to-enlarge" function of the "image" content element as well as the "text+image" content element. The issue is that the script "class.tslib_content.php" does not provide the opportunity to activate scrollbars to the picture window. The window that opens on a click is not scrollable if the picture is large as the screen size!
This concerns all versions of Typo3 starting from 3.6 (the oldest I tried) and up to the latest 4.0.2
Suggested solution:
First, let's introduce two more parameters to define the window width and height and a third parameter which contains the options for the window (i.e. "scrollable=..." and so on). They are configurable by TypoScript. Therefore insert the following code six lines beneath "if ($conf['JSwindow'])" into the function "imageLinkWrap($string,$imageFile,$conf)":
if ($conf['window_width']) {
$dims[0] = $conf['window_width'];
}
if ($conf['window_height']) {
$dims[1] = $conf['window_height'];
}
if ($conf['JSwindow.']['parameter']) {
$windowparams = $conf['JSwindow.']['parameter'];
}
Then, change the line
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;').
(which is some lines beneath the above) to
htmlspecialchars('openPic(\''.$url.'\',\''.($conf['JSwindow.']['newWindow']?md5($url):'thePicture').'\',\'width='.($dims0+$offset0).',height='.($dims1+$offset1).','.$windowparams.'\'); return false;').
(issue imported from #M4382)
Files