/src/typo3_src-4.0.7/typo3/class.browse_links.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00118 require_once (PATH_t3lib.'class.t3lib_browsetree.php');
00119 require_once (PATH_t3lib.'class.t3lib_foldertree.php');
00120 require_once (PATH_t3lib.'class.t3lib_stdgraphic.php');
00121 require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
00122 
00123 
00124         // Include classes
00125 require_once (PATH_t3lib.'class.t3lib_page.php');
00126 require_once (PATH_t3lib.'class.t3lib_recordlist.php');
00127 require_once (PATH_typo3.'/class.db_list.inc');
00128 require_once (PATH_typo3.'/class.db_list_extra.inc');
00129 require_once (PATH_t3lib.'/class.t3lib_pagetree.php');
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00156 class TBE_browser_recordList extends localRecordList {
00157         var $thisScript = 'browse_links.php';
00158 
00164         function TBE_browser_recordList () {
00165                 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00166         }
00167 
00176         function listURL($altId='',$table=-1,$exclList='')      {
00177                 return $this->thisScript.
00178                         '?id='.(strcmp($altId,'')?$altId:$this->id).
00179                         '&table='.rawurlencode($table==-1?$this->table:$table).
00180                         ($this->thumbs?'&imagemode='.$this->thumbs:'').
00181                         ($this->searchString?'&search_field='.rawurlencode($this->searchString):'').
00182                         ($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):'').
00183                         ((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):'').
00184                         ((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'').
00185                                 // extra:
00186                         $this->ext_addP()
00187                         ;
00188         }
00189 
00195         function ext_addP()     {
00196                 $str = '&act='.$GLOBALS['SOBE']->browser->act.
00197                                 '&mode='.$GLOBALS['SOBE']->browser->mode.
00198                                 '&expandPage='.$GLOBALS['SOBE']->browser->expandPage.
00199                                 '&bparams='.rawurlencode($GLOBALS['SOBE']->browser->bparams);
00200                 return $str;
00201         }
00202 
00212         function linkWrapItems($table,$uid,$code,$row)  {
00213                 global $TCA, $BACK_PATH;
00214 
00215                 if (!$code) {
00216                         $code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i>';
00217                 } else {
00218                         $code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code,$this->fixedL));
00219                 }
00220 
00221                 $title = t3lib_BEfunc::getRecordTitle($table,$row);
00222                 $ficon = t3lib_iconWorks::getIcon($table,$row);
00223                 $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', ".t3lib_div::quoteJSvalue($title).", '', '', '".$ficon."');";
00224                 $ATag = '<a href="#" onclick="'.$aOnClick.'">';
00225                 $ATag_alt = substr($ATag,0,-4).',\'\',1);">';
00226                 $ATag_e = '</a>';
00227 
00228                 return $ATag.
00229                                 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->getLL('addToList',1).'" alt="" />'.
00230                                 $ATag_e.
00231                                 $ATag_alt.
00232                                 $code.
00233                                 $ATag_e;
00234         }
00235 
00243         function linkWrapTable($table,$code)    {
00244                 return $code;
00245         }
00246 }
00247 
00248 
00249 
00250 
00251 
00252 
00260 class localPageTree extends t3lib_browseTree {
00261 
00267         function localPageTree() {
00268                 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00269 
00270                 $this->init();
00271 
00272                 $this->clause = ' AND doktype!=255'.$this->clause;
00273         }
00274 
00283         function wrapTitle($title,$v,$ext_pArrPages='') {
00284                 if ($this->ext_isLinkable($v['doktype'],$v['uid']))     {
00285                         $aOnClick = "return link_typo3Page('".$v['uid']."');";
00286                         return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00287                 } else {
00288                         return '<span style="color: #666666;">'.$title.'</span>';
00289                 }
00290         }
00291 
00298         function printTree($treeArr='') {
00299                 global $BACK_PATH;
00300                 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
00301                 if (!is_array($treeArr))        $treeArr=$this->tree;
00302 
00303                 $out='';
00304                 $c=0;
00305 
00306                 foreach($treeArr as $k => $v)   {
00307                         $c++;
00308                         $bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
00309                         if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'])       {
00310                                 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
00311                                 $bgColorClass='bgColor4';
00312                         } else {
00313                                 $arrCol='<td></td>';
00314                         }
00315 
00316                         $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';
00317                         $cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
00318                                                 '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
00319                                                 '';
00320                         $out.='
00321                                 <tr class="'.$bgColorClass.'">
00322                                         <td nowrap="nowrap"'.($v['row']['_CSSCLASS'] ? ' class="'.$v['row']['_CSSCLASS'].'"' : '').'>'.
00323                                         $v['HTML'].
00324                                         $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$this->ext_pArrPages).
00325                                         '</td>'.
00326                                         $arrCol.
00327                                         '<td>'.$cEbullet.'</td>
00328                                 </tr>';
00329                 }
00330                 $out='
00331 
00332 
00333                         <!--
00334                                 Navigation Page Tree:
00335                         -->
00336                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
00337                                 '.$out.'
00338                         </table>';
00339                 return $out;
00340         }
00341 
00349         function ext_isLinkable($doktype,$uid)  {
00350                 if ($uid && $doktype<199)       {
00351                         return true;
00352                 }
00353         }
00354 
00363         function PM_ATagWrap($icon,$cmd,$bMark='')      {
00364                 if ($bMark)     {
00365                         $anchor = '#'.$bMark;
00366                         $name=' name="'.$bMark.'"';
00367                 }
00368                 $aOnClick = "return jumpToUrl('".$this->thisScript.'?PM='.$cmd."','".$anchor."');";
00369 
00370                 return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
00371         }
00372 
00380         function wrapIcon($icon,$row)   {
00381                 return $this->addTagAttributes($icon,' title="id='.$row['uid'].'"');
00382         }
00383 }
00384 
00385 
00386 
00387 
00388 
00389 
00390 
00391 
00399 class rtePageTree extends localPageTree {
00400 }
00401 
00402 
00403 
00404 
00405 
00406 
00407 
00408 
00416 class TBE_PageTree extends localPageTree {
00417 
00425         function ext_isLinkable($doktype,$uid)  {
00426                 return true;
00427         }
00428 
00437         function wrapTitle($title,$v,$ext_pArrPages)    {
00438                 if ($ext_pArrPages)     {
00439                         $ficon=t3lib_iconWorks::getIcon('pages',$v);
00440                         $onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
00441                 } else {
00442                         $onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['uid'].'\');');
00443                 }
00444                 return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
00445         }
00446 }
00447 
00448 
00449 
00450 
00451 
00452 
00453 
00454 
00463 class localFolderTree extends t3lib_folderTree {
00464         var $ext_IconMode=1;
00465 
00466 
00472         function localFolderTree() {
00473                 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00474                 $this->t3lib_folderTree();
00475         }
00476 
00484         function wrapTitle($title,$v)   {
00485                 if ($this->ext_isLinkable($v))  {
00486                         $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
00487                         return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00488                 } else {
00489                         return '<span class="typo3-dimmed">'.$title.'</span>';
00490                 }
00491         }
00492 
00499         function ext_isLinkable($v)     {
00500                 $webpath=t3lib_BEfunc::getPathType_web_nonweb($v['path']);      // Checking, if the input path is a web-path.
00501                 if (strstr($v['path'],'_recycler_') || strstr($v['path'],'_temp_') || $webpath!='web')  {
00502                         return 0;
00503                 }
00504                 return 1;
00505         }
00506 
00516         function PM_ATagWrap($icon,$cmd,$bMark='')      {
00517                 if ($bMark)     {
00518                         $anchor = '#'.$bMark;
00519                         $name=' name="'.$bMark.'"';
00520                 }
00521                 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?PM='.$cmd.'\',\''.$anchor.'\');';
00522                 return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
00523         }
00524 
00531         function printTree($treeArr='') {
00532                 global $BACK_PATH;
00533                 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
00534 
00535                 if (!is_array($treeArr))        $treeArr=$this->tree;
00536 
00537                 $out='';
00538                 $c=0;
00539 
00540                         // Preparing the current-path string (if found in the listing we will see a red blinking arrow).
00541                 if (!$GLOBALS['SOBE']->browser->curUrlInfo['value'])    {
00542                         $cmpPath='';
00543                 } else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/') {
00544                         $cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';
00545                 } else {
00546                         $cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];
00547                 }
00548 
00549                         // Traverse rows for the tree and print them into table rows:
00550                 foreach($treeArr as $k => $v)   {
00551                         $c++;
00552                         $bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
00553 
00554                                 // Creating blinking arrow, if applicable:
00555                         if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path'])        {
00556                                 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
00557                                 $bgColorClass='bgColor4';
00558                         } else {
00559                                 $arrCol='<td></td>';
00560                         }
00561                                 // Create arrow-bullet for file listing (if folder path is linkable):
00562                         $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
00563                         $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>' : '';
00564 
00565                                 // Put table row with folder together:
00566                         $out.='
00567                                 <tr class="'.$bgColorClass.'">
00568                                         <td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>
00569                                         '.$arrCol.'
00570                                         <td>'.$cEbullet.'</td>
00571                                 </tr>';
00572                 }
00573 
00574                 $out='
00575 
00576                         <!--
00577                                 Folder tree:
00578                         -->
00579                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
00580                                 '.$out.'
00581                         </table>';
00582                 return $out;
00583         }
00584 }
00585 
00586 
00587 
00588 
00589 
00590 
00598 class rteFolderTree extends localFolderTree {
00599 }
00600 
00601 
00602 
00603 
00604 
00605 
00606 
00614 class TBE_FolderTree extends localFolderTree {
00615         var $ext_noTempRecyclerDirs=0;          // If file-drag mode is set, temp and recycler folders are filtered out.
00616 
00623         function ext_isLinkable($v)     {
00624                 if ($this->ext_noTempRecyclerDirs && (substr($v['path'],-7)=='_temp_/' || substr($v['path'],-11)=='_recycler_/'))       {
00625                         return 0;
00626                 } return 1;
00627         }
00628 
00636         function wrapTitle($title,$v)   {
00637                 if ($this->ext_isLinkable($v))  {
00638                         $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
00639                         return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00640                 } else {
00641                         return '<span class="typo3-dimmed">'.$title.'</span>';
00642                 }
00643         }
00644 }
00645 
00646 
00647 
00648 
00649 
00657 class browse_links {
00658 
00659                 // Internal, static:
00660         var $siteURL;                   // Current site URL (Frontend)
00661         var $thisScript;                // the script to link to
00662         var $thisConfig;                // RTE specific TSconfig
00663         var $setTarget;                 // Target (RTE specific)
00664         var $setTitle;                  // title (RTE specific)
00665         var $doc;                               // Backend template object
00666 
00667                 // GPvars:      (Input variables from outside)
00678         var $mode;
00679 
00685         var $act;
00686 
00690         var $expandPage;
00691 
00695         var $expandFolder;
00696 
00697 
00698 
00702         var $P;
00703 
00718         var $bparams;
00719 
00724         var $RTEtsConfigParams;
00725 
00726 
00727 
00728 
00732         var $PM;
00733 
00737         var $pointer;
00738 
00739 
00740 
00741 
00745         var $curUrlArray;
00746 
00750         var $curUrlInfo;
00751 
00752 
00753 
00754 
00755 
00756 
00763         function init() {
00764                 global $BE_USER,$BACK_PATH;
00765 
00766                         // Main GPvars:
00767                 $this->pointer = t3lib_div::_GP('pointer');
00768                 $this->bparams = t3lib_div::_GP('bparams');
00769                 $this->P = t3lib_div::_GP('P');
00770                 $this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
00771                 $this->expandPage = t3lib_div::_GP('expandPage');
00772                 $this->expandFolder = t3lib_div::_GP('expandFolder');
00773                 $this->PM = t3lib_div::_GP('PM');
00774 
00775                         // Find "mode"
00776                 $this->mode=t3lib_div::_GP('mode');
00777                 if (!$this->mode)       {
00778                         $this->mode='rte';
00779                 }
00780 
00781                         // Site URL
00782                 $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');       // Current site url
00783 
00784                         // the script to link to
00785                 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00786 
00787                         // CurrentUrl - the current link url must be passed around if it exists
00788                 if ($this->mode=='wizard')      {
00789                         $currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
00790                         $this->curUrlArray = array(
00791                                 'target' => $currentLinkParts[1]
00792                         );
00793                         $this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);
00794                 } else {
00795                         $this->curUrlArray = t3lib_div::_GP('curUrl');
00796                         if ($this->curUrlArray['all'])  {
00797                                 $this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
00798                         }
00799                         $this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
00800                 }
00801 
00802                         // Determine nature of current url:
00803                 $this->act=t3lib_div::_GP('act');
00804                 if (!$this->act)        {
00805                         $this->act=$this->curUrlInfo['act'];
00806                 }
00807 
00808                         // Rich Text Editor specific configuration:
00809                 $addPassOnParams='';
00810                 if ((string)$this->mode=='rte') {
00811                         $RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);
00812                         $addPassOnParams.='&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);
00813                         $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
00814                         $this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
00815                 }
00816 
00817                         // Initializing the target value (RTE)
00818                 $this->setTarget = $this->curUrlArray['target'];
00819                 if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target']))     {
00820                         $this->setTarget=$this->thisConfig['defaultLinkTarget'];
00821                 }
00822 
00823                         // Initializing the title value (RTE)
00824                 $this->setTitle = $this->curUrlArray['title'];
00825 
00826 
00827 
00828                         // Creating backend template object:
00829                 $this->doc = t3lib_div::makeInstance('template');
00830                 $this->doc->docType= 'xhtml_trans';
00831                 $this->doc->backPath = $BACK_PATH;
00832 
00833                         // BEGIN accumulation of header JavaScript:
00834                 $JScode = '';
00835                 $JScode.= '
00836                                 // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
00837                         var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
00838                         var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'";
00839                         var add_title="'.($this->setTitle?'&curUrl[title]='.rawurlencode($this->setTitle):'').'";
00840                         var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
00841 
00842                         var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
00843                         var cur_target="'.($this->setTarget?$this->setTarget:'').'";
00844                         var cur_title="'.($this->setTitle?$this->setTitle:'').'";
00845 
00846                         function setTarget(target)      {       //
00847                                 cur_target=target;
00848                                 add_target="&curUrl[target]="+escape(target);
00849                         }
00850                         function setTitle(title)        {       //
00851                                 cur_title=title;
00852                                 add_title="&curUrl[title]="+escape(title);
00853                         }
00854                         function setValue(value)        {       //
00855                                 cur_href=value;
00856                                 add_href="&curUrl[href]="+value;
00857                         }
00858                 ';
00859 
00860 
00861                 if ($this->mode=='wizard')      {       // Functions used, if the link selector is in wizard mode (= TCEforms fields)
00862                         unset($this->P['fieldChangeFunc']['alert']);
00863                         reset($this->P['fieldChangeFunc']);
00864                         $update='';
00865                         while(list($k,$v)=each($this->P['fieldChangeFunc']))    {
00866                                 $update.= '
00867                                 window.opener.'.$v;
00868                         }
00869 
00870                         $P2=array();
00871                         $P2['itemName']=$this->P['itemName'];
00872                         $P2['formName']=$this->P['formName'];
00873                         $P2['fieldChangeFunc']=$this->P['fieldChangeFunc'];
00874                         $addPassOnParams.=t3lib_div::implodeArrayForUrl('P',$P2);
00875 
00876                         $JScode.='
00877                                 function link_typo3Page(id,anchor)      {       //
00878                                         updateValueInMainForm(id+(anchor?anchor:"")+" "+cur_target);
00879                                         close();
00880                                         return false;
00881                                 }
00882                                 function link_folder(folder)    {       //
00883                                         updateValueInMainForm(folder+" "+cur_target);
00884                                         close();
00885                                         return false;
00886                                 }
00887                                 function link_current() {       //
00888                                         if (cur_href!="http://" && cur_href!="mailto:") {
00889                                                 var setValue = cur_href+" "+cur_target+" "+cur_title;
00890                                                 if (setValue.substr(0,7)=="http://")    setValue = setValue.substr(7);
00891                                                 if (setValue.substr(0,7)=="mailto:")    setValue = setValue.substr(7);
00892                                                 updateValueInMainForm(setValue);
00893                                                 close();
00894                                         }
00895                                         return false;
00896                                 }
00897                                 function checkReference()       {       //
00898                                         if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"] ) {
00899                                                 return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"];
00900                                         } else {
00901                                                 close();
00902                                         }
00903                                 }
00904                                 function updateValueInMainForm(input)   {       //
00905                                         var field = checkReference();
00906                                         if (field)      {
00907                                                 field.value = input;
00908                                                 '.$update.'
00909                                         }
00910                                 }
00911                         ';
00912                 } else {        // Functions used, if the link selector is in RTE mode:
00913                         $JScode.='
00914                                 function link_typo3Page(id,anchor)      {       //
00915                                         var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
00916                                         self.parent.parent.renderPopup_addLink(theLink,cur_target,cur_title);
00917                                         return false;
00918                                 }
00919                                 function link_folder(folder)    {       //
00920                                         var theLink = \''.$this->siteURL.'\'+folder;
00921                                         self.parent.parent.renderPopup_addLink(theLink,cur_target,cur_title);
00922                                         return false;
00923                                 }
00924                                 function link_spec(theLink)     {       //
00925                                         self.parent.parent.renderPopup_addLink(theLink,cur_target,cur_title);
00926                                         return false;
00927                                 }
00928                                 function link_current() {       //
00929                                         if (cur_href!="http://" && cur_href!="mailto:") {
00930                                                 self.parent.parent.renderPopup_addLink(cur_href,cur_target,cur_title);
00931                                         }
00932                                         return false;
00933                                 }
00934                         ';
00935                 }
00936 
00937                         // General "jumpToUrl" function:
00938                 $JScode.='
00939                         function jumpToUrl(URL,anchor)  {       //
00940                                 var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
00941                                 var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
00942                                 var theLocation = URL+add_act+add_mode+add_href+add_target+add_title+add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
00943                                 window.location.href = theLocation;
00944                                 return false;
00945                         }
00946                 ';
00947 
00948 
00949                         // This is JavaScript especially for the TBE Element Browser!
00950                 $pArr = explode('|',$this->bparams);
00951                 $formFieldName = 'data['.$pArr[0].']['.$pArr[1].']['.$pArr[2].']';
00952                 $JScode.='
00953                         var elRef="";
00954                         var targetDoc="";
00955 
00956                         function launchView(url)        {       //
00957                                 var thePreviewWindow="";
00958                                 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");
00959                                 if (thePreviewWindow && thePreviewWindow.focus) {
00960                                         thePreviewWindow.focus();
00961                                 }
00962                         }
00963                         function setReferences()        {       //
00964                                 if (parent.window.opener
00965                                 && parent.window.opener.content
00966                                 && parent.window.opener.content.document.editform
00967                                 && parent.window.opener.content.document.editform["'.$formFieldName.'"]
00968                                                 ) {
00969                                         targetDoc = parent.window.opener.content.document;
00970                                         elRef = targetDoc.editform["'.$formFieldName.'"];
00971                                         return true;
00972                                 } else {
00973                                         return false;
00974                                 }
00975                         }
00976                         function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close)  {       //
00977                                 if (1=='.($pArr[0]&&!$pArr[1]&&!$pArr[2] ? 1 : 0).')    {
00978                                         addElement(filename,table+"_"+uid,fp,close);
00979                                 } else {
00980                                         if (setReferences())    {
00981                                                 parent.window.opener.group_change("add","'.$pArr[0].'","'.$pArr[1].'","'.$pArr[2].'",elRef,targetDoc);
00982                                         } else {
00983                                                 alert("Error - reference to main window is not set properly!");
00984                                         }
00985                                         if (close)      {
00986                                                 parent.window.opener.focus();
00987                                                 parent.close();
00988                                         }
00989                                 }
00990                                 return false;
00991                         }
00992                         function addElement(elName,elValue,altElValue,close)    {       //
00993                                 if (parent.window.opener && parent.window.opener.setFormValueFromBrowseWin)     {
00994                                         parent.window.opener.setFormValueFromBrowseWin("'.$pArr[0].'",altElValue?altElValue:elValue,elName);
00995                                         if (close)      {
00996                                                 parent.window.opener.focus();
00997                                                 parent.close();
00998                                         }
00999                                 } else {
01000                                         alert("Error - reference to main window is not set properly!");
01001                                         parent.close();
01002                                 }
01003                         }
01004                 ';
01005 
01006                         // Finally, add the accumulated JavaScript to the template object:
01007                 $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
01008 
01009                         // Debugging:
01010                 if (FALSE) debug(array(
01011                         'pointer' => $this->pointer,
01012                         'act' => $this->act,
01013                         'mode' => $this->mode,
01014                         'curUrlInfo' => $this->curUrlInfo,
01015                         'curUrlArray' => $this->curUrlArray,
01016                         'P' => $this->P,
01017                         'bparams' => $this->bparams,
01018                         'RTEtsConfigParams' => $this->RTEtsConfigParams,
01019                         'expandPage' => $this->expandPage,
01020                         'expandFolder' => $this->expandFolder,
01021                         'PM' => $this->PM,
01022                 ),'Internal variables of Script Class:');
01023         }
01024 
01025 
01033         function processSessionData($data) {
01034                 $store = false;
01035 
01036                 switch((string)$this->mode)     {
01037                         case 'db':
01038                                 if (isset($this->expandPage))   {
01039                                         $data['expandPage']=$this->expandPage;
01040                                         $store = true;
01041                                 } else {
01042                                         $this->expandPage=$data['expandPage'];
01043                                 }
01044                         break;
01045                         case 'file':
01046                         case 'filedrag':
01047                                 if (isset($this->expandFolder)) {
01048                                         $data['expandFolder']=$this->expandFolder;
01049                                         $store = true;
01050                                 } else {
01051                                         $this->expandFolder=$data['expandFolder'];
01052                                 }
01053                         break;
01054                 }
01055 
01056                 return array($data, $store);
01057         }
01058 
01059 
01060 
01061 
01062         /******************************************************************
01063          *
01064          * Main functions
01065          *
01066          ******************************************************************/
01067 
01076         function main_rte($wiz=0)       {
01077                 global $LANG, $BACK_PATH;
01078 
01079                         // Starting content:
01080                 $content=$this->doc->startPage('RTE link');
01081 
01082                         // Initializing the action value, possibly removing blinded values etc:
01083                 $allowedItems = array_diff(explode(',','page,file,url,mail,spec'),t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
01084                 reset($allowedItems);
01085                 if (!in_array($this->act,$allowedItems))        $this->act = current($allowedItems);
01086 
01087                         // Making menu in top:
01088                 $menuDef = array();
01089                 if (!$wiz)      {
01090                         $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
01091                         $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
01092                         $menuDef['removeLink']['url'] = '#';
01093                         $menuDef['removeLink']['addParams'] = 'onclick="self.parent.parent.renderPopup_unLink();return false;"';
01094                 }
01095                 if (in_array('page',$allowedItems)) {
01096                         $menuDef['page']['isActive'] = $this->act=='page';
01097                         $menuDef['page']['label'] = $LANG->getLL('page',1);
01098                         $menuDef['page']['url'] = '#';
01099                         $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\'?act=page\');return false;"';
01100                 }
01101                 if (in_array('file',$allowedItems)){
01102                         $menuDef['file']['isActive'] = $this->act=='file';
01103                         $menuDef['file']['label'] = $LANG->getLL('file',1);
01104                         $menuDef['file']['url'] = '#';
01105                         $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\'?act=file\');return false;"';
01106                 }
01107                 if (in_array('url',$allowedItems)) {
01108                         $menuDef['url']['isActive'] = $this->act=='url';
01109                         $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
01110                         $menuDef['url']['url'] = '#';
01111                         $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\'?act=url\');return false;"';
01112                 }
01113                 if (in_array('mail',$allowedItems)) {
01114                         $menuDef['mail']['isActive'] = $this->act=='mail';
01115                         $menuDef['mail']['label'] = $LANG->getLL('email',1);
01116                         $menuDef['mail']['url'] = '#';
01117                         $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\'?act=mail\');return false;"';
01118                 }
01119                 if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$allowedItems)) {
01120                         $menuDef['spec']['isActive'] = $this->act=='spec';
01121                         $menuDef['spec']['label'] = $LANG->getLL('special',1);
01122                         $menuDef['spec']['url'] = '#';
01123                         $menuDef['spec']['addParams'] = 'onclick="jumpToUrl(\'?act=spec\');return false;"';
01124                 }
01125                 $content .= $this->doc->getTabMenuRaw($menuDef);
01126 
01127                         // Adding the menu and header to the top of page:
01128                 $content.=$this->printCurrentUrl($this->curUrlInfo['info']).'<br />';
01129 
01130 
01131                         // Depending on the current action we will create the actual module content for selecting a link:
01132                 switch($this->act)      {
01133                         case 'mail':
01134                                 $extUrl='
01135 
01136                         <!--
01137                                 Enter mail address:
01138                         -->
01139                                         <form action="" name="lurlform" id="lurlform">
01140                                                 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
01141                                                         <tr>
01142                                                                 <td>'.$GLOBALS['LANG']->getLL('emailAddress',1).':</td>
01143                                                                 <td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
01144                                                                         '<input type="submit" value="'.$GLOBALS['LANG']->getLL('setLink',1).'" onclick="setTarget(\'\');setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
01145                                                         </tr>
01146                                                 </table>
01147                                         </form>';
01148                                 $content.=$extUrl;
01149                         break;
01150                         case 'url':
01151                                 $extUrl='
01152 
01153                         <!--
01154                                 Enter External URL:
01155                         -->
01156                                         <form action="" name="lurlform" id="lurlform">
01157                                                 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
01158                                                         <tr>
01159                                                                 <td>URL:</td>
01160                                                                 <td><input type="text" name="lurl"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
01161                                                                         '<input type="submit" value="'.$GLOBALS['LANG']->getLL('setLink',1).'" onclick="setValue(document.lurlform.lurl.value); return link_current();" /></td>
01162                                                         </tr>
01163                                                 </table>
01164                                         </form>';
01165                                 $content.=$extUrl;
01166                         break;
01167                         case 'file':
01168                                 $foldertree = t3lib_div::makeInstance('rteFolderTree');
01169                                 $foldertree->thisScript = $this->thisScript;
01170                                 $tree=$foldertree->getBrowsableTree();
01171 
01172                                 if (!$this->curUrlInfo['value'] || $this->curUrlInfo['act']!='file')    {
01173                                         $cmpPath='';
01174                                 } elseif (substr(trim($this->curUrlInfo['info']),-1)!='/')      {
01175                                         $cmpPath=PATH_site.dirname($this->curUrlInfo['info']).'/';
01176                                         if (!isset($this->expandFolder))                        $this->expandFolder = $cmpPath;
01177                                 } else {
01178                                         $cmpPath=PATH_site.$this->curUrlInfo['info'];
01179                                 }
01180 
01181                                 list(,,$specUid) = explode('_',$this->PM);
01182                                 $files = $this->expandFolder($foldertree->specUIDmap[$specUid]);
01183 
01184                                 $content.= '
01185 
01186                         <!--
01187                                 Wrapper table for folder tree / file list:
01188                         -->
01189                                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles">
01190                                                 <tr>
01191                                                         <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01192                                                         <td class="c-wCell" valign="top">'.$files.'</td>
01193                                                 </tr>
01194                                         </table>
01195                                         ';
01196                         break;
01197                         case 'spec':
01198                                 if (is_array($this->thisConfig['userLinks.']))  {
01199                                         $subcats=array();
01200                                         $v=$this->thisConfig['userLinks.'];
01201                                         reset($v);
01202                                         while(list($k2)=each($v))       {
01203                                                 $k2i = intval($k2);
01204                                                 if (substr($k2,-1)=='.' && is_array($v[$k2i.'.']))      {
01205 
01206                                                                 // Title:
01207                                                         $title = trim($v[$k2i]);
01208                                                         if (!$title)    {
01209                                                                 $title=$v[$k2i.'.']['url'];
01210                                                         } else {
01211                                                                 $title=$LANG->sL($title);
01212                                                         }
01213                                                                 // Description:
01214                                                         $description=$v[$k2i.'.']['description'] ? $LANG->sL($v[$k2i.'.']['description'],1).'<br />' : '';
01215 
01216                                                                 // URL + onclick event:
01217                                                         $onClickEvent='';
01218                                                         if (isset($v[$k2i.'.']['target']))      $onClickEvent.="setTarget('".$v[$k2i.'.']['target']."');";
01219                                                         $v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
01220                                                         if (substr($v[$k2i.'.']['url'],0,7)=='http://' || substr($v[$k2i.'.']['url'],0,7)=='mailto:')   {
01221                                                                 $onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
01222                                                         } else {
01223                                                                 $onClickEvent.="link_spec(unescape('".$this->siteURL.rawurlencode($v[$k2i.'.']['url'])."'));";
01224                                                         }
01225 
01226                                                                 // Link:
01227                                                         $A=array('<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">','</a>');
01228 
01229                                                                 // Adding link to menu of user defined links:
01230                                                         $subcats[$k2i]='
01231                                                                 <tr>
01232                                                                         <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>
01233                                                                 </tr>';
01234                                                 }
01235                                         }
01236 
01237                                                 // Sort by keys:
01238                                         ksort($subcats);
01239 
01240                                                 // Add menu to content:
01241                                         $content.= '
01242 
01243                         <!--
01244                                 Special userdefined menu:
01245                         -->
01246                                                 <table border="0" cellpadding="1" cellspacing="1" id="typo3-linkSpecial">
01247                                                         <tr>
01248                                                                 <td class="bgColor5" class="c-wCell" valign="top"><strong>'.$LANG->getLL('special',1).'</strong></td>
01249                                                         </tr>
01250                                                         '.implode('',$subcats).'
01251                                                 </table>
01252                                                 ';
01253                                 }
01254                         break;
01255                         case 'page':
01256                         default:
01257                                 $pagetree = t3lib_div::makeInstance('rtePageTree');
01258                                 $pagetree->thisScript = $this->thisScript;
01259                                 $tree=$pagetree->getBrowsableTree();
01260                                 $cElements = $this->expandPage();
01261                                 $content.= '
01262 
01263                         <!--
01264                                 Wrapper table for page tree / record list:
01265                         -->
01266                                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
01267                                                 <tr>
01268                                                         <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
01269                                                         <td class="c-wCell" valign="top">'.$cElements.'</td>
01270                                                 </tr>
01271                                         </table>
01272                                         ';
01273                         break;
01274                 }
01275 
01276                 $content .= '
01277 
01278 
01279 
01280                         <!--
01281                                 Selecting title for link:
01282                         -->
01283                                 <form action="" name="ltitleform" id="ltargetform">
01284                                         <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
01285                                                 <tr>
01286                                                         <td>'.$GLOBALS['LANG']->getLL('title',1).'</td>
01287                                                         <td><input type="text" name="ltitle" onchange="setTitle(this.value);" value="'.htmlspecialchars($this->setTitle).'"'.$this->doc->formWidth(10).' /></td>
01288                                                         <td><input type="submit" value="'.$GLOBALS['LANG']->getLL('update',1).'" onclick="return link_current();" /></td>
01289                                                 </tr>
01290                                         </table>
01291                                 </form>
01292 ';
01293 
01294                         // Target:
01295                 if ($this->act!='mail') {
01296                         $ltarget='
01297 
01298 
01299 
01300                         <!--
01301                                 Selecting target for link:
01302                         -->
01303                                 <form action="" name="ltargetform" id="ltargetform">
01304                                         <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
01305                                                 <tr>
01306                                                         <td>'.$GLOBALS['LANG']->getLL('target',1).':</td>
01307                                                         <td><input type="text" name="ltarget" onchange="setTarget(this.value);" value="'.htmlspecialchars($this->setTarget).'"'.$this->doc->formWidth(10).' /></td>
01308                                                         <td>
01309                                                                 <select name="ltarget_type" onchange="setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
01310                                                                         <option></option>
01311                                                                         <option value="_top">'.$GLOBALS['LANG']->getLL('top',1).'</option>
01312                                                                         <option value="_blank">'.$GLOBALS['LANG']->getLL('newWindow',1).'</option>
01313                                                                 </select>
01314                                                         </td>
01315                                                         <td>';
01316 
01317                         if (($this->curUrlInfo['act']=="page" || $this->curUrlInfo['act']=='file') && $this->curUrlArray['href'])       {
01318                                 $ltarget.='
01319                                                         <input type="submit" value="'.$GLOBALS['LANG']->getLL('update',1).'" onclick="return link_current();" />';
01320                         }
01321 
01322                         $selectJS = '
01323                                 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)     {
01324                                         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;
01325                                         setTarget(document.ltargetform.ltarget.value);
01326                                 setTitle(document.ltitleform.ltitle.value);
01327                                         document.ltargetform.popup_width.selectedIndex=0;
01328                                         document.ltargetform.popup_height.selectedIndex=0;
01329                                 }
01330                         ';
01331 
01332                         $ltarget.='             </td>
01333                                                 </tr>
01334                                                 <tr>
01335                                                         <td>'.$GLOBALS['LANG']->getLL('target_popUpWindow',1).':</td>
01336                                                         <td colspan="3">
01337                                                                 <select name="popup_width" onchange="'.htmlspecialchars($selectJS).'">
01338                                                                         <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_width',1).'</option>
01339                                                                         <option value="300">300</option>
01340                                                                         <option value="400">400</option>
01341                                                                         <option value="500">500</option>
01342                                                                         <option value="600">600</option>
01343                                                                         <option value="700">700</option>
01344                                                                         <option value="800">800</option>
01345                                                                 </select>
01346                                                                 x
01347                                                                 <select name="popup_height" onchange="'.htmlspecialchars($selectJS).'">
01348                                                                         <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_height',1).'</option>
01349                                                                         <option value="200">200</option>
01350                                                                         <option value="300">300</option>
01351                                                                         <option value="400">400</option>
01352                                                                         <option value="500">500</option>
01353                                                                         <option value="600">600</option>
01354                                                                 </select>
01355                                                         </td>
01356                                                 </tr>
01357                                         </table>
01358                                 </form>';
01359 
01360                                 // Add "target selector" box to content:
01361                         $content.=$ltarget;
01362 
01363                                 // Add some space
01364                         $content.='<br /><br />';
01365                 }
01366 
01367                         // End page, return content:
01368                 $content.= $this->doc->endPage();
01369                 $content = $this->doc->insertStylesAndJS($content);
01370                 return $content;
01371         }
01372 
01378         function main_db()      {
01379 
01380                         // Starting content:
01381                 $content=$this->doc->startPage('TBE file selector');
01382 
01383                         // Init variable:
01384                 $pArr = explode('|',$this->bparams);
01385 
01386                         // Making the browsable pagetree:
01387                 $pagetree = t3lib_div::makeInstance('TBE_PageTree');
01388                 $pagetree->thisScript=$this->thisScript;
01389                 $pagetree->ext_pArrPages = !strcmp($pArr[3],'pages')?1:0;
01390                 $tree=$pagetree->getBrowsableTree();
01391 
01392                         // Making the list of elements, if applicable:
01393                 $cElements = $this->TBE_expandPage($pArr[3]);
01394 
01395                         // Putting the things together, side by side:
01396                 $content.= '
01397 
01398                         <!--
01399                                 Wrapper table for page tree / record list:
01400                         -->
01401                         <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBrecords">
01402                                 <tr>
01403                                         <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
01404                                         <td class="c-wCell" valign="top">'.$cElements.'</td>
01405                                 </tr>
01406                         </table>
01407                         ';
01408 
01409                         // Add some space
01410                 $content.='<br /><br />';
01411 
01412                         // End page, return content:
01413                 $content.= $this->doc->endPage();
01414                 $content = $this->doc->insertStylesAndJS($content);
01415                 return $content;
01416         }
01417 
01423         function main_file()    {
01424                 global $BE_USER;
01425 
01426                         // Starting content:
01427                 $content.=$this->doc->startPage('TBE file selector');
01428 
01429                         // Init variable:
01430                 $pArr = explode('|',$this->bparams);
01431 
01432                         // Create upload/create folder forms, if a path is given:
01433                 $fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
01434                 $fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
01435                 $path=$this->expandFolder;
01436                 if (!$path || !@is_dir($path))  {
01437                         $path = $fileProcessor->findTempFolder().'/';   // The closest TEMP-path is found
01438                 }
01439                 if ($path!='/' && @is_dir($path))       {
01440                         $uploadForm=$this->uploadForm($path);
01441                         $createFolder=$this->createFolder($path);
01442                 } else {
01443                         $createFolder='';
01444                         $uploadForm='';
01445                 }
01446                 if ($BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB'))  $content.=$uploadForm;
01447 
01448                         // Getting flag for showing/not showing thumbnails:
01449                 $noThumbs = $GLOBALS['BE_USER']->getTSConfigVal('options.noThumbsInEB');
01450 
01451                 if (!$noThumbs) {
01452                                 // MENU-ITEMS, fetching the setting for thumbnails from File>List module:
01453                         $_MOD_MENU = array('displayThumbs' => '');
01454                         $_MCONF['name']='file_list';
01455                         $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']);
01456                         $addParams = '&act='.$this->act.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
01457                         $thumbNailCheck = t3lib_BEfunc::getFuncCheck('','SET[displayThumbs]',$_MOD_SETTINGS['displayThumbs'],$this->thisScript,$addParams).' '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs',1);
01458                 } else {
01459                         $thumbNailCheck='';
01460                 }
01461                 $noThumbs = $noThumbs?$noThumbs:!$_MOD_SETTINGS['displayThumbs'];
01462 
01463                         // Create folder tree:
01464                 $foldertree = t3lib_div::makeInstance('TBE_FolderTree');
01465                 $foldertree->thisScript=$this->thisScript;
01466                 $foldertree->ext_noTempRecyclerDirs = ($this->mode == 'filedrag');
01467                 $tree=$foldertree->getBrowsableTree();
01468 
01469                 list(,,$specUid) = explode('_',$this->PM);
01470 
01471                 if ($this->mode=='filedrag')    {
01472                         $files = $this->TBE_dragNDrop($foldertree-