Feature #4064: Navigation title in tree view
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / mod3 / class.tx_rtehtmlarea_browse_links.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
6 * (c) 2005-2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
7 * All rights reserved
8 *
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.
14 *
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.
19 *
20 *
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.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28 /**
29 * Displays the page/file tree for browsing database records or files.
30 * Used from TCEFORMS an other elements
31 * In other words: This is the ELEMENT BROWSER!
32 *
33 * Adapted for htmlArea RTE by Stanislas Rolland
34 *
35 * $Id$
36 *
37 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
38 * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
39 */
40
41 require_once (PATH_typo3.'class.browse_links.php');
42 require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
43
44
45 /**
46 * Class which generates the page tree
47 *
48 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
49 * @package TYPO3
50 * @subpackage core
51 */
52 class tx_rtehtmlarea_pageTree extends rtePageTree {
53
54 /**
55 * Create the page navigation tree in HTML
56 *
57 * @param array Tree array
58 * @return string HTML output.
59 */
60 function printTree($treeArr='') {
61 global $BACK_PATH;
62 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
63 if (!is_array($treeArr)) $treeArr=$this->tree;
64
65 $out='';
66 $c=0;
67
68 foreach($treeArr as $k => $v) {
69 $c++;
70 $bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
71 if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
72 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
73 $bgColorClass='bgColor4';
74 } else {
75 $arrCol='<td></td>';
76 }
77
78 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';
79 $cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
80 '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
81 '';
82 $out.='
83 <tr class="'.$bgColorClass.'">
84 <td nowrap="nowrap"'.($v['row']['_CSSCLASS'] ? ' class="'.$v['row']['_CSSCLASS'].'"' : '').'>'.
85 $v['HTML'].
86 $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$this->ext_pArrPages).
87 '</td>'.
88 $arrCol.
89 '<td>'.$cEbullet.'</td>
90 </tr>';
91 }
92 $out='
93
94
95 <!--
96 Navigation Page Tree:
97 -->
98 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
99 '.$out.'
100 </table>';
101 return $out;
102 }
103 }
104
105 /**
106 * Base extension class which generates the folder tree.
107 * Used directly by the RTE.
108 *
109 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
110 * @package TYPO3
111 * @subpackage core
112 */
113 class tx_rtehtmlarea_folderTree extends rteFolderTree {
114
115 /**
116 * Wrapping the title in a link, if applicable.
117 *
118 * @param string Title, ready for output.
119 * @param array The "record"
120 * @return string Wrapping title string.
121 */
122 function wrapTitle($title,$v) {
123 if ($this->ext_isLinkable($v)) {
124 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
125 return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
126 } else {
127 return '<span class="typo3-dimmed">'.$title.'</span>';
128 }
129 }
130
131 /**
132 * Create the folder navigation tree in HTML
133 *
134 * @param mixed Input tree array. If not array, then $this->tree is used.
135 * @return string HTML output of the tree.
136 */
137 function printTree($treeArr='') {
138 global $BACK_PATH;
139 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
140
141 if (!is_array($treeArr)) $treeArr=$this->tree;
142
143 $out='';
144 $c=0;
145
146 // Preparing the current-path string (if found in the listing we will see a red blinking arrow).
147 if (!$GLOBALS['SOBE']->browser->curUrlInfo['value']) {
148 $cmpPath='';
149 } else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/') {
150 $cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';
151 } else {
152 $cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];
153 }
154
155 // Traverse rows for the tree and print them into table rows:
156 foreach($treeArr as $k => $v) {
157 $c++;
158 $bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
159
160 // Creating blinking arrow, if applicable:
161 if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path']) {
162 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
163 $bgColorClass='bgColor4';
164 } else {
165 $arrCol='<td></td>';
166 }
167 // Create arrow-bullet for file listing (if folder path is linkable):
168 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
169 $cEbullet = $this->ext_isLinkable($v['row']) ? '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' : '';
170
171 // Put table row with folder together:
172 $out.='
173 <tr class="'.$bgColorClass.'">
174 <td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>
175 '.$arrCol.'
176 <td>'.$cEbullet.'</td>
177 </tr>';
178 }
179
180 $out='
181
182 <!--
183 Folder tree:
184 -->
185 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
186 '.$out.'
187 </table>';
188 return $out;
189 }
190
191 }
192
193 /**
194 * Script class for the Element Browser window.
195 *
196 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
197 * @package TYPO3
198 * @subpackage core
199 */
200 class tx_rtehtmlarea_browse_links extends browse_links {
201
202 // Internal, static:
203 var $setTarget; // Target (RTE specific)
204 var $setClass; // Class (RTE specific)
205 var $setTitle; // Title (RTE specific)
206
207 var $contentTypo3Language;
208 var $contentTypo3Charset;
209
210 var $editorNo;
211 var $buttonConfig = array();
212
213 /**
214 * Constructor:
215 * Initializes a lot of variables, setting JavaScript functions in header etc.
216 *
217 * @return void
218 */
219 function init() {
220 global $BE_USER,$BACK_PATH,$LANG;
221
222 // Main GPvars:
223 $this->pointer = t3lib_div::_GP('pointer');
224 $this->bparams = t3lib_div::_GP('bparams');
225 $this->P = t3lib_div::_GP('P');
226 $this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
227 $this->expandPage = t3lib_div::_GP('expandPage');
228 $this->expandFolder = t3lib_div::_GP('expandFolder');
229 $this->PM = t3lib_div::_GP('PM');
230 $this->contentTypo3Language = t3lib_div::_GP('typo3ContentLanguage');
231 $this->contentTypo3Charset = t3lib_div::_GP('typo3ContentCharset');
232 $this->editorNo = t3lib_div::_GP('editorNo');
233
234 // Find "mode"
235 $this->mode=t3lib_div::_GP('mode');
236 if (!$this->mode) {
237 $this->mode='rte';
238 }
239
240 // Site URL
241 $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL'); // Current site url
242
243 // the script to link to
244 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
245
246 // CurrentUrl - the current link url must be passed around if it exists
247 if ($this->mode=='wizard') {
248 $currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
249 $this->curUrlArray = array(
250 'target' => $currentLinkParts[1]
251 );
252 $this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);
253 } else {
254 $this->curUrlArray = t3lib_div::_GP('curUrl');
255 if ($this->curUrlArray['all']) {
256 $this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
257 }
258 $this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
259 }
260
261 // Determine nature of current url:
262 $this->act=t3lib_div::_GP('act');
263 if (!$this->act) {
264 $this->act=$this->curUrlInfo['act'];
265 }
266
267 // Initializing the titlevalue
268 $this->setTitle = $LANG->csConvObj->conv($this->curUrlArray['title'], 'utf-8', $LANG->charSet);
269
270 // Rich Text Editor specific configuration:
271 $addPassOnParams='';
272 if ((string)$this->mode=='rte') {
273 $RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);
274 $addPassOnParams .= '&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);
275 $addPassOnParams .= ($this->contentTypo3Language ? '&typo3ContentLanguage=' . rawurlencode($this->contentTypo3Language) : '');
276 $addPassOnParams .= ($this->contentTypo3Charset ? '&typo3ContentCharset=' . rawurlencode($this->contentTypo3Charset) : '');
277 $RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
278 $this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
279 if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['link.'])) {
280 $this->buttonConfig = $this->thisConfig['buttons.']['link.'];
281 }
282 if($this->thisConfig['classesAnchor']) {
283 $this->setClass = $this->curUrlArray['class'];
284 $classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesAnchor'],1);
285 $anchorTypes = array( 'page', 'url', 'file', 'mail', 'spec');
286 $classesAnchor = array();
287 $classesAnchorDefault = array();
288 $this->classesAnchorDefaultTitle = array();
289 $classesAnchor['all'] = array();
290 if (is_array($RTEsetup['properties']['classesAnchor.'])) {
291 reset($RTEsetup['properties']['classesAnchor.']);
292 while(list($label,$conf)=each($RTEsetup['properties']['classesAnchor.'])) {
293 $classesAnchor['all'][] = $conf['class'];
294 if (in_array($conf['type'], $anchorTypes)) {
295 $classesAnchor[$conf['type']][] = $conf['class'];
296 if (is_array($this->thisConfig['classesAnchor.']) && is_array($this->thisConfig['classesAnchor.']['default.']) && $this->thisConfig['classesAnchor.']['default.'][$conf['type']] == $conf['class']) {
297 $classesAnchorDefault[$conf['type']] = $conf['class'];
298 if ($conf['titleText']) {
299 $string = trim($conf['titleText']);
300 if (substr($string,0,4)=='LLL:') { // language file
301 $arr = explode(':',$string);
302 if($arr[0] == 'LLL' && $arr[1] == 'EXT') {
303 $BE_lang = $LANG->lang;
304 $BE_origCharset = $LANG->origCharSet;
305 $LANG->lang = $this->contentTypo3Language;
306 $LANG->origCharSet = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];
307 $LANG->origCharSet = $LANG->origCharSet ? $LANG->origCharSet : 'iso-8859-1';
308 $string = $LANG->getLLL($arr[3], $LANG->readLLfile($arr[1].':'.$arr[2]), true);
309 $LANG->lang = $BE_lang;
310 $LANG->origCharSet = $BE_origCharset;
311 }
312 }
313 $this->classesAnchorDefaultTitle[$conf['type']] = $string;
314 }
315 }
316 }
317 }
318 }
319 $this->classesAnchorJSOptions = array();
320 reset($anchorTypes);
321 while (list(, $anchorType) = each($anchorTypes) ) {
322 reset($classesAnchorArray);
323 while(list(,$class)=each($classesAnchorArray)) {
324 if (!in_array($class, $classesAnchor['all']) || (in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$anchorType]) && in_array($class, $classesAnchor[$anchorType]))) {
325 $selected = '';
326 if ($this->setClass == $class) $selected = 'selected="selected"';
327 if (!$this->setClass && $classesAnchorDefault[$anchorType] == $class) {
328 $selected = 'selected="selected"';
329 }
330 $this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';
331 }
332 }
333 if ($this->classesAnchorJSOptions[$anchorType]) {
334 $selected = '';
335 if (!$this->setClass && !$classesAnchorDefault[$anchorType]) $selected = 'selected="selected"';
336 $this->classesAnchorJSOptions[$anchorType] = '<option ' . $selected . ' value=""></option>' . $this->classesAnchorJSOptions[$anchorType];
337 }
338 }
339 }
340 }
341
342 // Initializing the target value (RTE)
343 $this->setTarget = $this->curUrlArray['target'];
344 if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target'])) {
345 $this->setTarget=$this->thisConfig['defaultLinkTarget'];
346 }
347
348 // Creating backend template object:
349 $this->doc = t3lib_div::makeInstance('template');
350 $this->doc->docType= 'xhtml_trans';
351 $this->doc->backPath = $BACK_PATH;
352
353 // BEGIN accumulation of header JavaScript:
354 $JScode = '';
355 $JScode.= '
356 if (window.opener) {
357 var editor = window.opener.RTEarea[' . $this->editorNo . ']["editor"];
358 var HTMLArea = window.opener.HTMLArea;
359 }
360 // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
361 var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
362 var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'";
363 var add_class="'.($this->setClass?'&curUrl[class]='.rawurlencode($this->setClass):'').'";
364 var add_title="'.($this->setTitle?'&curUrl[title]='.rawurlencode($this->setTitle):'').'";
365 var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
366
367 var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
368 var cur_target="'.($this->setTarget?$this->setTarget:'').'";
369 var cur_class="'.($this->setClass?$this->setClass:'').'";
370 var cur_title="'.($this->setTitle?$this->setTitle:'').'";
371
372 function setTarget(value) {
373 cur_target=value;
374 add_target="&curUrl[target]="+encodeURIComponent(value);
375 }
376 function setClass(value) {
377 cur_class=value;
378 add_class="&curUrl[class]="+encodeURIComponent(value);
379 }
380 function setTitle(value) {
381 cur_title=value;
382 add_title="&curUrl[title]="+encodeURIComponent(value);
383 }
384 function setValue(value) {
385 cur_href=value;
386 add_href="&curUrl[href]="+value;
387 }
388 ';
389
390 if ($this->mode=='wizard') { // Functions used, if the link selector is in wizard mode (= TCEforms fields)
391 unset($this->P['fieldChangeFunc']['alert']);
392 reset($this->P['fieldChangeFunc']);
393 $update='';
394 while(list($k,$v)=each($this->P['fieldChangeFunc'])) {
395
396 $update.= '
397 window.opener.'.$v;
398 }
399
400 $P2=array();
401 $P2['itemName']=$this->P['itemName'];
402 $P2['formName']=$this->P['formName'];
403 $P2['fieldChangeFunc']=$this->P['fieldChangeFunc'];
404 $addPassOnParams.=t3lib_div::implodeArrayForUrl('P',$P2);
405
406 $JScode.='
407 function link_typo3Page(id,anchor) { //
408 updateValueInMainForm(id+(anchor?anchor:"")+" "+cur_target);
409 close();
410 return false;
411 }
412 function link_folder(folder) { //
413 updateValueInMainForm(folder+" "+cur_target);
414 close();
415 return false;
416 }
417 function link_current() { //
418 if (cur_href!="http://" && cur_href!="mailto:") {
419 var setValue = cur_href+" "+cur_target+" "+cur_class+" "+cur_title;
420 if (setValue.substr(0,7)=="http://") setValue = setValue.substr(7);
421 if (setValue.substr(0,7)=="mailto:") setValue = setValue.substr(7);
422 updateValueInMainForm(setValue);
423 close();
424 }
425 return false;
426 }
427 function checkReference() { //
428 if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"] ) {
429 return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"];
430 } else {
431 close();
432 }
433 }
434 function updateValueInMainForm(input) { //
435 var field = checkReference();
436 if (field) {
437 field.value = input;
438 '.$update.'
439 }
440 }
441 ';
442 } else { // Functions used, if the link selector is in RTE mode:
443 $JScode.='
444 function link_typo3Page(id,anchor) {
445 var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
446 if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
447 if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
448 editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
449 return false;
450 }
451 function link_folder(folder) { //
452 var theLink = \''.$this->siteURL.'\'+folder;
453 if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
454 if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
455 editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
456 return false;
457 }
458 function link_spec(theLink) { //
459 if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
460 if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
461 editor.renderPopup_addLink(theLink,cur_target,cur_class,cur_title);
462 return false;
463 }
464 function link_current() { //
465 if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
466 if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
467 if (cur_href!="http://" && cur_href!="mailto:") {
468 editor.renderPopup_addLink(cur_href,cur_target,cur_class,cur_title);
469 }
470 return false;
471 }
472 ';
473 }
474
475 // General "jumpToUrl" function:
476 $JScode.='
477 function jumpToUrl(URL,anchor) { //
478 var add_editorNo = URL.indexOf("editorNo=")==-1 ? "&editorNo='.$this->editorNo.'" : "";
479 var add_contentTypo3Language = URL.indexOf("contentTypo3Language=")==-1 ? "&contentTypo3Language='.$this->contentTypo3Language.'" : "";
480 var add_contentTypo3Charset = URL.indexOf("contentTypo3Charset=")==-1 ? "&contentTypo3Charset='.$this->contentTypo3Charset.'" : "";
481 var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
482 var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
483 var theLocation = URL+add_act+add_editorNo+add_contentTypo3Language+add_contentTypo3Charset+add_mode+add_href+add_target+add_class+add_title+add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
484 window.location.href = theLocation;
485 return false;
486 }
487 ';
488
489 // This is JavaScript especially for the TBE Element Browser!
490 $pArr = explode('|',$this->bparams);
491 $formFieldName = 'data['.$pArr[0].']['.$pArr[1].']['.$pArr[2].']';
492 $JScode.='
493 var elRef="";
494 var targetDoc="";
495
496 function launchView(url) { //
497 var thePreviewWindow="";
498 thePreviewWindow = window.open("' . $BACK_PATH . 'show_item.php?table="+url,"ShowItem","height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
499 if (thePreviewWindow && thePreviewWindow.focus) {
500 thePreviewWindow.focus();
501 }
502 }
503 function setReferences() { //
504 if (parent.window.opener
505 && parent.window.opener.content
506 && parent.window.opener.content.document.editform
507 && parent.window.opener.content.document.editform["'.$formFieldName.'"]
508 ) {
509 targetDoc = parent.window.opener.content.document;
510 elRef = targetDoc.editform["'.$formFieldName.'"];
511 return true;
512 } else {
513 return false;
514 }
515 }
516 function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close) { //
517 if (1=='.($pArr[0]&&!$pArr[1]&&!$pArr[2] ? 1 : 0).') {
518 addElement(filename,table+"_"+uid,fp,close);
519 } else {
520 if (setReferences()) {
521 parent.window.opener.group_change("add","'.$pArr[0].'","'.$pArr[1].'","'.$pArr[2].'",elRef,targetDoc);
522 } else {
523 alert("Error - reference to main window is not set properly!");
524 }
525 if (close) {
526 parent.window.opener.focus();
527 parent.close();
528 }
529 }
530 return false;
531 }
532 function addElement(elName,elValue,altElValue,close) { //
533 if (parent.window.opener && parent.window.opener.setFormValueFromBrowseWin) {
534 parent.window.opener.setFormValueFromBrowseWin("'.$pArr[0].'",altElValue?altElValue:elValue,elName);
535 if (close) {
536 parent.window.opener.focus();
537 parent.close();
538 }
539 } else {
540 alert("Error - reference to main window is not set properly!");
541 parent.close();
542 }
543 }
544 ';
545
546 // Finally, add the accumulated JavaScript to the template object:
547 $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
548
549 // Debugging:
550 if (FALSE) debug(array(
551 'pointer' => $this->pointer,
552 'act' => $this->act,
553 'mode' => $this->mode,
554 'curUrlInfo' => $this->curUrlInfo,
555 'curUrlArray' => $this->curUrlArray,
556 'P' => $this->P,
557 'bparams' => $this->bparams,
558 'RTEtsConfigParams' => $this->RTEtsConfigParams,
559 'expandPage' => $this->expandPage,
560 'expandFolder' => $this->expandFolder,
561 'PM' => $this->PM,
562 ),'Internal variables of Script Class:');
563 }
564
565 /******************************************************************
566 *
567 * Main functions
568 *
569 ******************************************************************/
570 /**
571 * Rich Text Editor (RTE) link selector (MAIN function)
572 * Generates the link selector for the Rich Text Editor.
573 * Can also be used to select links for the TCEforms (see $wiz)
574 *
575 * @param boolean If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
576 * @return string Modified content variable.
577 */
578 function main_rte($wiz=0) {
579 global $LANG, $BE_USER, $BACK_PATH;
580
581 // Starting content:
582 $content=$this->doc->startPage($LANG->getLL('Insert/Modify Link',1));
583
584 // Initializing the action value, possibly removing blinded values etc:
585 $allowedItems = explode(',','page,file,url,mail,spec');
586 if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
587 $allowedItems = array_diff($allowedItems,t3lib_div::trimExplode(',',$this->buttonConfig['options.']['removeItems'],1));
588 } else {
589 $allowedItems = array_diff($allowedItems,t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
590 }
591 reset($allowedItems);
592 if (!in_array($this->act,$allowedItems)) {
593 $this->act = current($allowedItems);
594 }
595
596 // Making menu in top:
597 $menuDef = array();
598 if (!$wiz) {
599 $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
600 $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
601 $menuDef['removeLink']['url'] = '#';
602 $menuDef['removeLink']['addParams'] = 'onclick="editor.renderPopup_unLink();return false;"';
603 }
604 if (in_array('page',$allowedItems)) {
605 $menuDef['page']['isActive'] = $this->act=='page';
606 $menuDef['page']['label'] = $LANG->getLL('page',1);
607 $menuDef['page']['url'] = '#';
608 $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\'?act=page&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
609 }
610 if (in_array('file',$allowedItems)){
611 $menuDef['file']['isActive'] = $this->act=='file';
612 $menuDef['file']['label'] = $LANG->getLL('file',1);
613 $menuDef['file']['url'] = '#';
614 $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\'?act=file&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
615 }
616 if (in_array('url',$allowedItems)) {
617 $menuDef['url']['isActive'] = $this->act=='url';
618 $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
619 $menuDef['url']['url'] = '#';
620 $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\'?act=url&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
621 }
622 if (in_array('mail',$allowedItems)) {
623 $menuDef['mail']['isActive'] = $this->act=='mail';
624 $menuDef['mail']['label'] = $LANG->getLL('email',1);
625 $menuDef['mail']['url'] = '#';
626 $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\'?act=mail&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
627 }
628 if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$allowedItems)) {
629 $menuDef['spec']['isActive'] = $this->act=='spec';
630 $menuDef['spec']['label'] = $LANG->getLL('special',1);
631 $menuDef['spec']['url'] = '#';
632 $menuDef['spec']['addParams'] = 'onclick="jumpToUrl(\'?act=spec&editorNo='.$this->editorNo.'&contentTypo3Language='.$this->contentTypo3Language.'&contentTypo3Charset='.$this->contentTypo3Charset.'\');return false;"';
633 }
634 $content .= $this->doc->getTabMenuRaw($menuDef);
635
636 // Adding the menu and header to the top of page:
637 $content.=$this->printCurrentUrl($this->curUrlInfo['info']).'<br />';
638
639 // Depending on the current action we will create the actual module content for selecting a link:
640 switch($this->act) {
641 case 'mail':
642 $extUrl='
643 <!--
644 Enter mail address:
645 -->
646 <form action="" name="lurlform" id="lurlform">
647 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
648 <tr>
649 <td>'.$LANG->getLL('emailAddress',1).':</td>
650 <td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
651 '<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="setTarget(\'\');setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
652 </tr>
653 </table>
654 </form>';
655 $content.=$extUrl;
656 $content.=$this->addAttributesForm();
657 break;
658 case 'url':
659 $extUrl='
660 <!--
661 Enter External URL:
662 -->
663 <form action="" name="lurlform" id="lurlform">
664 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
665 <tr>
666 <td>URL:</td>
667 <td><input type="text" name="lurl"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
668 '<input type="submit" value="'.$LANG->getLL('setLink',1).'" onclick="setValue(document.lurlform.lurl.value); return link_current();" /></td>
669 </tr>
670 </table>
671 </form>';
672 $content.=$extUrl;
673 $content.=$this->addAttributesForm();
674 break;
675 case 'file':
676 $content.=$this->addAttributesForm();
677
678 $foldertree = t3lib_div::makeInstance('tx_rtehtmlarea_folderTree');
679 $tree=$foldertree->getBrowsableTree();
680
681 if (!$this->curUrlInfo['value'] || $this->curUrlInfo['act']!='file') {
682 $cmpPath='';
683 } elseif (substr(trim($this->curUrlInfo['info']),-1)!='/') {
684 $cmpPath=PATH_site.dirname($this->curUrlInfo['info']).'/';
685 if (!isset($this->expandFolder)) $this->expandFolder = $cmpPath;
686 } else {
687 $cmpPath=PATH_site.$this->curUrlInfo['info'];
688 }
689
690 list(,,$specUid) = explode('_',$this->PM);
691 $files = $this->expandFolder($foldertree->specUIDmap[$specUid]);
692
693 // Create upload/create folder forms, if a path is given:
694 if ($BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) {
695 $fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
696 $fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
697 $path=$this->expandFolder;
698 if (!$path || !@is_dir($path)) {
699 $path = $fileProcessor->findTempFolder().'/'; // The closest TEMP-path is found
700 }
701 if ($path!='/' && @is_dir($path)) {
702 $uploadForm=$this->uploadForm($path);
703 $createFolder=$this->createFolder($path);
704 } else {
705 $createFolder='';
706 $uploadForm='';
707 }
708 $content.=$uploadForm;
709 if ($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB')) {
710 $content.=$createFolder;
711 }
712 }
713
714 $content.= '
715 <!--
716 Wrapper table for folder tree / file list:
717 -->
718 <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles">
719 <tr>
720 <td class="c-wCell" valign="top">'.$this->barheader($LANG->getLL('folderTree').':').$tree.'</td>
721 <td class="c-wCell" valign="top">'.$files.'</td>
722 </tr>
723 </table>
724 ';
725 break;
726 case 'spec':
727 if (is_array($this->thisConfig['userLinks.'])) {
728 $subcats=array();
729 $v=$this->thisConfig['userLinks.'];
730 reset($v);
731 while(list($k2)=each($v)) {
732 $k2i = intval($k2);
733 if (substr($k2,-1)=='.' && is_array($v[$k2i.'.'])) {
734
735 // Title:
736 $title = trim($v[$k2i]);
737 if (!$title) {
738 $title=$v[$k2i.'.']['url'];
739 } else {
740 $title=$LANG->sL($title);
741 }
742 // Description:
743 $description=$v[$k2i.'.']['description'] ? $LANG->sL($v[$k2i.'.']['description'],1).'<br />' : '';
744
745 // URL + onclick event:
746 $onClickEvent='';
747 if (isset($v[$k2i.'.']['target'])) $onClickEvent.="setTarget('".$v[$k2i.'.']['target']."');";
748 $v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
749 if (substr($v[$k2i.'.']['url'],0,7)=="http://" || substr($v[$k2i.'.']['url'],0,7)=='mailto:') {
750 $onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
751 } else {
752 $onClickEvent.="link_spec(unescape('".$this->siteURL.rawurlencode($v[$k2i.'.']['url'])."'));";
753 }
754
755 // Link:
756 $A=array('<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">','</a>');
757
758 // Adding link to menu of user defined links:
759 $subcats[$k2i]='
760 <tr>
761 <td class="bgColor4">'.$A[0].'<strong>'.htmlspecialchars($title).($this->curUrlInfo['info']==$v[$k2i.'.']['url']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" />':'').'</strong><br />'.$description.$A[1].'</td>
762 </tr>';
763 }
764 }
765
766 // Sort by keys:
767 ksort($subcats);
768
769 // Add menu to content:
770 $content.= '
771 <!--
772 Special userdefined menu:
773 -->
774 <table border="0" cellpadding="1" cellspacing="1" id="typo3-linkSpecial">
775 <tr>
776 <td class="bgColor5" class="c-wCell" valign="top"><strong>'.$LANG->getLL('special',1).'</strong></td>
777 </tr>
778 '.implode('',$subcats).'
779 </table>
780 ';
781 }
782 break;
783 case 'page':
784 default:
785 $content.=$this->addAttributesForm();
786
787 $pagetree = t3lib_div::makeInstance('tx_rtehtmlarea_pageTree');
788 $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
789 $pagetree->addField('nav_title');
790 $tree=$pagetree->getBrowsableTree();
791 $cElements = $this->expandPage();
792 $content.= '
793 <!--
794 Wrapper table for page tree / record list:
795 -->
796 <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
797 <tr>
798 <td class="c-wCell" valign="top">'.$this->barheader($LANG->getLL('pageTree').':').$tree.'</td>
799 <td class="c-wCell" valign="top">'.$cElements.'</td>
800 </tr>
801 </table>
802 ';
803 break;
804 }
805
806 // End page, return content:
807 $content.= $this->doc->endPage();
808 return $content;
809 }
810
811 function addAttributesForm() {
812 $ltargetForm = '';
813 // Add target and class selector box and title field:
814 $ltarget = $this->addTargetSelector();
815 $lclass = $this->addClassSelector();
816 $ltitle = $this->addTitleSelector();
817 if ($ltarget || $lclass || $ltitle) {
818 $ltargetForm = $this->wrapInForm($ltarget.$lclass.$ltitle);
819 }
820 return $ltargetForm;
821 }
822
823 function wrapInForm($string) {
824 global $LANG;
825
826 $form = '
827 <!--
828 Selecting target for link:
829 -->
830 <form action="" name="ltargetform" id="ltargetform">
831 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">'. $string;
832 if ((($this->act == 'page' && $this->curUrlInfo['act']=='page') || ($this->act == 'file' && $this->curUrlInfo['act']=='file') || ($this->act == 'url' && $this->curUrlInfo['act']!='page')) && $this->curUrlArray['href']) {
833 $form .='
834 <tr>
835 <td>
836 </td>
837 <td colspan="3">
838 <input type="submit" value="'.$LANG->getLL('update',1).'" onclick="return link_current();" />
839 </td>
840 </tr>';
841 }
842 $form .= '
843 </table>
844 </form>';
845 return $form;
846 }
847
848 function addTargetSelector() {
849 global $LANG;
850
851 $targetSelectorConfig = array();
852 $popupSelectorConfig = array();
853 if (is_array($this->buttonConfig['targetSelector.'])) {
854 $targetSelectorConfig = $this->buttonConfig['targetSelector.'];
855 }
856 if (is_array($this->buttonConfig['popupSelector.'])) {
857 $popupSelectorConfig = $this->buttonConfig['popupSelector.'];
858 }
859
860 $ltarget = '';
861 if ($this->act != 'mail') {
862 if (!($targetSelectorConfig['disabled'] && $popupSelectorConfig['disabled'])) {
863 $ltarget .= '
864 <tr>
865 <td>'.$LANG->getLL('target',1).':</td>
866 <td><input type="text" name="ltarget" onchange="setTarget(this.value);" value="'.htmlspecialchars($this->setTarget).'"'.$this->doc->formWidth(10).' /></td>';
867 $ltarget .= '
868 <td colspan="2">';
869 if (!$targetSelectorConfig['disabled']) {
870 $ltarget .= '
871 <select name="ltarget_type" onchange="setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
872 <option></option>
873 <option value="_top">'.$LANG->getLL('top',1).'</option>
874 <option value="_blank">'.$LANG->getLL('newWindow',1).'</option>
875 </select>';
876 }
877 $ltarget .= '
878 </td>';
879 }
880
881 $ltarget .= '
882 </tr>';
883 if (!$popupSelectorConfig['disabled']) {
884
885 $selectJS = 'if (document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value>0 && document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value>0) {
886 document.ltargetform.ltarget.value = document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value+\'x\'+document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value;
887 setTarget(document.ltargetform.ltarget.value);
888 document.ltargetform.popup_width.selectedIndex=0;
889 document.ltargetform.popup_height.selectedIndex=0;
890 }';
891
892 $ltarget.='
893 <tr>
894 <td>'.$LANG->getLL('target_popUpWindow',1).':</td>
895 <td colspan="3">
896 <select name="popup_width" onchange="'.$selectJS.'">
897 <option value="0">'.$LANG->getLL('target_popUpWindow_width',1).'</option>
898 <option value="300">300</option>
899 <option value="400">400</option>
900 <option value="500">500</option>
901 <option value="600">600</option>
902 <option value="700">700</option>
903 <option value="800">800</option>
904 </select>
905 x
906 <select name="popup_height" onchange="'.$selectJS.'">
907 <option value="0">'.$LANG->getLL('target_popUpWindow_height',1).'</option>
908 <option value="200">200</option>
909 <option value="300">300</option>
910 <option value="400">400</option>
911 <option value="500">500</option>
912 <option value="600">600</option>
913 </select>
914 </td>
915 </tr>';
916 }
917 }
918 return $ltarget;
919 }
920
921 function addClassSelector() {
922 global $LANG;
923
924 $selectClass = '';
925 if ($this->classesAnchorJSOptions[$this->act]) {
926 $selectClassJS = '
927 document.ltargetform.anchor_class.value = document.ltargetform.anchor_class.options[document.ltargetform.anchor_class.selectedIndex].value;
928 if(document.ltargetform.anchor_class.value && editor.classesAnchorSetup) {
929 for (var i = editor.classesAnchorSetup.length; --i >= 0;) {
930 var anchorClass = editor.classesAnchorSetup[i];
931 if (anchorClass[\'name\'] == document.ltargetform.anchor_class.value) {
932 if(anchorClass[\'titleText\'] && document.ltargetform.anchor_title) document.ltargetform.anchor_title.value = anchorClass[\'titleText\'];
933 break;
934 }
935 }
936 }
937 setClass(document.ltargetform.anchor_class.value);
938 ';
939 $selectClass ='
940 <tr>
941 <td>'.$LANG->getLL('anchor_class',1).':</td>
942 <td colspan="3">
943 <select name="anchor_class" onchange="'.$selectClassJS.'">
944 ' . $this->classesAnchorJSOptions[$this->act] . '
945 </select>
946 </td>
947 </tr>';
948 }
949 return $selectClass;
950 }
951
952 function addTitleSelector() {
953 global $LANG;
954
955 return '
956 <tr>
957 <td>'.$LANG->getLL('anchor_title',1).':</td>
958 <td colspan="3">
959 <input type="text" name="anchor_title" value="' . ($this->setTitle?$this->setTitle:($this->thisConfig['classesAnchor']?$this->classesAnchorDefaultTitle[$this->act]:'')) . '" ' . $this->doc->formWidth(30) . ' />
960 </td>
961 </tr>';
962 }
963
964 /**
965 * For TBE: Makes an upload form for uploading files to the filemount the user is browsing.
966 * The files are uploaded to the tce_file.php script in the core which will handle the upload.
967 *
968 * @param string Absolute filepath on server to which to upload.
969 * @return string HTML for an upload form.
970 */
971 function uploadForm($path) {
972 global $BACK_PATH;
973 $count=3;
974
975 // Create header, showing upload path:
976 $header = t3lib_div::isFirstPartOfStr($path,PATH_site)?substr($path,strlen(PATH_site)):$path;
977 $code=$this->barheader($GLOBALS['LANG']->getLL('uploadImage').':');
978 $code.='
979
980 <!--
981 Form, for uploading files:
982 -->
983 <form action="'.$BACK_PATH.'tce_file.php" method="post" name="editform" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'">
984 <table border="0" cellpadding="0" cellspacing="3" id="typo3-uplFiles">
985 <tr>
986 <td><strong>'.$GLOBALS['LANG']->getLL('path',1).':</strong> '.htmlspecialchars($header).'</td>
987 </tr>
988 <tr>
989 <td>';
990
991 // Traverse the number of upload fields (default is 3):
992 for ($a=1;$a<=$count;$a++) {
993 $code.='<input type="file" name="upload_'.$a.'"'.$this->doc->formWidth(35).' size="50" />
994 <input type="hidden" name="file[upload]['.$a.'][target]" value="'.htmlspecialchars($path).'" />
995 <input type="hidden" name="file[upload]['.$a.'][data]" value="'.$a.'" /><br />';
996 }
997
998 // Make footer of upload form, including the submit button:
999 $redirectValue = $this->thisScript.'?act='.$this->act.'&editorNo='.$this->editorNo.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
1000 $code.='<input type="hidden" name="redirect" value="'.htmlspecialchars($redirectValue).'" />'.
1001 '<input type="submit" name="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.submit',1).'" />';
1002
1003 $code.='
1004 <div id="c-override">
1005 <input type="checkbox" name="overwriteExistingFiles" value="1" /> '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:overwriteExistingFiles',1).'
1006 </div>
1007 ';
1008
1009
1010 $code.='</td>
1011 </tr>
1012 </table>
1013 </form>';
1014
1015 return $code;
1016 }
1017
1018 /**
1019 * For TBE: Makes a form for creating new folders in the filemount the user is browsing.
1020 * The folder creation request is sent to the tce_file.php script in the core which will handle the creation.
1021 *
1022 * @param string Absolute filepath on server in which to create the new folder.
1023 * @return string HTML for the create folder form.
1024 */
1025 function createFolder($path) {
1026 global $BACK_PATH;
1027 // Create header, showing upload path:
1028 $header = t3lib_div::isFirstPartOfStr($path,PATH_site)?substr($path,strlen(PATH_site)):$path;
1029 $code=$this->barheader($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle').':');
1030 $code.='
1031
1032 <!--
1033 Form, for creating new folders:
1034 -->
1035 <form action="'.$BACK_PATH.'tce_file.php" method="post" name="editform2">
1036 <table border="0" cellpadding="0" cellspacing="3" id="typo3-crFolder">
1037 <tr>
1038 <td><strong>'.$GLOBALS['LANG']->getLL('path',1).':</strong> '.htmlspecialchars($header).'</td>
1039 </tr>
1040 <tr>
1041 <td>';
1042
1043 // Create the new-folder name field:
1044 $a=1;
1045 $code.='<input'.$this->doc->formWidth(20).' type="text" name="file[newfolder]['.$a.'][data]" />'.
1046 '<input type="hidden" name="file[newfolder]['.$a.'][target]" value="'.htmlspecialchars($path).'" />';
1047
1048 // Make footer of upload form, including the submit button:
1049 $redirectValue = $this->thisScript.'?act='.$this->act.'&editorNo='.$this->editorNo.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
1050 $code.='<input type="hidden" name="redirect" value="'.htmlspecialchars($redirectValue).'" />'.
1051 '<input type="submit" name="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.submit',1).'" />';
1052
1053 $code.='</td>
1054 </tr>
1055 </table>
1056 </form>';
1057
1058 return $code;
1059 }
1060
1061 }
1062
1063 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']) {
1064 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']);
1065 }
1066
1067 ?>