[TYPO3-dev] Suggestion to optimize the "click-to-enlarge" option of the image content element

Gernot Krause gernot at novemberlicht.de
Thu Oct 12 21:01:36 CEST 2006


Hi!
 
I would like to suggest some little changes to "class.tslib_content.php"
that introduces a few more options to the "click-to-enlarge" function of
the "image" content (as well as "text+image"). This concerns all
versions of Typo3 starting from 3.6 (the oldest I tried) up to the
latest 4.0.2.
 
Problem:
I often put pictures on a website that are in panorama format. I then
activate the "click-to-enlarge" option to give the user the oppotunity
to view the picture in real size. But the real size is mostly large than
the screen size due to the panorama format. The issue is that the script
"class.tslib_content.php" does not provide the opportunity to activate
scrollbars to the picture window. So the user can't scroll the panorama
picture.
 
Suggestion:
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,menub
ar=0\'); return false;').
 
(which is some lines beneath the above) to
 
 
htmlspecialchars('openPic(\''.$url.'\',\''.($conf['JSwindow.']['newWindo
w']?md5($url):'thePicture').'\',\'width='.($dims[0]+$offset[0]).',height
='.($dims[1]+$offset[1]).','.$windowparams.'\'); return false;').
 
What do you think about these changes? My Typo3 runs well with this and
I can configure the picture window which scrollbars and can make it
resizeable and so on.
 
Regards,
Gernot Krause.





More information about the TYPO3-dev mailing list