85 $this->
initHookObjects(
'ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php');
99 parent::initVariables();
106 $pArr = explode(
'|', $this->bparams);
107 $pRteArr = explode(
':', $pArr[1]);
108 $this->editorNo = $pRteArr[0];
109 $this->sys_language_content = $pRteArr[1];
110 $this->RTEtsConfigParams = $pArr[2];
111 if (!$this->editorNo) {
116 $pArr[1] = implode(
':', array($this->editorNo, $this->sys_language_content));
118 if ($this->act ==
'dragdrop' || $this->act ==
'plain') {
119 $this->allowedFileTypes = explode(
',', self::PLAIN_MODE_IMAGE_FILE_EXTENSIONS);
121 $pArr[3] = implode(
',', $this->allowedFileTypes);
122 $this->bparams = implode(
'|', $pArr);
131 parent::initDocumentTemplate();
133 $this->doc->bodyTagId =
'typo3-browse-links-php';
136 $this->doc->JScode .= $this->doc->wrapScriptTags(
' 137 Tree.ajaxID = "SC_alt_file_navframe::expandCollapse"; 140 $this->doc->getContextMenuCode();
149 return 'onload="initEventListeners();"';
160 return $this->imgPath ?:
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'RTE_imageStorageDir'];
168 protected function insertImage() {
173 $fileObject = Resource\ResourceFactory::getInstance()->getFileObject(
$uid);
175 $altText = $fileObject->getProperty(
'alternative');
176 $titleText = $fileObject->getProperty(
'title');
177 switch ($this->act) {
179 $this->insertMagicImage($fileObject, $altText, $titleText,
'data-htmlarea-file-uid="' .
$uid .
'" data-htmlarea-file-table="' . $table .
'"');
183 $this->
insertPlainImage($fileObject, $altText, $titleText,
'data-htmlarea-file-uid="' .
$uid .
'" data-htmlarea-file-table="' . $table .
'"');
188 foreach ($this->hookObjects as $hookObject) {
189 if (method_exists($hookObject,
'insertElement')) {
190 $hookObject->insertElement($this->act);
206 public function insertMagicImage(Resource\
File $fileObject, $altText =
'', $titleText =
'', $additionalParams =
'') {
210 $magicImageService->setMagicImageMaximumDimensions($this->thisConfig);
212 $imageConfiguration = array(
216 $magicImage = $magicImageService->createMagicImage($fileObject, $imageConfiguration);
217 $imageUrl = $magicImage->getPublicUrl();
219 if (substr($imageUrl, 0, 4) !==
'http') {
220 $imageUrl = $this->siteURL . $imageUrl;
223 $this->
imageInsertJS($imageUrl, $magicImage->getProperty(
'width'), $magicImage->getProperty(
'height'), $altText, $titleText, $additionalParams);
235 public function insertPlainImage(Resource\
File $fileObject, $altText =
'', $titleText =
'', $additionalParams =
'') {
236 $width = $fileObject->getProperty(
'width');
237 $height = $fileObject->getProperty(
'height');
238 if (!$width || !$height) {
239 $filePath = $fileObject->getForLocalProcessing(FALSE);
240 $imageInfo = @getimagesize($filePath);
241 $width = $imageInfo[0];
242 $height = $imageInfo[1];
244 $imageUrl = $fileObject->getPublicUrl();
246 if (substr($imageUrl, 0, 4) !==
'http') {
247 $imageUrl = $this->siteURL . $imageUrl;
249 $this->
imageInsertJS($imageUrl, $width, $height, $altText, $titleText, $additionalParams);
263 protected function imageInsertJS($url, $width, $height, $altText =
'', $titleText =
'', $additionalParams =
'') {
268 <title>Untitled</title> 269 <script type="text/javascript"> 272 function insertImage(file,width,height,alt,title,additionalParams) { 273 plugin.insertImage(\'<img src="\'+file+\'" width="\'+parseInt(width)+\'" height="\'+parseInt(height)+\'"\'' . ($this->defaultClass ?
'+\' class="' . $this->defaultClass .
'"\'' :
'') .
'+(alt?\' alt="\'+alt+\'"\':\'\')+(title?\' title="\'+title+\'"\':\'\')+(additionalParams?\' \'+additionalParams:\'\')+\' />\'); 279 <script type="text/javascript"> 298 $removedProperties = array();
299 if (is_array($this->buttonConfig[
'properties.'])) {
300 if ($this->buttonConfig[
'properties.'][
'removeItems']) {
304 if ($this->buttonConfig[
'properties.'][
'class.'][
'allowedClasses']) {
306 $classesImageJSOptions =
'<option value=""></option>';
307 foreach ($classesImageArray as $class) {
308 $classesImageJSOptions .=
'<option value="' . htmlspecialchars($class) .
'">' . htmlspecialchars($class) .
'</option>';
311 $lockPlainWidth =
'false';
312 $lockPlainHeight =
'false';
313 if (is_array($this->thisConfig[
'proc.']) && $this->thisConfig[
'proc.'][
'plainImageMode']) {
314 $plainImageMode = $this->thisConfig[
'proc.'][
'plainImageMode'];
315 $lockPlainWidth = $plainImageMode ==
'lockDimensions' ?
'true' :
'false';
316 $lockPlainHeight = $lockPlainWidth || $plainImageMode ==
'lockRatio' || $plainImageMode ==
'lockRatioWhenSmaller' ?
'true' :
'false';
320 var HTMLArea = window.parent.HTMLArea; 322 HTMLArea.TYPO3Image.insertElement = function (table, uid, type, filename, filePath, fileExt, fileIcon) { 325 function insertElement(table, uid, type, fileName, filePath, fileExt, fileIcon, action, close) { 328 function initEventListeners() { 330 Ext.EventManager.addListener(window.document.body, "dragend", plugin.onDrop, plugin, { single: true }); 333 function jumpToUrl(URL,anchor) { 339 var cur_width = selectedImageRef ? "&cWidth="+selectedImageRef.style.width : ""; 340 var cur_height = selectedImageRef ? "&cHeight="+selectedImageRef.style.height : ""; 342 var theLocation = URL+add_act+add_editorNo+add_sys_language_content+RTEtsConfigParams+cur_width+cur_height+(typeof(anchor)=="string"?anchor:""); 343 window.location.href = theLocation; 346 function insertImage(file,width,height) { 347 plugin.insertImage(\'<img src="\'+file+\'"' . ($this->defaultClass ?
' class="\' + ' .
GeneralUtility::quoteJSvalue(htmlspecialchars($this->defaultClass)) .
' + \'"' :
'') .
' width="\'+parseInt(width)+\'" height="\'+parseInt(height)+\'" />\'); 349 function launchView(url) { 350 var thePreviewWindow=""; 351 thePreviewWindow = window.open(' .
GeneralUtility::quoteJSvalue(
GeneralUtility::getIndpEnv(
'TYPO3_SITE_URL') . 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"); 352 if (thePreviewWindow && thePreviewWindow.focus) { 353 thePreviewWindow.focus(); 356 function getCurrentImageRef() { 363 function printCurrentImageOptions() { 364 var classesImage = ' . ($this->buttonConfig[
'properties.'][
'class.'][
'allowedClasses'] || $this->thisConfig[
'classesImage'] ?
'true' :
'false') .
'; 365 if (classesImage) var styleSelector=\'<select id="iClass" name="iClass" style="width:140px;">' . $classesImageJSOptions .
'</select>\'; 366 var floatSelector=\'<select id="iFloat" name="iFloat"><option value="">' .
$GLOBALS[
'LANG']->getLL(
'notSet') .
'</option><option value="none">' .
$GLOBALS[
'LANG']->getLL(
'nonFloating') .
'</option><option value="left">' .
$GLOBALS[
'LANG']->getLL(
'left') .
'</option><option value="right">' .
$GLOBALS[
'LANG']->getLL(
'right') .
'</option></select>\'; 367 if (plugin.getButton("Language")) { 368 var languageSelector = \'<select id="iLang" name="iLang">\'; 369 plugin.getButton("Language").getStore().each(function (record) { 370 languageSelector +=\'<option value="\' + record.get("value") + \'">\' + record.get("text") + \'</option>\'; 372 languageSelector += \'</select>\'; 375 sz+=\'<form action="" name="imageData"><table class="htmlarea-window-table">\'; 376 ' . (in_array(
'class', $removedProperties) ?
'' :
' 378 sz+=\'<tr><td><label for="iClass">' .
$GLOBALS[
'LANG']->getLL(
'class') .
': </label></td><td>\'+styleSelector+\'</td></tr>\'; 379 }') . (in_array(
'width', $removedProperties) ?
'' :
' 380 if (!(selectedImageRef && selectedImageRef.src.indexOf("RTEmagic") == -1 && ' . $lockPlainWidth .
')) { 381 sz+=\'<tr><td><label for="iWidth">' .
$GLOBALS[
'LANG']->getLL(
'width') .
': </label></td><td><input type="text" id="iWidth" name="iWidth" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' /></td></tr>\'; 382 }') . (in_array(
'height', $removedProperties) ?
'' :
' 383 if (!(selectedImageRef && selectedImageRef.src.indexOf("RTEmagic") == -1 && ' . $lockPlainHeight .
')) { 384 sz+=\'<tr><td><label for="iHeight">' .
$GLOBALS[
'LANG']->getLL(
'height') .
': </label></td><td><input type="text" id="iHeight" name="iHeight" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' /></td></tr>\'; 385 }') . (in_array(
'border', $removedProperties) ?
'' :
' 386 sz+=\'<tr><td><label for="iBorder">' .
$GLOBALS[
'LANG']->getLL(
'border') .
': </label></td><td><input type="checkbox" id="iBorder" name="iBorder" value="1" /></td></tr>\';') . (in_array(
'float', $removedProperties) ?
'' :
' 387 sz+=\'<tr><td><label for="iFloat">' .
$GLOBALS[
'LANG']->getLL(
'float') .
': </label></td><td>\'+floatSelector+\'</td></tr>\';') . (in_array(
'paddingTop', $removedProperties) ?
'' :
' 388 sz+=\'<tr><td><label for="iPaddingTop">' .
$GLOBALS[
'LANG']->getLL(
'padding_top') .
': </label></td><td><input type="text" id="iPaddingTop" name="iPaddingTop" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
'></td></tr>\';') . (in_array(
'paddingRight', $removedProperties) ?
'' :
' 389 sz+=\'<tr><td><label for="iPaddingRight">' .
$GLOBALS[
'LANG']->getLL(
'padding_right') .
': </label></td><td><input type="text" id="iPaddingRight" name="iPaddingRight" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' /></td></tr>\';') . (in_array(
'paddingBottom', $removedProperties) ?
'' :
' 390 sz+=\'<tr><td><label for="iPaddingBottom">' .
$GLOBALS[
'LANG']->getLL(
'padding_bottom') .
': </label></td><td><input type="text" id="iPaddingBottom" name="iPaddingBottom" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' /></td></tr>\';') . (in_array(
'paddingLeft', $removedProperties) ?
'' :
' 391 sz+=\'<tr><td><label for="iPaddingLeft">' .
$GLOBALS[
'LANG']->getLL(
'padding_left') .
': </label></td><td><input type="text" id="iPaddingLeft" name="iPaddingLeft" value=""' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(4) .
' /></td></tr>\';') . (in_array(
'title', $removedProperties) ?
'' :
' 392 sz+=\'<tr><td><label for="iTitle">' .
$GLOBALS[
'LANG']->getLL(
'title') .
': </label></td><td><input type="text" id="iTitle" name="iTitle"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(20) .
' /></td></tr>\';') . (in_array(
'alt', $removedProperties) ?
'' :
' 393 sz+=\'<tr><td><label for="iAlt">' .
$GLOBALS[
'LANG']->getLL(
'alt') .
': </label></td><td><input type="text" id="iAlt" name="iAlt"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(20) .
' /></td></tr>\';') . (in_array(
'lang', $removedProperties) ?
'' :
' 394 if (plugin.getButton("Language")) { 395 sz+=\'<tr><td><label for="iLang">\' + plugin.editor.getPlugin("Language").localize(\'Language-Tooltip\') + \': </label></td><td>\' + languageSelector + \'</td></tr>\'; 396 }') . (in_array(
'clickenlarge', $removedProperties) || in_array(
'data-htmlarea-clickenlarge', $removedProperties) ?
'' :
' 397 sz+=\'<tr><td><label for="iClickEnlarge">' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:cms/locallang_ttc.xlf:image_zoom', TRUE) .
' </label></td><td><input type="checkbox" name="iClickEnlarge" id="iClickEnlarge" value="0" /></td></tr>\';') .
' 398 sz+=\'<tr><td></td><td><input type="submit" value="' .
$GLOBALS[
'LANG']->getLL(
'update') .
'" onClick="return setImageProperties();"></td></tr>\'; 399 sz+=\'</table></form>\'; 402 function setImageProperties() { 403 var classesImage = ' . ($this->buttonConfig[
'properties.'][
'class.'][
'allowedClasses'] || $this->thisConfig[
'classesImage'] ?
'true' :
'false') .
'; 404 if (selectedImageRef) { 405 if (document.imageData.iWidth) { 406 if (document.imageData.iWidth.value && parseInt(document.imageData.iWidth.value)) { 407 selectedImageRef.style.width = ""; 408 selectedImageRef.width = parseInt(document.imageData.iWidth.value); 411 if (document.imageData.iHeight) { 412 if (document.imageData.iHeight.value && parseInt(document.imageData.iHeight.value)) { 413 selectedImageRef.style.height = ""; 414 selectedImageRef.height = parseInt(document.imageData.iHeight.value); 417 if (document.imageData.iPaddingTop) { 418 if (document.imageData.iPaddingTop.value != "" && !isNaN(parseInt(document.imageData.iPaddingTop.value))) { 419 selectedImageRef.style.paddingTop = parseInt(document.imageData.iPaddingTop.value) + "px"; 421 selectedImageRef.style.paddingTop = ""; 424 if (document.imageData.iPaddingRight) { 425 if (document.imageData.iPaddingRight.value != "" && !isNaN(parseInt(document.imageData.iPaddingRight.value))) { 426 selectedImageRef.style.paddingRight = parseInt(document.imageData.iPaddingRight.value) + "px"; 428 selectedImageRef.style.paddingRight = ""; 431 if (document.imageData.iPaddingBottom) { 432 if (document.imageData.iPaddingBottom.value != "" && !isNaN(parseInt(document.imageData.iPaddingBottom.value))) { 433 selectedImageRef.style.paddingBottom = parseInt(document.imageData.iPaddingBottom.value) + "px"; 435 selectedImageRef.style.paddingBottom = ""; 438 if (document.imageData.iPaddingLeft) { 439 if (document.imageData.iPaddingLeft.value != "" && !isNaN(parseInt(document.imageData.iPaddingLeft.value))) { 440 selectedImageRef.style.paddingLeft = parseInt(document.imageData.iPaddingLeft.value) + "px"; 442 selectedImageRef.style.paddingLeft = ""; 445 if (document.imageData.iTitle) { 446 selectedImageRef.title=document.imageData.iTitle.value; 448 if (document.imageData.iAlt) { 449 selectedImageRef.alt=document.imageData.iAlt.value; 451 if (document.imageData.iBorder) { 452 selectedImageRef.style.borderStyle = ""; 453 selectedImageRef.style.borderWidth = ""; 454 selectedImageRef.style.border = ""; // this statement ignored by Mozilla 1.3.1 455 selectedImageRef.style.borderTopStyle = ""; 456 selectedImageRef.style.borderRightStyle = ""; 457 selectedImageRef.style.borderBottomStyle = ""; 458 selectedImageRef.style.borderLeftStyle = ""; 459 selectedImageRef.style.borderTopWidth = ""; 460 selectedImageRef.style.borderRightWidth = ""; 461 selectedImageRef.style.borderBottomWidth = ""; 462 selectedImageRef.style.borderLeftWidth = ""; 463 if(document.imageData.iBorder.checked) { 464 selectedImageRef.style.borderStyle = "solid"; 465 selectedImageRef.style.borderWidth = "thin"; 467 selectedImageRef.removeAttribute("border"); 469 if (document.imageData.iFloat) { 470 var iFloat = document.imageData.iFloat.options[document.imageData.iFloat.selectedIndex].value; 472 selectedImageRef.style.styleFloat = iFloat ? iFloat : ""; 474 selectedImageRef.style.cssFloat = iFloat ? iFloat : ""; 477 if (classesImage && document.imageData.iClass) { 479 if (document.imageData.iClass.options.length > 0) { 480 iClass = document.imageData.iClass.options[document.imageData.iClass.selectedIndex].value; 482 if (iClass || (selectedImageRef.attributes["class"] && selectedImageRef.attributes["class"].value)) { 483 selectedImageRef.className = iClass; 485 selectedImageRef.className = ""; 488 if (document.imageData.iLang) { 489 var iLang = document.imageData.iLang.options[document.imageData.iLang.selectedIndex].value; 490 var languageObject = plugin.editor.getPlugin("Language"); 491 if (iLang || languageObject.getLanguageAttribute(selectedImageRef)) { 492 languageObject.setLanguageAttributes(selectedImageRef, iLang); 494 languageObject.setLanguageAttributes(selectedImageRef, "none"); 497 if (document.imageData.iClickEnlarge) { 498 if (document.imageData.iClickEnlarge.checked) { 499 selectedImageRef.setAttribute("data-htmlarea-clickenlarge","1"); 501 selectedImageRef.removeAttribute("data-htmlarea-clickenlarge"); 502 selectedImageRef.removeAttribute("clickenlarge"); 509 function insertImagePropertiesInForm() { 510 var classesImage = ' . ($this->buttonConfig[
'properties.'][
'class.'][
'allowedClasses'] || $this->thisConfig[
'classesImage'] ?
'true' :
'false') .
'; 511 if (selectedImageRef) { 512 var styleWidth, styleHeight, padding; 513 if (document.imageData.iWidth) { 514 styleWidth = selectedImageRef.style.width ? selectedImageRef.style.width : selectedImageRef.width; 515 styleWidth = parseInt(styleWidth); 516 if (!(isNaN(styleWidth) || styleWidth == 0)) { 517 document.imageData.iWidth.value = styleWidth; 520 if (document.imageData.iHeight) { 521 styleHeight = selectedImageRef.style.height ? selectedImageRef.style.height : selectedImageRef.height; 522 styleHeight = parseInt(styleHeight); 523 if (!(isNaN(styleHeight) || styleHeight == 0)) { 524 document.imageData.iHeight.value = styleHeight; 527 if (document.imageData.iPaddingTop) { 528 var padding = selectedImageRef.style.paddingTop ? selectedImageRef.style.paddingTop : selectedImageRef.vspace; 529 var padding = parseInt(padding); 530 if (isNaN(padding) || padding <= 0) { padding = ""; } 531 document.imageData.iPaddingTop.value = padding; 533 if (document.imageData.iPaddingRight) { 534 padding = selectedImageRef.style.paddingRight ? selectedImageRef.style.paddingRight : selectedImageRef.hspace; 535 var padding = parseInt(padding); 536 if (isNaN(padding) || padding <= 0) { padding = ""; } 537 document.imageData.iPaddingRight.value = padding; 539 if (document.imageData.iPaddingBottom) { 540 var padding = selectedImageRef.style.paddingBottom ? selectedImageRef.style.paddingBottom : selectedImageRef.vspace; 541 var padding = parseInt(padding); 542 if (isNaN(padding) || padding <= 0) { padding = ""; } 543 document.imageData.iPaddingBottom.value = padding; 545 if (document.imageData.iPaddingLeft) { 546 var padding = selectedImageRef.style.paddingLeft ? selectedImageRef.style.paddingLeft : selectedImageRef.hspace; 547 var padding = parseInt(padding); 548 if (isNaN(padding) || padding <= 0) { padding = ""; } 549 document.imageData.iPaddingLeft.value = padding; 551 if (document.imageData.iTitle) { 552 document.imageData.iTitle.value = selectedImageRef.title; 554 if (document.imageData.iAlt) { 555 document.imageData.iAlt.value = selectedImageRef.alt; 557 if (document.imageData.iBorder) { 558 if((selectedImageRef.style.borderStyle && selectedImageRef.style.borderStyle != "none" && selectedImageRef.style.borderStyle != "none none none none") || selectedImageRef.border) { 559 document.imageData.iBorder.checked = 1; 562 if (document.imageData.iFloat) { 563 var fObj=document.imageData.iFloat; 564 var value = (selectedImageRef.style.cssFloat ? selectedImageRef.style.cssFloat : selectedImageRef.style.styleFloat); 566 for (var a=0;a<l;a++) { 567 if (fObj.options[a].value == value) { 568 fObj.selectedIndex = a; 572 if (classesImage && document.imageData.iClass) { 573 var fObj=document.imageData.iClass; 574 var value=selectedImageRef.className; 576 for (var a=0;a < l; a++) { 577 if (fObj.options[a].value == value) { 578 fObj.selectedIndex = a; 582 if (document.imageData.iLang) { 583 var fObj=document.imageData.iLang; 584 var value=plugin.editor.getPlugin("Language").getLanguageAttribute(selectedImageRef); 585 for (var i = 0, n = fObj.length; i < n; i++) { 586 if (fObj.options[i].value == value) { 587 fObj.selectedIndex = i; 589 fObj.options[0].text = plugin.editor.getPlugin("Language").localize("Remove language mark"); 594 if (document.imageData.iClickEnlarge) { 595 if (selectedImageRef.getAttribute("data-htmlarea-clickenlarge") == "1" || selectedImageRef.getAttribute("clickenlarge") == "1") { 596 document.imageData.iClickEnlarge.checked = 1; 598 document.imageData.iClickEnlarge.checked = 0; 605 var selectedImageRef = getCurrentImageRef();';
620 if ($this->act !=
'image') {
621 if (isset($this->act)) {
625 $this->act = $data[
'act'];
634 return array($data, $store);
643 $this->content = $this->doc->startPage(
$GLOBALS[
'LANG']->getLL(
'Insert Image', TRUE));
646 if (in_array(
'image', $this->allowedItems) && ($this->act ===
'image' ||
GeneralUtility::_GP(
'cWidth'))) {
647 $menuDef[
'image'][
'isActive'] = FALSE;
648 $menuDef[
'image'][
'label'] =
$GLOBALS[
'LANG']->getLL(
'currentImage', TRUE);
649 $menuDef[
'image'][
'url'] =
'#';
652 if (in_array(
'magic', $this->allowedItems)) {
653 $menuDef[
'magic'][
'isActive'] = FALSE;
654 $menuDef[
'magic'][
'label'] =
$GLOBALS[
'LANG']->getLL(
'magicImage', TRUE);
655 $menuDef[
'magic'][
'url'] =
'#';
658 if (in_array(
'plain', $this->allowedItems)) {
659 $menuDef[
'plain'][
'isActive'] = FALSE;
660 $menuDef[
'plain'][
'label'] =
$GLOBALS[
'LANG']->getLL(
'plainImage', TRUE);
661 $menuDef[
'plain'][
'url'] =
'#';
664 if (in_array(
'dragdrop', $this->allowedItems)) {
665 $menuDef[
'dragdrop'][
'isActive'] = FALSE;
666 $menuDef[
'dragdrop'][
'label'] =
$GLOBALS[
'LANG']->getLL(
'dragDropImage', TRUE);
667 $menuDef[
'dragdrop'][
'url'] =
'#';
671 foreach ($this->hookObjects as $hookObject) {
672 $menuDef = $hookObject->modifyMenuDefinition($menuDef);
678 if ($this->act === FALSE || !in_array($this->act, $this->allowedItems)) {
679 $this->act = key($menuDef);
682 $this->content .= $this->doc->getTabMenuRaw($menuDef);
683 switch ($this->act) {
686 document.write(printCurrentImageOptions()); 687 insertImagePropertiesInForm();';
688 $this->content .=
'<br />' . $this->doc->wrapScriptTags($JScode);
696 $tree = $foldertree->getBrowsableTree();
698 if (!$this->curUrlInfo[
'value'] || $this->curUrlInfo[
'act'] != $this->act) {
701 $cmpPath = $this->curUrlInfo[
'value'];
709 $fileOrFolderObject = NULL;
715 if ($fileOrFolderObject instanceof \
TYPO3\CMS\Core\Resource\
Folder) {
743 if (
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.uploadFieldsInTopOfEB')) {
744 $this->content .= $uploadForm;
749 $files = $this->
TBE_expandFolder(
$selectedFolder, $this->act ===
'plain' ? self::PLAIN_MODE_IMAGE_FILE_EXTENSIONS :
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'imagefile_ext'], $GLOBALS[
'BE_USER']->getTSConfigVal(
'options.noThumbsInRTEimageSelect'));
752 $this->doc->JScode .= $this->doc->wrapScriptTags(
'BrowseLinks.addElements(' . json_encode($this->elements) .
');');
757 Wrapper table for folder tree / file/folder list: 759 <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles"> 761 <td class="c-wCell" valign="top">' . $this->
barheader((
$GLOBALS[
'LANG']->getLL(
'folderTree') .
':')) . $tree .
'</td> 762 <td class="c-wCell" valign="top">' . $files .
'</td> 769 $this->content .= $this->
getMsgBox($helpMessage);
772 if (!
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.uploadFieldsInTopOfEB')) {
773 $this->content .= $uploadForm;
775 $this->content .= $createFolder;
776 $this->content .=
'<br />';
781 $foldertree->ext_noTempRecyclerDirs = TRUE;
782 $tree = $foldertree->getBrowsableTree();
784 if (!$this->curUrlInfo[
'value'] || $this->curUrlInfo[
'act'] != $this->act) {
787 $cmpPath = $this->curUrlInfo[
'value'];
805 $this->content .=
'<table border="0" cellpadding="0" cellspacing="0"> 807 <td style="vertical-align: top;">' . $this->
barheader((
$GLOBALS[
'LANG']->getLL(
'folderTree') .
':')) . $tree .
'</td> 809 <td style="vertical-align: top;">' . $files .
'</td> 815 foreach ($this->hookObjects as $hookObject) {
816 $this->content .= $hookObject->getTab($this->act);
819 $this->content .= $this->doc->endPage();
822 unset($this->doc->JScodeArray[
'jumpToUrl']);
824 $this->doc->JScodeArray[
'rtehtmlarea'] = $this->
getJSCode($this->act, $this->editorNo, $this->sys_language_content);
825 $this->content = $this->doc->insertStylesAndJS($this->content);
848 $RTEtsConfigParts = explode(
':', $this->RTEtsConfigParams);
849 return $RTEtsConfigParts[6];
858 return is_array($this->thisConfig[
'buttons.']) && is_array($this->thisConfig[
'buttons.'][
'image.']) ? $this->thisConfig[
'buttons.'][
'image.'] : array();
870 if ($clientInfo[
'BROWSER'] !==
'opera') {
874 foreach ($this->hookObjects as $hookObject) {
878 if ($this->act !==
'image') {
882 if (is_array($this->buttonConfig[
'options.']) && $this->buttonConfig[
'options.'][
'removeItems']) {
895 $orderedMenuDefinition = array();
896 if (is_array($this->buttonConfig[
'options.']) && $this->buttonConfig[
'options.'][
'orderItems']) {
898 $orderItems = array_intersect($orderItems, $this->allowedItems);
899 foreach ($orderItems as $item) {
900 $orderedMenuDefinition[$item] = $menuDefinition[$item];
903 $orderedMenuDefinition = $menuDefinition;
905 return $orderedMenuDefinition;
915 if (is_array($this->buttonConfig[
'properties.'])) {
916 if (is_array($this->buttonConfig[
'properties.'][
'class.']) && trim($this->buttonConfig[
'properties.'][
'class.'][
'default'])) {
917 $defaultClass = trim($this->buttonConfig[
'properties.'][
'class.'][
'default']);
929 if (is_array($this->buttonConfig[
'options.']) && is_array($this->buttonConfig[
'options.'][
'plain.'])) {
930 if ($this->buttonConfig[
'options.'][
'plain.'][
'maxWidth']) {
931 $this->plainMaxWidth = $this->buttonConfig[
'options.'][
'plain.'][
'maxWidth'];
933 if ($this->buttonConfig[
'options.'][
'plain.'][
'maxHeight']) {
934 $this->plainMaxHeight = $this->buttonConfig[
'options.'][
'plain.'][
'maxHeight'];
937 if (!$this->plainMaxWidth) {
938 $this->plainMaxWidth = 640;
940 if (!$this->plainMaxHeight) {
941 $this->plainMaxHeight = 680;
954 return sprintf(
$GLOBALS[
'LANG']->getLL(
'plainImage_msg'), $this->plainMaxWidth, $this->plainMaxHeight);
957 return sprintf(
$GLOBALS[
'LANG']->getLL(
'magicImage_msg'));
975 $this->act !==
'plain' 978 && $imgInfo[0] <= $this->plainMaxWidth
setMaximumPlainImageDimensions()
processSessionData($data)
initHookObjects($hookKey)
static quoteJSvalue($value)
TBE_dragNDrop(Folder $folder, $extensionList='')
static getIndpEnv($getEnvName)
static logDeprecatedFunction()
orderMenuDefinition($menuDefinition)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
TBE_expandFolder(Folder $folder, $extensionList='', $noThumbs=FALSE)
fileIsSelectableInFileList(\TYPO3\CMS\Core\Resource\FileInterface $file, array $imgInfo)
imageInsertJS($url, $width, $height, $altText='', $titleText='', $additionalParams='')
getJSCode($act, $editorNo, $sys_language_content)
const PLAIN_MODE_IMAGE_FILE_EXTENSIONS
insertPlainImage(Resource\File $fileObject, $altText='', $titleText='', $additionalParams='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
getMsgBox($in_msg, $icon='icon_note')
uploadForm(Folder $folderObject)
expandFolder(Folder $folder, $extensionList='')
createFolder(Folder $folderObject)
static clientInfo($useragent='')