Bug #16641

The "click-to-enlarge" function of the image content element does not provide scrollbars to the new window.

Added by Gernot Krause over 14 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2006-10-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

bug_0004382.diff (807 Bytes) bug_0004382.diff Administrator Admin, 2006-10-15 21:49
scrollbars.patch (1.02 KB) scrollbars.patch Administrator Admin, 2007-10-16 17:05

Related issues

Related to TYPO3 Core - Feature #21302: click enlarge: popup window params are hardcodedClosed2009-10-19

Actions
#1

Updated by Michael Stucki over 14 years ago

I don't see a patch here...

#2

Updated by Gernot Krause over 14 years ago

I just wanted to ask the developers to insert that code into the script to make the system better and more functional. Is it possible to implement that code with the next release of typo3?

#3

Updated by Graham Solomon over 14 years ago

Hi Gernot, I think what Michael is saying is there is no way for the devs to apply your patch as we do not know where to apply the code you submitted, you should submit a patch in the form of a diff for the developers to work with, you should find the url's below helpful for learning how todo this.

Resolving a bug...
http://typo3.org/teams/bug-fixing/writing-patches/

Bug tracker podcast...
http://castor.t3o.punkt.de/files/podkast_bugtracker.m4v

#4

Updated by Gernot Krause over 14 years ago

I uploaded the diff-file for my suggestion. It should be applied to "class.tslib_content.php" in typo3_src/typo3/sysext/cms/tslib/.
Thank you very much for your help!

#5

Updated by Michael Stucki over 14 years ago

The patch misses a context, you can enable this using the "-u" parameter when running "diff". But anyway, I wonder why you have dropped the call of baseUrlWrap()? Did you just forget it?

After all I don't like this solution very much because it seems so static to me. On an 800x600 screen the scrollbars are needed much sooner than with a higher resolution.

Since I remember that there is a possibility to find this out using JavaScript, I would prefer such a solution much more. And you?

#6

Updated by Gernot Krause over 14 years ago

I think I just forget the baseUrlWrap(). It should be inserted again!

I am not a developer or a programmer, so I don't know what is static or not static. Sorry for that. I am just an admin for typo3 sites. And as an admin I missed the scrollbars when opening a new picture window. I need the scrollbars for example for showing my visiters picture in panorama format, which is twice the screen size or more (even in high resolution). Without screenbars the visitor can't see the whole picture.

As I understand the "click-to-enlarge" function, when clicking on an image the javascript function "openPic(url,winName,winParams)" is called which creates a new window via "window.open(url,winName,winParams)". The last parameter are the options for the new window. The "class.tslib_content.php" script sets this parameter to "status=0,menubar=0". That is static! The admin has no possibility to change this via typoscript or something else. The only solution is to change the code of "class.tslib_content.php".

So the main concern of my report was to point out this problem to the developers. You are right, my suggested solution is the simplest, but that's what I could do in my typo3 installation to solve that problem. Perhaps the developers could find a more sophisticated solution to make the window parameters configurable through typoscript. Maybe it is also possible to introduce a new field or butten next to the "click-to-enlarge" box in the BE which provides these options?

What do you think?

PS: Perhaps I am wrong here with my question, because it is no real bug!? I also submitted this question to the typo3-dev mailinglist, but until now nobody answered to that question.

#7

Updated by Markus Wagner about 14 years ago

Any news on this? I do have the same problem here. Will this issue be fixed in the near future?

#8

Updated by Dmitry Dulepov over 13 years ago

I made a patch only to add scrollbars if necessary and submitted the issue to core list for approval.

#9

Updated by Dmitry Dulepov over 12 years ago

I will remove assignment to me. I do not want this bug to stay on me indefinitely.

#10

Updated by Valery Romanchev about 11 years ago

this problem can be fixed in most cases by TS like this
tt_content.image.20.1.imageLinkWrap.bodyTag = <style type="text/css">html{overflow-x: hidden;overflow-y: auto;}</style><body style="margin:0; background:#fff;">
tt_content.textpic.20.1.imageLinkWrap.bodyTag < tt_content.image.20.1.imageLinkWrap.bodyTag

#11

Updated by Valery Romanchev about 11 years ago

related to #12270

#12

Updated by Alexander Opitz over 7 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)
  • TYPO3 Version set to 4.0

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?

#13

Updated by Alexander Opitz over 7 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Also available in: Atom PDF