Feature #17003
closed
Add the js openPic-function to core-js
Added by Georg Ringer about 17 years ago.
Updated over 10 years ago.
Description
the onclick-popup for Images in Extensions needs the function which is only in FE available if there are any content elements ("Image only", "text with image") present.
So I need to add this script to every extension where I need it
externalisation would also be fine, bug #0002857
function openPic(url,winName,winParams) {
var theWindow = window.open(url,winName,winParams);
if (theWindow) {theWindow.focus();}
}
(issue imported from #M5011)
You could do this by using TypoScript. In your extension you can use $this->cObj->cObjGetSingle(...) or $this->cObj->cImage(...).
See the following specific example...
TypoScript:
plugin.tx_myext_pi1 {
image {
file {
maxW = 100
maxH = 100
}
imageLinkWrap < tt_content.image.20.1.imageLinkWrap
imageLinkWrap.enable >
imageLinkWrap.enable = 1
}
}
Plugin PHP:
$image = $this->cObj->cImage($uploadDir.$imageSrc, $conf['image.']);
Or if you just want the openPic, you can just call
$GLOBALS['TSFE']->setJS('openPic');
The JavaScript code will then be inserted automatically once.
Thanks Oliver for this code lesson! ;)
so if you don't see a need to include the function by default, then please close the bug
georg
Nice to now, thanx Oliver. But for me it is a general problem to have all these javascripts in the head of the html.
We should think about putting all this stuff to a global javascript file.
config.removeDefaultJS = external
works great, but badly just for the blur script. So a general solution for that problem would be nice. (with the layermenus i have a QD hack also published on my website -> riccabona.info probably there is someone around who wants to have a look at it, how to make it a better way ...).
But all in all these are missing features, an not bugs, I think. ;)
@Clemens: You're right... Putting them into a separate JS file would be nice. I could imagine a static JS object that could be configured using JSON.
Please open a new feature-request here in the bugtracker and describe the problem and also add your patch/hack for the layermenus.
- Status changed from New to Needs Feedback
- Target version deleted (
0)
- PHP Version deleted (
4)
As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.
Also available in: Atom
PDF