59 $GLOBALS[
'LANG']->includeLLFile(
'EXT:rtehtmlarea/mod5/locallang.xlf');
60 $GLOBALS[
'LANG']->includeLLFile(
'EXT:rtehtmlarea/htmlarea/locallang_dialogs.xlf');
71 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
72 $this->doc->bodyTagAdditions =
'onload="Init();"';
74 <form action="" id="process" name="process" method="post"> 75 <input type="hidden" name="processContent" value="" /> 80 var HTMLArea = window.parent.HTMLArea; 81 var editor = plugin.editor; 85 function insertHTML(content,noHide) { 86 plugin.restoreSelection(); 87 editor.getSelection().insertHtml(content); 88 if(!noHide) plugin.close(); 90 function wrapHTML(wrap1,wrap2,noHide) { 91 plugin.restoreSelection(); 92 if(!editor.getSelection().isEmpty()) { 93 editor.getSelection().surroundHtml(wrap1,wrap2); 97 if(!noHide) plugin.close(); 99 function processSelection(script) { 100 plugin.restoreSelection(); 101 document.process.action = script; 102 document.process.processContent.value = editor.getSelection().getHtml(); 103 document.process.submit(); 105 function jumpToUrl(URL) { 106 var RTEtsConfigParams = "&RTEtsConfigParams=' . rawurlencode(\
TYPO3\CMS\Core\Utility\
GeneralUtility::_GP(
'RTEtsConfigParams')) .
'"; 107 var editorNo = "&editorNo=' . rawurlencode($this->editorNo) .
'"; 108 theLocation = URL+RTEtsConfigParams+editorNo; 109 window.location.href = theLocation; 114 unset($this->doc->JScodeArray[
'jumpToUrl']);
116 $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
117 $this->modData =
$GLOBALS[
'BE_USER']->getModuleData(
'user.php',
'ses');
120 $this->modData[
'openKeys'][$parts[1]] = $parts[0] ==
'O' ? 1 : 0;
121 $GLOBALS[
'BE_USER']->pushModuleData(
'user.php', $this->modData);
133 $this->content .= $this->
main_user($this->modData[
'openKeys']);
158 public function calcWH($imgInfo, $maxW = 380, $maxH = 500) {
162 $IH = ceil($IH / $IW * $maxW);
166 $IW = ceil($IW / $IH * $maxH);
169 $imgInfo[3] =
'width="' . $IW .
'" height="' . $IH .
'"';
182 $content = $this->doc->startPage(
$GLOBALS[
'LANG']->getLL(
'Insert Custom Element', TRUE));
186 if (is_array($thisConfig[
'userElements.'])) {
187 $categories = array();
188 foreach ($thisConfig[
'userElements.'] as $k => $value) {
190 $v = $thisConfig[
'userElements.'][$ki .
'.'];
191 if (substr($k, -1) ==
'.' && is_array($v)) {
194 if ($openKeys[$openK]) {
196 if ($v[
'load'] ===
'images_from_folder') {
198 if ($v[
'path'] && @is_dir((PATH_site . $v[
'path']))) {
200 if (is_array($files)) {
202 foreach ($files as $filename) {
203 $iInfo = @getimagesize((PATH_site . $v[
'path'] . $filename));
204 $iInfo = $this->
calcWH($iInfo, 50, 100);
205 $ks = (string) (100 + $c);
206 $mArray[$ks] = $filename;
207 $mArray[$ks .
'.'] = array(
208 'content' =>
'<img src="' . $this->siteUrl . $v[
'path'] . $filename .
'" />',
209 '_icon' =>
'<img src="' . $this->siteUrl . $v[
'path'] . $filename .
'" ' . $iInfo[3] .
' />',
210 'description' =>
$GLOBALS[
'LANG']->getLL(
'filesize') .
': ' . str_replace(
' ',
' ', \
TYPO3\CMS\Core\Utility\
GeneralUtility::formatSize(@filesize((PATH_site . $v[
'path'] . $filename)))) .
', ' .
$GLOBALS[
'LANG']->getLL(
'pixels', 1) .
': ' . $iInfo[0] .
'x' . $iInfo[1]
217 if (is_array($mArray)) {
225 foreach ($v as $k2 => $dummyValue) {
227 if (substr($k2, -1) ==
'.' && is_array($v[$k2i .
'.'])) {
228 $title = trim($v[$k2i]);
230 $title =
'[' .
$GLOBALS[
'LANG']->getLL(
'noTitle', TRUE) .
']';
232 $title =
$GLOBALS[
'LANG']->sL($title, TRUE);
234 $description =
$GLOBALS[
'LANG']->sL($v[($k2i .
'.')][
'description'], TRUE) .
'<br />';
235 if (!$v[($k2i .
'.')][
'dontInsertSiteUrl']) {
236 $v[$k2i .
'.'][
'content'] = str_replace(
'###_URL###', $this->siteUrl, $v[$k2i .
'.'][
'content']);
238 $logo = $v[$k2i .
'.'][
'_icon'] ?:
'';
240 switch ((
string) $v[($k2i .
'.')][
'mode']) {
242 $wrap = explode(
'|', $v[$k2i .
'.'][
'content']);
246 $script = trim($v[$k2i .
'.'][
'submitToScript']);
247 if (substr($script, 0, 4) !=
'http') {
248 $script = $this->siteUrl . $script;
259 $A = array(
'<a href="#" onClick="' . $onClickEvent .
'return false;">',
'</a>');
260 $subcats[$k2i] =
'<tr> 261 <td><img src="clear.gif" width="18" height="1" /></td> 262 <td class="bgColor4" valign="top">' . $A[0] . $logo . $A[1] .
'</td> 263 <td class="bgColor4" valign="top">' . $A[0] .
'<strong>' . $title .
'</strong><br />' . $description . $A[1] .
'</td> 269 $categories[$ki] = implode(
'', $subcats);
275 foreach ($categories as $k => $v) {
276 $title = trim($thisConfig[
'userElements.'][$k]);
279 $title =
'[' .
$GLOBALS[
'LANG']->getLL(
'noTitle', TRUE) .
']';
281 $title =
$GLOBALS[
'LANG']->sL($title, TRUE);
286 $content .=
'<table border="0" cellpadding="1" cellspacing="1">' . implode(
'', $lines) .
'</table>';
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static quoteJSvalue($value)
static getIndpEnv($getEnvName)
static makeInstance($className)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static RTEsetup($RTEprop, $table, $field, $type='')
static formatSize($sizeInBytes, $labels='')
static getFilesInDir($path, $extensionList='', $prependPath=FALSE, $order='', $excludePattern='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
calcWH($imgInfo, $maxW=380, $maxH=500)
static getPagesTSconfig($id, $rootLine=NULL, $returnPartArray=FALSE)