2 /***************************************************************
5 * (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
6 * (c) 2004-2008 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 * A copy is found in the textfile GPL.txt and important notices to the license
18 * from the author is found in LICENSE.txt distributed with these scripts.
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
29 * Displays image selector for the RTE
31 * @author Kasper Skaarhoj <kasper@typo3.com>
32 * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
36 require_once(PATH_t3lib
.'class.t3lib_stdgraphic.php');
37 require_once(PATH_t3lib
.'class.t3lib_basicfilefunc.php');
38 require_once(t3lib_extMgm
::extPath('dam').'class.tx_dam_browse_media.php');
43 * @author Kasper Skaarhoj <kasper@typo3.com>
47 class tx_rtehtmlarea_dam_browse_media
extends tx_dam_browse_media
{
48 var $extKey = 'rtehtmlarea';
52 var $removedProperties = array();
61 var $imgTitleDAMColumn = '';
62 var $classesImageJSOptions;
64 var $sys_language_content;
66 var $buttonConfig = array();
69 * Check if this object should be rendered.
71 * @param string $type Type: "file", ...
72 * @param object $pObj Parent object.
74 * @see SC_browse_links::main()
76 function isValid($type, &$pObj) {
79 $pArr = explode('|', t3lib_div
::_GP('bparams'));
81 if ($type=='rte' && $pObj->button
== 'image') {
90 * Called in SC_browse_links::main() when isValid() returns true;
92 * @param string $type Type: "file", ...
93 * @param object $pObj Parent object.
94 * @return string Rendered content
95 * @see SC_browse_links::main()
97 function render($type, &$pObj) {
98 global $LANG, $BE_USER, $BACK_PATH;
100 $this->pObj
= &$pObj;
102 // init class browse_links
105 switch((string)$this->mode
) {
107 $content = $this->main_rte();
110 // $content = $this->main_rte(1);
126 global $BE_USER,$BACK_PATH,$TYPO3_CONF_VARS;
129 $this->siteUrl
= t3lib_div
::getIndpEnv('TYPO3_SITE_URL');
130 $this->act
= t3lib_div
::_GP('act');
131 $this->expandPage
= t3lib_div
::_GP('expandPage');
132 $this->expandFolder
= t3lib_div
::_GP('expandFolder');
134 // Find RTE parameters
135 $this->bparams
= t3lib_div
::_GP('bparams');
136 $this->editorNo
= t3lib_div
::_GP('editorNo');
137 $this->sys_language_content
= t3lib_div
::_GP('sys_language_content');
138 $this->RTEtsConfigParams
= t3lib_div
::_GP('RTEtsConfigParams');
139 if (!$this->editorNo
) {
140 $pArr = explode('|', $this->bparams
);
141 $pRteArr = explode(':', $pArr[1]);
142 $this->editorNo
= $pRteArr[0];
143 $this->sys_language_content
= $pRteArr[1];
144 $this->RTEtsConfigParams
= $pArr[2];
148 $this->mode
= t3lib_div
::_GP('mode');
154 $this->siteURL
= t3lib_div
::getIndpEnv('TYPO3_SITE_URL'); // Current site url
156 // the script to link to
157 $this->thisScript
= t3lib_div
::getIndpEnv('SCRIPT_NAME');
163 $RTEtsConfigParts = explode(':', $this->RTEtsConfigParams
);
164 $RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc
::getPagesTSconfig($RTEtsConfigParts[5]));
165 $this->thisConfig
= t3lib_BEfunc
::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
166 $this->imgPath
= $RTEtsConfigParts[6];
168 if (is_array($this->thisConfig
['buttons.']) && is_array($this->thisConfig
['buttons.']['image.'])) {
169 $this->buttonConfig
= $this->thisConfig
['buttons.']['image.'];
170 t3lib_div
::loadTCA('tx_dam');
171 if (is_array($this->buttonConfig
['title.']) && is_array($TCA['tx_dam']['columns'][$this->buttonConfig
['title.']['useDAMColumn']])) {
172 $this->imgTitleDAMColumn
= $this->buttonConfig
['title.']['useDAMColumn'];
174 if (is_array($this->buttonConfig
['properties.'])) {
175 if ($this->buttonConfig
['properties.']['removeItems']) {
176 $this->removedProperties
= t3lib_div
::trimExplode(',',$this->buttonConfig
['properties.']['removeItems'],1);
178 if (is_array($this->buttonConfig
['properties.']['class.']) && trim($this->buttonConfig
['properties.']['class.']['default'])) {
179 $this->defaultClass
= trim($this->buttonConfig
['properties.']['class.']['default']);
184 if (is_array($this->thisConfig
['proc.']) && $this->thisConfig
['proc.']['plainImageMode']) {
185 $plainImageMode = $this->thisConfig
['proc.']['plainImageMode'];
186 $this->lockPlainWidth
= ($plainImageMode == 'lockDimensions')?
'true':'false';
187 $this->lockPlainHeight
= ($this->lockPlainWidth ||
$plainImageMode == 'lockRatio' ||
($plainImageMode == 'lockRatioWhenSmaller'))?
'true':'false';
190 if (!$this->imgTitleDAMColumn
) {
191 $this->imgTitleDAMColumn
= 'caption';
194 $this->allowedItems
= explode(',','magic,plain,image,upload');
195 $clientInfo = t3lib_div
::clientInfo();
196 if ($clientInfo['BROWSER'] !== 'opera') {
197 $this->allowedItems
[] = 'dragdrop';
199 if (is_array($this->buttonConfig
['options.']) && $this->buttonConfig
['options.']['removeItems']) {
200 $this->allowedItems
= array_diff($this->allowedItems
,t3lib_div
::trimExplode(',',$this->buttonConfig
['options.']['removeItems'],1));
202 $this->allowedItems
= array_diff($this->allowedItems
,t3lib_div
::trimExplode(',',$this->thisConfig
['blindImageOptions'],1));
205 reset($this->allowedItems
);
206 if (!in_array($this->act
,$this->allowedItems
)) {
207 $this->act
= current($this->allowedItems
);
210 if ($this->act
== 'magic') {
211 if (is_array($this->buttonConfig
['options.']) && is_array($this->buttonConfig
['options.']['magic.'])) {
212 if ($this->buttonConfig
['options.']['magic.']['maxWidth']) $this->magicMaxWidth
= $this->buttonConfig
['options.']['magic.']['maxWidth'];
213 if ($this->buttonConfig
['options.']['magic.']['maxHeight']) $this->magicMaxHeight
= $this->buttonConfig
['options.']['magic.']['maxHeight'];
215 // These defaults allow images to be based on their width - to a certain degree - by setting a high height. Then we're almost certain the image will be based on the width
216 if (!$this->magicMaxWidth
) $this->magicMaxWidth
= 300;
217 if (!$this->magicMaxHeight
) $this->magicMaxHeight
= 1000;
218 } elseif ($this->act
== 'plain') {
219 if ($TYPO3_CONF_VARS['EXTCONF'][$this->extKey
]['plainImageMaxWidth']) $this->plainMaxWidth
= $TYPO3_CONF_VARS['EXTCONF'][$this->extKey
]['plainImageMaxWidth'];
220 if ($TYPO3_CONF_VARS['EXTCONF'][$this->extKey
]['plainImageMaxHeight']) $this->plainMaxHeight
= $TYPO3_CONF_VARS['EXTCONF'][$this->extKey
]['plainImageMaxHeight'];
221 if (is_array($this->buttonConfig
['options.']) && is_array($this->buttonConfig
['options.']['plain.'])) {
222 if ($this->buttonConfig
['options.']['plain.']['maxWidth']) $this->plainMaxWidth
= $this->buttonConfig
['options.']['plain.']['maxWidth'];
223 if ($this->buttonConfig
['options.']['plain.']['maxHeight']) $this->plainMaxHeight
= $this->buttonConfig
['options.']['plain.']['maxHeight'];
225 if (!$this->plainMaxWidth
) $this->plainMaxWidth
= 640;
226 if (!$this->plainMaxHeight
) $this->plainMaxHeight
= 680;
229 if ($this->thisConfig
['classesImage']) {
230 $classesImageArray = t3lib_div
::trimExplode(',',$this->thisConfig
['classesImage'],1);
231 $this->classesImageJSOptions
= '<option value=""></option>';
232 foreach ($classesImageArray as $class) {
233 $this->classesImageJSOptions
.= '<option value="' .$class . '">' . $class . '</option>';
237 // init the DAM object
240 $this->getModSettings();
242 $this->processParams();
244 // Insert the image if we are done
245 $this->imageInsert();
247 // Creating backend template object:
248 $this->doc
= t3lib_div
::makeInstance('template');
249 $this->doc
->docType
= 'xhtml_trans';
250 $this->doc
->backPath
= $BACK_PATH;
252 //$this->getJSCode();
256 * [Describe function...]
260 function rteImageStorageDir() {
261 $dir = $this->imgPath ?
$this->imgPath
: $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_imageStorageDir'];;
266 * [Describe function...]
270 function imageInsert() {
271 global $TCA,$TYPO3_CONF_VARS;
273 if (t3lib_div
::_GP('insertImage')) {
274 $filepath = t3lib_div
::_GP('insertImage');
276 $imgObj = t3lib_div
::makeInstance('t3lib_stdGraphic');
278 $imgObj->mayScaleUp
=0;
279 $imgObj->tempPath
=PATH_site
.$imgObj->tempPath
;
280 $imgInfo = $imgObj->getImageDimensions($filepath);
281 $imgMetaData = tx_dam
::meta_getDataForFile($filepath,'uid,pid,alt_text,hpixels,vpixels,'.$this->imgTitleDAMColumn
.','.$TCA['tx_dam']['ctrl']['languageField']);
282 $imgMetaData = $this->getRecordOverlay('tx_dam',$imgMetaData,$this->sys_language_content
);
284 switch ($this->act
) {
286 if (is_array($imgInfo) && count($imgInfo)==4 && $this->rteImageStorageDir() && is_array($imgMetaData)) {
287 $fI=pathinfo($imgInfo[3]);
288 $fileFunc = t3lib_div
::makeInstance('t3lib_basicFileFunctions');
289 $basename = $fileFunc->cleanFileName('RTEmagicP_'.$fI['basename']);
290 $destPath =PATH_site
.$this->rteImageStorageDir();
291 if (@is_dir
($destPath)) {
292 $destName = $fileFunc->getUniqueName($basename,$destPath);
293 if (isset($TYPO3_CONF_VARS['BE']['fileCreateMask'])) {
294 @chmod
($destName, $TYPO3_CONF_VARS['BE']['fileCreateMask']);
296 @copy
($imgInfo[3],$destName);
298 $cWidth = t3lib_div
::intInRange(t3lib_div
::_GP('cWidth'),0,$this->magicMaxWidth
);
299 $cHeight = t3lib_div
::intInRange(t3lib_div
::_GP('cHeight'),0,$this->magicMaxHeight
);
300 if (!$cWidth) $cWidth = $this->magicMaxWidth
;
301 if (!$cHeight) $cHeight = $this->magicMaxHeight
;
303 $imgI = $imgObj->imageMagickConvert($filepath,'WEB',$cWidth.'m',$cHeight.'m'); // ($imagefile,$newExt,$w,$h,$params,$frame,$options,$mustCreate=0)
305 $fI=pathinfo($imgI[3]);
306 $mainBase='RTEmagicC_'.substr(basename($destName),10).'.'.$fI['extension'];
307 $destName = $fileFunc->getUniqueName($mainBase,$destPath);
308 if (isset($TYPO3_CONF_VARS['BE']['fileCreateMask'])) {
309 @chmod
($destName, $TYPO3_CONF_VARS['BE']['fileCreateMask']);
311 @copy
($imgI[3],$destName);
312 $iurl = $this->siteUrl
.substr($destName,strlen(PATH_site
));
313 $this->imageInsertJS($iurl,$imgI[0],$imgI[1],$imgMetaData['alt_text'],$imgMetaData[$this->imgTitleDAMColumn
],substr($imgInfo[3],strlen(PATH_site
)));
320 if (is_array($imgInfo) && count($imgInfo)==4 && is_array($imgMetaData)) {
321 $iurl = $this->siteUrl
.substr($imgInfo[3],strlen(PATH_site
));
322 $this->imageInsertJS($iurl,$imgMetaData['hpixels'],$imgMetaData['vpixels'],$imgMetaData['alt_text'],$imgMetaData[$this->imgTitleDAMColumn
],substr($imgInfo[3],strlen(PATH_site
)));
330 function imageInsertJS($url,$width,$height,$altText,$titleText,$origFile) {
331 global $TYPO3_CONF_VARS;
334 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
337 <title>Untitled</title>
339 <script type="text/javascript">
341 var dialog = window.opener.HTMLArea.Dialog["TYPO3Image"];
342 var plugin = dialog.plugin;
343 function insertImage(file,width,height,alt,title) {
344 plugin.insertImage(\'<img src="\'+file+\'"' . ($this->defaultClass?
(' class="'.$this->defaultClass
.'"'):'') . ' alt="\'+alt+\'" title="\'+title+\'" width="\'+parseInt(width)+\'" height="\'+parseInt(height)+\'" />\');
349 <script type="text/javascript">
351 insertImage('.t3lib_div
::quoteJSvalue($url,1).','.$width.','.$height.','.t3lib_div
::quoteJSvalue($altText,1).','.t3lib_div
::quoteJSvalue($titleText,1).');
359 * [Describe function...]
363 function getJSCode() {
364 global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
367 var dialog = window.opener.HTMLArea.Dialog["TYPO3Image"];
368 var plugin = dialog.plugin;
369 var HTMLArea = window.opener.HTMLArea;
370 function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close) {
371 return jumpToUrl(\''.$this->thisScript
.'?act='.$this->act
.'&mode='.$this->mode
.'&bparams='.$this->bparams
.'&insertImage='.'\'+fp);
373 function jumpToUrl(URL,anchor) {
374 var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act
.'" : "";
375 var add_editorNo = URL.indexOf("editorNo=")==-1 ? "&editorNo='.$this->editorNo
.'" : "";
376 var add_sys_language_content = URL.indexOf("sys_language_content=")==-1 ? "&sys_language_content='.$this->sys_language_content
.'" : "";
377 var RTEtsConfigParams = "&RTEtsConfigParams='.rawurlencode(t3lib_div
::_GP('RTEtsConfigParams')).'";
379 var cur_width = selectedImageRef ? "&cWidth="+selectedImageRef.style.width : "";
380 var cur_height = selectedImageRef ? "&cHeight="+selectedImageRef.style.height : "";
382 var theLocation = URL+add_act+add_editorNo+add_sys_language_content+RTEtsConfigParams+cur_width+cur_height+(anchor?anchor:"");
383 window.location.href = theLocation;
386 function launchView(url) {
387 var thePreviewWindow="";
388 thePreviewWindow = window.open("'.$this->siteUrl
.TYPO3_mainDir
.'show_item.php?table="+url,"ShowItem","height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
389 if (thePreviewWindow && thePreviewWindow.focus) {
390 thePreviewWindow.focus();
393 function getCurrentImageRef() {
400 function printCurrentImageOptions() {
401 var classesImage = ' . ($this->thisConfig
['classesImage']?
'true':'false') . ';
402 if (classesImage) var styleSelector=\'<select id="iClass" name="iClass" style="width:140px;">' . $this->classesImageJSOptions
. '</select>\';
403 var floatSelector=\'<select id="iFloat" name="iFloat"><option value="">' . $LANG->getLL('notSet') . '</option><option value="none">' . $LANG->getLL('nonFloating') . '</option><option value="left">' . $LANG->getLL('left') . '</option><option value="right">' . $LANG->getLL('right') . '</option></select>\';
404 var bgColor=\' class="bgColor4"\';
406 sz+=\'<table border=0 cellpadding=1 cellspacing=1><form action="" name="imageData">\';
407 '.(in_array('class', $this->removedProperties
)?
'':'
409 sz+=\'<tr><td\'+bgColor+\'><label for="iClass">'.$LANG->getLL('class').': </label></td><td>\'+styleSelector+\'</td></tr>\';
411 .(in_array('width', $this->removedProperties
)?
'':'
412 if (!(selectedImageRef && selectedImageRef.src.indexOf("RTEmagic") == -1 && '. $this->lockPlainWidth
.')) {
413 sz+=\'<tr><td\'+bgColor+\'><label for="iWidth">'.$LANG->getLL('width').': </label></td><td><input type="text" id="iWidth" name="iWidth" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).' /></td></tr>\';
415 .(in_array('height', $this->removedProperties
)?
'':'
416 if (!(selectedImageRef && selectedImageRef.src.indexOf("RTEmagic") == -1 && '. $this->lockPlainHeight
.')) {
417 sz+=\'<tr><td\'+bgColor+\'><label for="iHeight">'.$LANG->getLL('height').': </label></td><td><input type="text" id="iHeight" name="iHeight" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).' /></td></tr>\';
419 .(in_array('border', $this->removedProperties
)?
'':'
420 sz+=\'<tr><td\'+bgColor+\'><label for="iBorder">'.$LANG->getLL('border').': </label></td><td><input type="checkbox" id="iBorder" name="iBorder" value="1" /></td></tr>\';')
421 .(in_array('float', $this->removedProperties
)?
'':'
422 sz+=\'<tr><td\'+bgColor+\'><label for="iFloat">'.$LANG->getLL('float').': </label></td><td>\'+floatSelector+\'</td></tr>\';')
423 .(in_array('paddingTop', $this->removedProperties
)?
'':'
424 sz+=\'<tr><td\'+bgColor+\'><label for="iPaddingTop">'.$LANG->getLL('padding_top').': </label></td><td><input type="text" id="iPaddingTop" name="iPaddingTop" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).'></td></tr>\';')
425 .(in_array('paddingRight', $this->removedProperties
)?
'':'
426 sz+=\'<tr><td\'+bgColor+\'><label for="iPaddingRight">'.$LANG->getLL('padding_right').': </label></td><td><input type="text" id="iPaddingRight" name="iPaddingRight" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).' /></td></tr>\';')
427 .(in_array('paddingBottom', $this->removedProperties
)?
'':'
428 sz+=\'<tr><td\'+bgColor+\'><label for="iPaddingBottom">'.$LANG->getLL('padding_bottom').': </label></td><td><input type="text" id="iPaddingBottom" name="iPaddingBottom" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).' /></td></tr>\';')
429 .(in_array('paddingLeft', $this->removedProperties
)?
'':'
430 sz+=\'<tr><td\'+bgColor+\'><label for="iPaddingLeft">'.$LANG->getLL('padding_left').': </label></td><td><input type="text" id="iPaddingLeft" name="iPaddingLeft" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(4).' /></td></tr>\';')
431 .(in_array('title', $this->removedProperties
)?
'':'
432 sz+=\'<tr><td\'+bgColor+\'><label for="iTitle">'.$LANG->getLL('title').': </label></td><td><input type="text" id="iTitle" name="iTitle"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /></td></tr>\';')
433 .(in_array('alt', $this->removedProperties
)?
'':'
434 sz+=\'<tr><td\'+bgColor+\'><label for="iAlt">'.$LANG->getLL('alt').': </label></td><td><input type="text" id="iAlt" name="iAlt"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /></td></tr>\';')
435 .((!$TYPO3_CONF_VARS['EXTCONF'][$this->extKey
]['enableClickEnlarge'] ||
in_array('clickenlarge', $this->removedProperties
))?
'':'
436 sz+=\'<tr><td\'+bgColor+\'><label for="iClickEnlarge">'.$LANG->sL('LLL:EXT:cms/locallang_ttc.php:image_zoom',1).' </label></td><td><input type="checkbox" name="iClickEnlarge" id="iClickEnlarge" value="1" /></td></tr>\';').'
437 sz+=\'<tr><td><input type="submit" value="'.$LANG->getLL('update').'" onClick="return setImageProperties();"></td></tr>\';
438 sz+=\'</form></table>\';
441 function setImageProperties() {
442 var classesImage = ' . ($this->thisConfig
['classesImage']?
'true':'false') . ';
443 if (selectedImageRef) {
444 if (document.imageData.iWidth) {
445 if (document.imageData.iWidth.value && parseInt(document.imageData.iWidth.value)) {
446 selectedImageRef.style.width = "";
447 selectedImageRef.width = parseInt(document.imageData.iWidth.value);
449 selectedImageRef.style.width = "auto";
452 if (document.imageData.iHeight) {
453 if (document.imageData.iHeight.value && parseInt(document.imageData.iHeight.value)) {
454 selectedImageRef.style.height = "";
455 selectedImageRef.height = parseInt(document.imageData.iHeight.value);
457 selectedImageRef.style.height = "auto";
460 if (document.imageData.iPaddingTop) {
461 if (document.imageData.iPaddingTop.value != "" && !isNaN(parseInt(document.imageData.iPaddingTop.value))) {
462 selectedImageRef.style.paddingTop = parseInt(document.imageData.iPaddingTop.value) + "px";
464 selectedImageRef.style.paddingTop = "";
467 if (document.imageData.iPaddingRight) {
468 if (document.imageData.iPaddingRight.value != "" && !isNaN(parseInt(document.imageData.iPaddingRight.value))) {
469 selectedImageRef.style.paddingRight = parseInt(document.imageData.iPaddingRight.value) + "px";
471 selectedImageRef.style.paddingRight = "";
474 if (document.imageData.iPaddingBottom) {
475 if (document.imageData.iPaddingBottom.value != "" && !isNaN(parseInt(document.imageData.iPaddingBottom.value))) {
476 selectedImageRef.style.paddingBottom = parseInt(document.imageData.iPaddingBottom.value) + "px";
478 selectedImageRef.style.paddingBottom = "";
481 if (document.imageData.iPaddingLeft) {
482 if (document.imageData.iPaddingLeft.value != "" && !isNaN(parseInt(document.imageData.iPaddingLeft.value))) {
483 selectedImageRef.style.paddingLeft = parseInt(document.imageData.iPaddingLeft.value) + "px";
485 selectedImageRef.style.paddingLeft = "";
488 if (document.imageData.iTitle) {
489 selectedImageRef.title=document.imageData.iTitle.value;
491 if (document.imageData.iAlt) {
492 selectedImageRef.alt=document.imageData.iAlt.value;
495 if (document.imageData.iBorder) {
496 selectedImageRef.style.borderStyle = "";
497 selectedImageRef.style.borderWidth = "";
498 selectedImageRef.style.border = ""; // this statement ignored by Mozilla 1.3.1
499 selectedImageRef.style.borderTopStyle = "";
500 selectedImageRef.style.borderRightStyle = "";
501 selectedImageRef.style.borderBottomStyle = "";
502 selectedImageRef.style.borderLeftStyle = "";
503 selectedImageRef.style.borderTopWidth = "";
504 selectedImageRef.style.borderRightWidth = "";
505 selectedImageRef.style.borderBottomWidth = "";
506 selectedImageRef.style.borderLeftWidth = "";
507 if(document.imageData.iBorder.checked) {
508 selectedImageRef.style.borderStyle = "solid";
509 selectedImageRef.style.borderWidth = "thin";
511 selectedImageRef.removeAttribute("border");
514 if (document.imageData.iFloat) {
515 var iFloat = document.imageData.iFloat.options[document.imageData.iFloat.selectedIndex].value;
516 if (iFloat || selectedImageRef.style.cssFloat || selectedImageRef.style.styleFloat) {
518 selectedImageRef.style.styleFloat = (iFloat != "none") ? iFloat : "";
520 selectedImageRef.style.cssFloat = (iFloat != "none") ? iFloat : "";
525 if (classesImage && document.imageData.iClass) {
526 var iClass = document.imageData.iClass.options[document.imageData.iClass.selectedIndex].value;
527 if (iClass || (selectedImageRef.attributes["class"] && selectedImageRef.attributes["class"].value)) {
528 selectedImageRef.className = iClass;
530 selectedImageRef.className = "";
534 if (document.imageData.iClickEnlarge) {
535 if (document.imageData.iClickEnlarge.checked) {
536 selectedImageRef.setAttribute("clickenlarge","1");
538 selectedImageRef.setAttribute("clickenlarge","0");
545 function insertImagePropertiesInForm() {
546 var classesImage = ' . ($this->thisConfig
['classesImage']?
'true':'false') . ';
547 if (selectedImageRef) {
548 var styleWidth, styleHeight, padding;
549 if (document.imageData.iWidth) {
550 styleWidth = selectedImageRef.style.width ? selectedImageRef.style.width : selectedImageRef.width;
551 styleWidth = parseInt(styleWidth);
552 if (isNaN(styleWidth) || styleWidth == 0) { styleWidth = "auto"; }
553 document.imageData.iWidth.value = styleWidth;
555 if (document.imageData.iHeight) {
556 styleHeight = selectedImageRef.style.height ? selectedImageRef.style.height : selectedImageRef.height;
557 styleHeight = parseInt(styleHeight);
558 if (isNaN(styleHeight) || styleHeight == 0) { styleHeight = "auto"; }
559 document.imageData.iHeight.value = styleHeight;
561 if (document.imageData.iPaddingTop) {
562 var padding = selectedImageRef.style.paddingTop ? selectedImageRef.style.paddingTop : selectedImageRef.vspace;
563 var padding = parseInt(padding);
564 if (isNaN(padding) || padding <= 0) { padding = ""; }
565 document.imageData.iPaddingTop.value = padding;
567 if (document.imageData.iPaddingRight) {
568 padding = selectedImageRef.style.paddingRight ? selectedImageRef.style.paddingRight : selectedImageRef.hspace;
569 var padding = parseInt(padding);
570 if (isNaN(padding) || padding <= 0) { padding = ""; }
571 document.imageData.iPaddingRight.value = padding;
573 if (document.imageData.iPaddingBottom) {
574 var padding = selectedImageRef.style.paddingBottom ? selectedImageRef.style.paddingBottom : selectedImageRef.vspace;
575 var padding = parseInt(padding);
576 if (isNaN(padding) || padding <= 0) { padding = ""; }
577 document.imageData.iPaddingBottom.value = padding;
579 if (document.imageData.iPaddingLeft) {
580 var padding = selectedImageRef.style.paddingLeft ? selectedImageRef.style.paddingLeft : selectedImageRef.hspace;
581 var padding = parseInt(padding);
582 if (isNaN(padding) || padding <= 0) { padding = ""; }
583 document.imageData.iPaddingLeft.value = padding;
585 if (document.imageData.iTitle) {
586 document.imageData.iTitle.value = selectedImageRef.title;
588 if (document.imageData.iAlt) {
589 document.imageData.iAlt.value = selectedImageRef.alt;
591 if (document.imageData.iBorder) {
592 if((selectedImageRef.style.borderStyle && selectedImageRef.style.borderStyle != "none" && selectedImageRef.style.borderStyle != "none none none none") || selectedImageRef.border) {
593 document.imageData.iBorder.checked = 1;
596 if (document.imageData.iFloat) {
597 var fObj=document.imageData.iFloat;
598 var value = (selectedImageRef.style.cssFloat ? selectedImageRef.style.cssFloat : selectedImageRef.style.styleFloat);
600 for (var a=0;a<l;a++) {
601 if (fObj.options[a].value == value) {
602 fObj.selectedIndex = a;
607 if (classesImage && document.imageData.iClass) {
608 var fObj=document.imageData.iClass;
609 var value=selectedImageRef.className;
611 for (var a=0;a < l; a++) {
612 if (fObj.options[a].value == value) {
613 fObj.selectedIndex = a;
617 if (document.imageData.iClickEnlarge) {
618 if (selectedImageRef.getAttribute("clickenlarge") == "1") {
619 document.imageData.iClickEnlarge.checked = 1;
621 document.imageData.iClickEnlarge.checked = 0;
628 var selectedImageRef = getCurrentImageRef();'; // Setting this to a reference to the image object.
630 // Finally, add the accumulated JavaScript to the template object:
631 $this->doc
->JScodeArray
['rtehtmlarea'] = $JScode;
634 function reinitParams() {
635 if ($this->editorNo
) {
636 $pArr = explode('|', $this->bparams
);
637 $pArr[1] = implode(':', array($this->editorNo
, $this->sys_language_content
));
638 $pArr[2] = $this->RTEtsConfigParams
;
639 if ($this->act
== 'dragdrop' ||
$this->act
== 'plain') {
640 $pArr[3] = 'jpg,jpeg,gif,png';
642 $this->bparams
= implode('|', $pArr);
644 parent
::reinitParams();
648 * Return true or false whether thumbs should be displayed or not
652 function displayThumbs() {
654 return parent
::displayThumbs() && !$BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect') && ($this->act
!= 'dragdrop');
658 * Create HTML checkbox to enable/disable thumbnail display
660 * @return string HTML code
662 function addDisplayOptions() {
665 // Getting flag for showing/not showing thumbnails:
666 $noThumbs = $BE_USER->getTSConfigVal('options.noThumbsInEB') ||
($this->mode
== 'rte' && $BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect')) ||
($this->act
== 'dragdrop');
668 $thumbNailCheckbox = '';
671 $thumbNailCheckbox = t3lib_BEfunc
::getFuncCheck('', 'SET[displayThumbs]',$this->displayThumbs(), $this->thisScript
, t3lib_div
::implodeArrayForUrl('',$this->addParams
));
672 $description = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:displayThumbs',1);
673 $id = 'l'.uniqid('tx_dam_scbase');
674 $idAttr = ' id="'.$id.'"';
675 $thumbNailCheckbox = str_replace('<input', '<input'.$idAttr, $thumbNailCheckbox);
676 $thumbNailCheckbox .= ' <label for="'.$id.'">'.$description.'</label>';
677 $this->damSC
->addOption('html', 'thumbnailCheckbox', $thumbNailCheckbox);
679 $this->damSC
->addOption('funcCheck', 'extendedInfo', $GLOBALS['LANG']->getLL('displayExtendedInfo',1));
683 * Render list of files.
685 * @param array List of files. See t3lib_div::getFilesInDir
686 * @param string $mode EB mode: "db", "file", ...
687 * @return string HTML output
689 function renderFileList($files, $mode='file') {
690 global $LANG, $BACK_PATH, $BE_USER, $TYPO3_CONF_VARS;
694 // Listing the files:
695 if (is_array($files) AND count($files)) {
697 $displayThumbs = $this->displayThumbs();
698 $displayImage = ($this->act
=== 'dragdrop');
700 // Traverse the file list:
702 foreach($files as $fI) {
704 if (!$fI['__exists']) {
709 $titleAttrib = tx_dam_guiFunc
::icon_getTitleAttribute($fI);
710 $iconFile = tx_dam
::icon_getFileType($fI);
711 $iconTag = tx_dam_guiFunc
::icon_getFileTypeImgTag($fI);
712 $iconAndFilename = $iconTag.htmlspecialchars(t3lib_div
::fixed_lgd_cs($fI['file_title'], $BE_USER->uc
['titleLen']));
715 // Create links for adding the file:
716 if (strstr($fI['file_name_absolute'], ',') ||
strstr($fI['file_name_absolute'], '|')) { // In case an invalid character is in the filepath, display error message:
717 $eMsg = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'), ', |'));
718 $ATag_insert = '<a href="#" onclick="alert('.$eMsg.');return false;">';
720 // If filename is OK, just add it:
723 // JS: insertElement(table, uid, type, filename, fpath, filetype, imagefile ,action, close)
724 $onClick_params = implode (', ', array(
725 "'".$fI['_ref_table']."'",
726 "'".$fI['_ref_id']."'",
728 $this->quoteJSvalue($fI['file_name']),
729 $this->quoteJSvalue($fI['_ref_file_path']),
730 "'".$fI['file_type']."'",
733 $onClick = 'return insertElement('.$onClick_params.');';
734 $ATag_add = '<a href="#" onclick="'.htmlspecialchars($onClick).'"'.$titleAttrib.'>';
735 $onClick = 'return insertElement('.$onClick_params.', \'\', 1);';
736 $ATag_insert = '<a href="#" onclick="'.htmlspecialchars($onClick).'"'.$titleAttrib.'>';
739 // Create link to showing details about the file in a window:
740 if ($fI['__exists']) {
741 $Ahref = $BACK_PATH.'show_item.php?table='.rawurlencode($fI['file_name_absolute']).'&returnUrl='.rawurlencode(t3lib_div
::getIndpEnv('REQUEST_URI'));
742 $ATag_info = '<a href="'.htmlspecialchars($Ahref).'">';
743 $info = $ATag_info.'<img'.t3lib_iconWorks
::skinImg($BACK_PATH, 'gfx/zoom2.gif', 'width="12" height="12"').' title="'.$LANG->getLL('info',1).'" alt="" /> '.$LANG->getLL('info',1).'</a>';
749 // Thumbnail/size generation:
751 if (t3lib_div
::inList($TYPO3_CONF_VARS['GFX']['imagefile_ext'], $fI['file_type']) AND $displayThumbs AND is_file($fI['file_name_absolute'])) {
752 $clickThumb = t3lib_BEfunc
::getThumbNail($BACK_PATH.'thumbs.php', $fI['file_path_absolute'].$fI['file_name'], '');
753 $clickThumb = '<div style="width:56px; overflow:auto; padding: 5px; background-color:#fff; border:solid 1px #ccc;">'.$ATag_insert.$clickThumb.'</a>'.'</div>';
754 } elseif ($displayThumbs) {
755 $clickThumb = '<div style="width:68px"></div>';
759 if ($displayImage AND t3lib_div
::inList($TYPO3_CONF_VARS['GFX']['imagefile_ext'], $fI['file_type']) AND is_file($fI['file_name_absolute'])) {
760 if (t3lib_div
::_GP('noLimit')) {
767 $IW = $fI['hpixels'];
768 $IH = $fI['vpixels'];
770 $IH=ceil($IH/$IW*$maxW);
774 $IW=ceil($IW/$IH*$maxH);
777 $clickThumb = '<img src="'.$this->siteUrl
.substr($fI['file_name_absolute'],strlen(PATH_site
)).'" width="'.$IW.'" height="'.$IH.'"' . ($this->defaultClass?
(' class="'.$this->defaultClass
.'"'):''). ' alt="'.$fI['alt_text'].'" title="'.$fI[$this->imgTitleDAMColumn
].'" />';
778 $clickThumb = '<div style="width:380px; overflow:auto; padding: 5px; background-color:#fff; border:solid 1px #ccc;">'.$clickThumb.'</div>';
783 <tr class="bgColor4">
784 <td valign="top" nowrap="nowrap" style="min-width:20em">'.($displayImage?
'':$ATag_insert).$iconAndFilename.'</a>'.' </td>
785 <td valign="top" width="1%">'.($displayImage?
'':$ATag_add).'<img'.t3lib_iconWorks
::skinImg($BACK_PATH, 'gfx/plusbullet2.gif', 'width="18" height="16"').' title="'.$LANG->getLL('addToList',1).'" alt="" /></a></td>
786 <td valign="top" nowrap="nowrap" width="1%">'.$info.'</td>
791 if ($this->getModSettings('extendedInfo')) {
792 $infoText = tx_dam_guiFunc
::meta_compileInfoData ($fI, 'file_name, file_size:filesize, _dimensions, caption:truncate:50, instructions', 'table');
793 $infoText = str_replace('<table>', '<table border="0" cellpadding="0" cellspacing="1">', $infoText);
794 $infoText = str_replace('<strong>', '<strong style="font-weight:normal;">', $infoText);
795 $infoText = str_replace('</td><td>', '</td><td class="bgColor-10">', $infoText);
799 if (($displayThumbs ||
$displayImage) AND $infoText) {
802 <td valign="top" colspan="3">
803 <table border="0" cellpadding="0" cellspacing="0"><tr>
804 <td valign="top">'.$clickThumb.'</td>
805 <td valign="top" style="padding-left:1em">'.$infoText.'</td></tr>
807 <div style="height:0.5em;"></div>
810 } elseif ($clickThumb OR $infoText) {
813 <td valign="top" colspan="3" style="padding-left:22px">
814 '.$clickThumb.$infoText.'
815 <div style="height:0.5em;"></div>
822 <td colspan="3"><div style="height:0.5em;"></div></td>
826 // Wrap all the rows in table tags:
834 <table border="0" cellpadding="1" cellspacing="1" id="typo3-fileList">
835 '.implode('',$lines).'
839 // Return accumulated content for filelisting:
844 * Makes a DAM db query and collects data to be used in EB display
846 * @param string $allowedFileTypes Comma list of allowed file types
847 * @param string $disallowedFileTypes Comma list of disallowed file types
848 * @param string $mode EB mode: "db", "file", ...
849 * @return array Array of file elements
851 function getFileListArr($allowedFileTypes, $disallowedFileTypes, $mode) {
852 global $TYPO3_CONF_VARS, $TYPO3_DB;
854 $filearray = array();
856 // Use the current selection to create a query and count selected records
859 $this->damSC
->selection
->addSelectionToQuery();
860 $this->damSC
->selection
->qg
->query
['FROM']['tx_dam'] = tx_dam_db
::getMetaInfoFieldList(true, array('hpixels','vpixels',$this->imgTitleDAMColumn
,'alt_text'));
861 #$this->damSC->selection->qg->addSelectFields(...
862 if ($allowedFileTypes) {
863 $extList = '"'.implode ('","', explode(',',$allowedFileTypes)).'"';
864 $this->damSC
->selection
->qg
->addWhere('AND tx_dam.file_type IN ('.$extList.')', 'WHERE', 'tx_dam.file_type');
866 if ($disallowedFileTypes) {
867 $extList = '"'.implode ('","', explode(',',$disallowedFileTypes)).'"';
868 $this->damSC
->selection
->qg
->addWhere('AND NOT tx_dam.file_type IN ('.$extList.')', 'WHERE', 'NOT tx_dam.file_type');
870 if ($this->act
== 'plain') {
871 $this->damSC
->selection
->qg
->addWhere('AND tx_dam.hpixels <= '.intval($this->plainMaxWidth
), 'WHERE', 'tx_dam.hpixels');
872 $this->damSC
->selection
->qg
->addWhere('AND tx_dam.vpixels <= '.intval($this->plainMaxHeight
), 'WHERE', 'tx_dam.vpixels');
875 $this->damSC
->selection
->execSelectionQuery(TRUE);
877 // any records found?
878 if($this->damSC
->selection
->pointer
->countTotal
) {
880 // limit query for browsing
881 $this->damSC
->selection
->addLimitToQuery();
882 $this->damSC
->selection
->execSelectionQuery();
884 if($this->damSC
->selection
->res
) {
885 while($row = $TYPO3_DB->sql_fetch_assoc($this->damSC
->selection
->res
)) {
887 $row['file_title'] = $row['title'] ?
$row['title'] : $row['file_name'];
888 $row['file_path_absolute'] = tx_dam
::path_makeAbsolute($row['file_path']);
889 $row['file_name_absolute'] = $row['file_path_absolute'].$row['file_name'];
890 $row['__exists'] = @is_file
($row['file_name_absolute']);
893 $row['_ref_table'] = 'tx_dam';
894 $row['_ref_id'] = $row['uid'];
895 $row['_ref_file_path'] = '';
897 $row['_ref_table'] = '';
898 $row['_ref_id'] = t3lib_div
::shortMD5($row['file_name_absolute']);
899 $row['_ref_file_path'] = $row['file_name_absolute'];
903 if (count($filearray) >= $this->damSC
->selection
->pointer
->itemsPerPage
) {
914 * [Describe function...]
918 function main_rte() {
919 global $LANG, $TYPO3_CONF_VARS, $FILEMOUNTS, $BE_USER;
921 $path = tx_dam
::path_makeAbsolute($this->damSC
->path
);
922 if (!$path OR !@is_dir
($path)) {
923 $fileProcessor = t3lib_div
::makeInstance('t3lib_basicFileFunctions');
924 $fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
925 $path = $fileProcessor->findTempFolder().'/'; // The closest TEMP-path is found
927 $this->damSC
->path
= tx_dam
::path_makeRelative($path); // mabe not needed
930 $this->content
= $this->doc
->startPage($LANG->getLL('Insert Image',1));
932 $this->reinitParams();
934 // Making menu in top:
936 if (in_array('image',$this->allowedItems
) && ($this->act
=='image' || t3lib_div
::_GP('cWidth'))) {
937 $menuDef['page']['isActive'] = $this->act
=='image';
938 $menuDef['page']['label'] = $LANG->getLL('currentImage',1);
939 $menuDef['page']['url'] = '#';
940 $menuDef['page']['addParams'] = 'onClick="jumpToUrl(\''.htmlspecialchars($this->thisScript
.'?act=image&mode='.$this->mode
.'&bparams='.$this->bparams
).'\');return false;"';
942 if (in_array('magic',$this->allowedItems
)){
943 $menuDef['file']['isActive'] = $this->act
=='magic';
944 $menuDef['file']['label'] = $LANG->getLL('magicImage',1);
945 $menuDef['file']['url'] = '#';
946 $menuDef['file']['addParams'] = 'onClick="jumpToUrl(\''.htmlspecialchars($this->thisScript
.'?act=magic&mode='.$this->mode
.'&bparams='.$this->bparams
).'\');return false;"';
948 if (in_array('plain',$this->allowedItems
)) {
949 $menuDef['url']['isActive'] = $this->act
=='plain';
950 $menuDef['url']['label'] = $LANG->getLL('plainImage',1);
951 $menuDef['url']['url'] = '#';
952 $menuDef['url']['addParams'] = 'onClick="jumpToUrl(\''.htmlspecialchars($this->thisScript
.'?act=plain&mode='.$this->mode
.'&bparams='.$this->bparams
).'\');return false;"';
954 if (in_array('dragdrop',$this->allowedItems
)) {
955 $menuDef['mail']['isActive'] = $this->act
=='dragdrop';
956 $menuDef['mail']['label'] = $LANG->getLL('dragDropImage',1);
957 $menuDef['mail']['url'] = '#';
958 $menuDef['mail']['addParams'] = 'onClick="jumpToUrl(\''.htmlspecialchars($this->thisScript
.'?act=dragdrop&mode='.$this->mode
.'&bparams='.$this->bparams
).'\');return false;"';
960 if (in_array('upload', $this->allowedItems
)) {
961 $menuDef['upload']['isActive'] = ($this->act
=='upload');
962 $menuDef['upload']['label'] = $LANG->getLL('tx_dam_file_upload.title',1);
963 $menuDef['upload']['url'] = '#';
964 $menuDef['upload']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars($this->thisScript
.'?act=upload&mode='.$this->mode
.'&bparams='.$this->bparams
).'\');return false;"';
966 $this->content
.= $this->doc
->getTabMenuRaw($menuDef);
968 $pArr = explode('|', $this->bparams
);
972 document.write(printCurrentImageOptions());
973 insertImagePropertiesInForm();';
974 $this->content
.= '<br />'.$this->doc
->wrapScriptTags($JScode);
977 $this->content
.= $this->dam_upload($this->allowedFileTypes
, $this->disallowedFileTypes
);
978 $this->content
.= $this->damSC
->getOptions();
979 $this->content
.='<br /><br />';
980 if ($BE_USER->isAdmin() ||
$BE_USER->getTSConfigVal('options.createFoldersInEB')) {
981 $this->content
.= $this->createFolder($path);
982 $this->content
.= '<br />';
987 //$this->allowedFileTypes = t3lib_div::trimExplode(',', $pArr[3], true);
989 $this->addDisplayOptions();
990 $this->content
.= $this->dam_select($this->allowedFileTypes
, $this->disallowedFileTypes
);
991 $this->content
.= $this->damSC
->getOptions();
993 if ($this->act
=='magic') {
994 $this->content
.= $this->getMsgBox($LANG->getLL('magicImage_msg'));
996 if ($this->act
=='plain') {
997 $this->content
.= $this->getMsgBox(sprintf($LANG->getLL('plainImage_msg'), $this->plainMaxWidth
, $this->plainMaxHeight
));
1003 // Ending page, returning content:
1004 $this->content
.= $this->doc
->endPage();
1006 $this->content
= $this->damSC
->doc
->insertStylesAndJS($this->content
);
1007 return $this->content
;
1011 * Import from t3lib_page in order to create backend version
1012 * Creates language-overlay for records in general (where translation is found in records from the same table)
1014 * @param string Table name
1015 * @param array Record to overlay. Must containt uid, pid and $table]['ctrl']['languageField']
1016 * @param integer Pointer to the sys_language uid for content on the site.
1017 * @param string Overlay mode. If "hideNonTranslated" then records without translation will not be returned un-translated but unset (and return value is false)
1018 * @return mixed Returns the input record, possibly overlaid with a translation. But if $OLmode is "hideNonTranslated" then it will return false if no translation is found.
1020 function getRecordOverlay($table,$row,$sys_language_content,$OLmode='') {
1021 global $TCA, $TYPO3_DB;
1022 if ($row['uid']>0 && $row['pid']>0) {
1023 if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField']) {
1024 if (!$TCA[$table]['ctrl']['transOrigPointerTable']) {
1025 // Will try to overlay a record only if the sys_language_content value is larger that zero.
1026 if ($sys_language_content>0) {
1027 // Must be default language or [All], otherwise no overlaying:
1028 if ($row[$TCA[$table]['ctrl']['languageField']]<=0) {
1029 // Select overlay record:
1030 $res = $TYPO3_DB->exec_SELECTquery(
1033 'pid='.intval($row['pid']).
1034 ' AND '.$TCA[$table]['ctrl']['languageField'].'='.intval($sys_language_content).
1035 ' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
1036 t3lib_BEfunc
::BEenableFields($table).
1037 t3lib_BEfunc
::deleteClause($table),
1042 $olrow = $TYPO3_DB->sql_fetch_assoc($res);
1043 //$this->versionOL($table,$olrow);
1045 // Merge record content by traversing all fields:
1046 if (is_array($olrow)) {
1047 foreach($row as $fN => $fV) {
1048 if ($fN!='uid' && $fN!='pid' && isset($olrow[$fN])) {
1049 if ($TCA[$table]['l10n_mode'][$fN]!='exclude' && ($TCA[$table]['l10n_mode'][$fN]!='mergeIfNotBlank' ||
strcmp(trim($olrow[$fN]),''))) {
1050 $row[$fN] = $olrow[$fN];
1054 } elseif ($OLmode==='hideNonTranslated' && $row[$TCA[$table]['ctrl']['languageField']]==0) { // Unset, if non-translated records should be hidden. ONLY done if the source record really is default language and not [All] in which case it is allowed.
1058 // Otherwise, check if sys_language_content is different from the value of the record - that means a japanese site might try to display french content.
1059 } elseif ($sys_language_content!=$row[$TCA[$table]['ctrl']['languageField']]) {
1063 // When default language is displayed, we never want to return a record carrying another language!:
1064 if ($row[$TCA[$table]['ctrl']['languageField']]>0) {
1077 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php']) {
1078 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php']);