Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

localFolderTree::SC_browse_links Class Reference

List of all members.

Public Member Functions

 init ()
 Constructor: Initializes a lot of variables, setting JavaScript functions in header etc.
 main ()
 Main function, detecting the current mode of the element browser and branching out to internal methods.
 printContent ()
 Print module content.
 main_rte ($wiz=0)
 Rich Text Editor (RTE) link selector (MAIN function) Generates the link selector for the Rich Text Editor.
 main_db ()
 TYPO3 Element Browser: Showing a page tree and allows you to browse for records.
 main_file ()
 TYPO3 Element Browser: Showing a folder tree, allowing you to browse for files.
 expandPage ()
 For RTE: This displays all content elements on a page and lets you create a link to the element.

Public Attributes

 $siteURL
 $thisConfig
 $setTarget
 $doc
 $mode
 The mode determines the main kind of output from the element browser.
 $act
 Link selector action.
 $expandPage
 When you click a page title/expand icon to see the content of a certain page, this value will contain that value (the ID of the expanded page).
 $expandFolder
 When you click a folder name/expand icon to see the content of a certain file folder, this value will contain that value (the path of the expanded file folder).
 $P
 TYPO3 Element Browser, wizard mode parameters.
 $bparams
 Active with TYPO3 Element Browser: Contains the name of the form field for which this window opens - thus allows us to make references back to the main window in which the form is.
 $RTEtsConfigParams
 Used with the Rich Text Editor.
 $PM
 Plus/Minus icon value.
 $pointer
 Pointer, used when browsing a long list of records etc.
 $curUrlArray
 Used with the link selector: Contains the GET input information about the CURRENT link in the RTE/TCEform field.
 $curUrlInfo
 Used with the link selector: Contains a processed version of the input values from curUrlInfo.

Member Function Documentation

localFolderTree::SC_browse_links::expandPage  ) 
 

For RTE: This displays all content elements on a page and lets you create a link to the element.

Returns:
string HTML output. Returns content only if the ->expandPage value is set (pointing to a page uid to show tt_content records from ...)

For RTE: This displays all files from folder. No thumbnails shown

Parameters:
string The folder path to expand
string List of fileextensions to show
Returns:
string HTML output

For TYPO3 Element Browser: Expand folder of files.

Parameters:
string The folder path to expand
string List of fileextensions to show
boolean Whether to show thumbnails or not. If set, no thumbnails are shown.
Returns:
string HTML output

Render list of files.

Parameters:
array List of files. See t3lib_div::getFilesInDir
string If set a header with a folder icon and folder name are shown
boolean Whether to show thumbnails or not. If set, no thumbnails are shown.
Returns:
string HTML output

For RTE: This displays all IMAGES (gif,png,jpg) (from extensionList) from folder. Thumbnails are shown for images. This listing is of images located in the web-accessible paths ONLY - the listing is for drag-n-drop use in the RTE

Parameters:
string The folder path to expand
string List of fileextensions to show
Returns:
string HTML output

Verifies that a path is a web-folder:

Parameters:
string Absolute filepath
Returns:
boolean If the input path is found in PATH_site then it returns true.

Checks, if a path is within the mountpoints of the backend user

Parameters:
string Absolute filepath
Returns:
boolean If the input path is found in the backend users filemounts, then return true.

Prints a 'header' where string is in a tablecell

Parameters:
string The string to print in the header. The value is htmlspecialchars()'ed before output.
Returns:
string The header HTML (wrapped in a table)

Displays a message box with the input message

Parameters:
string Input message to show (will be htmlspecialchars()'ed inside of this function)
string Icon filename body from gfx/ (default is "icon_note") - meant to allow change to warning type icons...
Returns:
string HTML for the message (wrapped in a table).

For RTE/link: This prints the 'currentUrl'

Parameters:
string URL value. The value is htmlspecialchars()'ed before output.
Returns:
string HTML content, wrapped in a table.

For RTE/link: Parses the incoming URL and determines if it's a page, file, external or mail address.

Parameters:
string HREF value tp analyse
string The URL of the current website (frontend)
Returns:
array Array with URL information stored in assoc. keys: value, act (page, file, spec, mail), pageid, cElement, info

Definition at line 1489 of file browse_links.php.

References $LANG, $out, t3lib_BEfunc::getFileIcon(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordsByField(), t3lib_BEfunc::getThumbNail(), header(), PATH_site, t3lib_BEfunc::readPageAccess(), siteUrl(), and table().

localFolderTree::SC_browse_links::init  ) 
 

Constructor: Initializes a lot of variables, setting JavaScript functions in header etc.

Returns:
void

Definition at line 729 of file browse_links.php.

References debug(), RTEsetup(), and table().

00729                      {
00730       global $BE_USER,$BACK_PATH;
00731 
00732          // Main GPvars:
00733       $this->pointer = t3lib_div::_GP('pointer');
00734       $this->bparams = t3lib_div::_GP('bparams');
00735       $this->P = t3lib_div::_GP('P');
00736       $this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
00737       $this->expandPage = t3lib_div::_GP('expandPage');
00738       $this->expandFolder = t3lib_div::_GP('expandFolder');
00739       $this->PM = t3lib_div::_GP('PM');
00740 
00741          // Find "mode"
00742       $this->mode=t3lib_div::_GP('mode');
00743       if (!$this->mode) {
00744          $this->mode='rte';
00745       }
00746 
00747          // Site URL
00748       $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');   // Current site url
00749 
00750          // CurrentUrl - the current link url must be passed around if it exists
00751       if ($this->mode=='wizard') {
00752          $currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
00753          $this->curUrlArray = array(
00754             'target' => $currentLinkParts[1]
00755          );
00756          $this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);
00757       } else {
00758          $this->curUrlArray = t3lib_div::_GP('curUrl');
00759          if ($this->curUrlArray['all'])   {
00760             $this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
00761          }
00762          $this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
00763       }
00764 
00765          // Determine nature of current url:
00766       $this->act=t3lib_div::_GP('act');
00767       if (!$this->act)  {
00768          $this->act=$this->curUrlInfo['act'];
00769       }
00770 
00771          // Rich Text Editor specific configuration:
00772       $addPassOnParams='';
00773       if ((string)$this->mode=='rte')  {
00774          $RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);
00775          $addPassOnParams.='&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);
00776          $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
00777          $this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
00778       }
00779 
00780          // Initializing the target value (RTE)
00781       $this->setTarget = $this->curUrlArray['target'];
00782       if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target'])) {
00783          $this->setTarget=$this->thisConfig['defaultLinkTarget'];
00784       }
00785 
00786 
00787 
00788          // Creating backend template object:
00789       $this->doc = t3lib_div::makeInstance('template');
00790       $this->doc->docType= 'xhtml_trans';
00791       $this->doc->backPath = $BACK_PATH;
00792 
00793          // BEGIN accumulation of header JavaScript:
00794       $JScode = '';
00795       $JScode.= '
00796             // This JavaScript is primarily for RTE/Link. jumpToUrl is used in the other cases as well...
00797          var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
00798          var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'";
00799          var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
00800 
00801          var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
00802          var cur_target="'.($this->setTarget?$this->setTarget:'').'";
00803 
00804          function setTarget(target) {  //
00805             cur_target=target;
00806             add_target="&curUrl[target]="+escape(target);
00807          }
00808          function setValue(value)   {  //
00809             cur_href=value;
00810             add_href="&curUrl[href]="+value;
00811          }
00812       ';
00813 
00814 
00815       if ($this->mode=='wizard') {  // Functions used, if the link selector is in wizard mode (= TCEforms fields)
00816          unset($this->P['fieldChangeFunc']['alert']);
00817          reset($this->P['fieldChangeFunc']);
00818          $update='';
00819          while(list($k,$v)=each($this->P['fieldChangeFunc']))  {
00820             $update.= '
00821             window.opener.'.$v;
00822          }
00823 
00824          $P2=array();
00825          $P2['itemName']=$this->P['itemName'];
00826          $P2['formName']=$this->P['formName'];
00827          $P2['fieldChangeFunc']=$this->P['fieldChangeFunc'];
00828          $addPassOnParams.=t3lib_div::implodeArrayForUrl('P',$P2);
00829 
00830          $JScode.='
00831             function link_typo3Page(id,anchor)  {  //
00832                updateValueInMainForm(id+(anchor?anchor:"")+" "+cur_target);
00833                close();
00834                return false;
00835             }
00836             function link_folder(folder)  {  //
00837                updateValueInMainForm(folder+" "+cur_target);
00838                close();
00839                return false;
00840             }
00841             function link_current() {  //
00842                if (cur_href!="http://" && cur_href!="mailto:") {
00843                   var setValue = cur_href+" "+cur_target;
00844                   if (setValue.substr(0,7)=="http://")   setValue = setValue.substr(7);
00845                   if (setValue.substr(0,7)=="mailto:")   setValue = setValue.substr(7);
00846                   updateValueInMainForm(setValue);
00847                   close();
00848                }
00849                return false;
00850             }
00851             function checkReference()  {  //
00852                if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"] )  {
00853                   return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"];
00854                } else {
00855                   close();
00856                }
00857             }
00858             function updateValueInMainForm(input)  {  //
00859                var field = checkReference();
00860                if (field)  {
00861                   field.value = input;
00862                   '.$update.'
00863                }
00864             }
00865          ';
00866       } else { // Functions used, if the link selector is in RTE mode:
00867          $JScode.='
00868             function link_typo3Page(id,anchor)  {  //
00869                var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
00870                self.parent.parent.renderPopup_addLink(theLink,cur_target);
00871                return false;
00872             }
00873             function link_folder(folder)  {  //
00874                var theLink = \''.$this->siteURL.'\'+folder;
00875                self.parent.parent.renderPopup_addLink(theLink,cur_target);
00876                return false;
00877             }
00878             function link_spec(theLink)   {  //
00879                self.parent.parent.renderPopup_addLink(theLink,cur_target);
00880                return false;
00881             }
00882             function link_current() {  //
00883                if (cur_href!="http://" && cur_href!="mailto:") {
00884                   self.parent.parent.renderPopup_addLink(cur_href,cur_target);
00885                }
00886                return false;
00887             }
00888          ';
00889       }
00890 
00891          // General "jumpToUrl" function:
00892       $JScode.='
00893          function jumpToUrl(URL,anchor)   {  //
00894             var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
00895             var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
00896             var theLocation = URL+add_act+add_mode+add_href+add_target+add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
00897             document.location = theLocation;
00898             return false;
00899          }
00900       ';
00901 
00902 
00903          // This is JavaScript especially for the TBE Element Browser!
00904       $pArr = explode('|',$this->bparams);
00905       $formFieldName = 'data['.$pArr[0].']['.$pArr[1].']['.$pArr[2].']';
00906       $JScode.='
00907          var elRef="";
00908          var targetDoc="";
00909 
00910          function launchView(url)   {  //
00911             var thePreviewWindow="";
00912             thePreviewWindow = window.open("show_item.php?table="+url,"ShowItem","height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
00913             if (thePreviewWindow && thePreviewWindow.focus) {
00914                thePreviewWindow.focus();
00915             }
00916          }
00917          function setReferences()   {  //
00918             if (parent.window.opener
00919             && parent.window.opener.content
00920             && parent.window.opener.content.document.editform
00921             && parent.window.opener.content.document.editform["'.$formFieldName.'"]
00922                   ) {
00923                targetDoc = parent.window.opener.content.document;
00924                elRef = targetDoc.editform["'.$formFieldName.'"];
00925                return true;
00926             } else {
00927                return false;
00928             }
00929          }
00930          function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close) {  //
00931             if (1=='.($pArr[0]&&!$pArr[1]&&!$pArr[2] ? 1 : 0).')  {
00932                addElement(filename,table+"_"+uid,fp,close);
00933             } else {
00934                if (setReferences()) {
00935                   parent.window.opener.group_change("add","'.$pArr[0].'","'.$pArr[1].'","'.$pArr[2].'",elRef,targetDoc);
00936                } else {
00937                   alert("Error - reference to main window is not set properly!");
00938                }
00939                if (close)  {
00940                   parent.window.opener.focus();
00941                   parent.close();
00942                }
00943             }
00944             return false;
00945          }
00946          function addElement(elName,elValue,altElValue,close)  {  //
00947             if (parent.window.opener && parent.window.opener.setFormValueFromBrowseWin)   {
00948                parent.window.opener.setFormValueFromBrowseWin("'.$pArr[0].'",altElValue?altElValue:elValue,elName);
00949                if (close)  {
00950                   parent.window.opener.focus();
00951                   parent.close();
00952                }
00953             } else {
00954                alert("Error - reference to main window is not set properly!");
00955                parent.close();
00956             }
00957          }
00958       ';
00959 
00960          // Finally, add the accumulated JavaScript to the template object:
00961       $this->doc->JScode = $this->doc->wrapScriptTags($JScode);
00962 
00963          // Debugging:
00964       if (FALSE) debug(array(
00965          'pointer' => $this->pointer,
00966          'act' => $this->act,
00967          'mode' => $this->mode,
00968          'curUrlInfo' => $this->curUrlInfo,
00969          'curUrlArray' => $this->curUrlArray,
00970          'P' => $this->P,
00971          'bparams' => $this->bparams,
00972          'RTEtsConfigParams' => $this->RTEtsConfigParams,
00973          'expandPage' => $this->expandPage,
00974          'expandFolder' => $this->expandFolder,
00975          'PM' => $this->PM,
00976       ),'Internal variables of Script Class:');
00977    }

localFolderTree::SC_browse_links::main  ) 
 

Main function, detecting the current mode of the element browser and branching out to internal methods.

Returns:
void

Definition at line 984 of file browse_links.php.

00984                      {
00985       global $BE_USER;
00986 
00987       $modData = $BE_USER->getModuleData('browse_links.php','ses');
00988 
00989          // Output the correct content according to $this->mode
00990       switch((string)$this->mode)   {
00991          case 'rte':
00992             $this->content=$this->main_rte();
00993          break;
00994          case 'db':
00995             if (isset($this->expandPage)) {
00996                $modData['expandPage']=$this->expandPage;
00997                $BE_USER->pushModuleData('browse_links.php',$modData);
00998             } else {
00999                $this->expandPage=$modData['expandPage'];
01000             }
01001 
01002             $this->content=$this->main_db();
01003          break;
01004          case 'file':
01005          case 'filedrag':
01006             if (isset($this->expandFolder))  {
01007                $modData['expandFolder']=$this->expandFolder;
01008                $BE_USER->pushModuleData('browse_links.php',$modData);
01009             } else {
01010                $this->expandFolder=$modData['expandFolder'];
01011             }
01012 
01013             $this->content=$this->main_file();
01014          break;
01015          case 'wizard':
01016             $this->content=$this->main_rte(1);
01017          break;
01018       }
01019    }

localFolderTree::SC_browse_links::main_db  ) 
 

TYPO3 Element Browser: Showing a page tree and allows you to browse for records.

Returns:
string HTML content for the module

Definition at line 1336 of file browse_links.php.

References $content, and table().

01336                         {
01337 
01338          // Starting content:
01339       $content=$this->doc->startPage('TBE file selector');
01340 
01341          // Init variable:
01342       $pArr = explode('|',$this->bparams);
01343 
01344          // Making the browsable pagetree:
01345       $pagetree = t3lib_div::makeInstance('TBE_PageTree');
01346       $pagetree->script='browse_links.php';
01347       $pagetree->ext_pArrPages = !strcmp($pArr[3],'pages')?1:0;
01348       $tree=$pagetree->getBrowsableTree();
01349 
01350          // Making the list of elements, if applicable:
01351       $cElements = $this->TBE_expandPage($pArr[3]);
01352 
01353          // Putting the things together, side by side:
01354       $content.= '
01355 
01356          <!--
01357             Wrapper table for page tree / record list:
01358          -->
01359          <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBrecords">
01360             <tr>
01361                <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
01362                <td class="c-wCell" valign="top">'.$cElements.'</td>
01363             </tr>
01364          </table>
01365          ';
01366 
01367          // Add some space
01368       $content.='<br /><br />';
01369 
01370          // End page, return content:
01371       $content.= $this->doc->endPage();
01372       return $content;
01373    }

localFolderTree::SC_browse_links::main_file  ) 
 

TYPO3 Element Browser: Showing a folder tree, allowing you to browse for files.

Returns:
string HTML content for the module

Definition at line 1380 of file browse_links.php.

References $content, t3lib_BEfunc::getFuncCheck(), t3lib_BEfunc::getModuleData(), and table().

01380                         {
01381       global $BE_USER;
01382 
01383          // Starting content:
01384       $content.=$this->doc->startPage('TBE file selector');
01385 
01386          // Init variable:
01387       $pArr = explode('|',$this->bparams);
01388 
01389          // Create upload/create folder forms, if a path is given:
01390       $fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
01391       $fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
01392       $path=$this->expandFolder;
01393       if (!$path || !@is_dir($path))   {
01394          $path = $fileProcessor->findTempFolder().'/';   // The closest TEMP-path is found
01395       }
01396       if ($path!='/' && @is_dir($path))   {
01397          $uploadForm=$this->uploadForm($path);
01398          $createFolder=$this->createFolder($path);
01399       } else {
01400          $createFolder='';
01401          $uploadForm='';
01402       }
01403       if ($BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) $content.=$uploadForm;
01404 
01405          // Getting flag for showing/not showing thumbnails:
01406       $noThumbs = $GLOBALS['BE_USER']->getTSConfigVal('options.noThumbsInEB');
01407 
01408       if (!$noThumbs)   {
01409             // MENU-ITEMS, fetching the setting for thumbnails from File>List module:
01410          $_MOD_MENU = array('displayThumbs' => '');
01411          $_MCONF['name']='file_list';
01412          $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']);
01413          $addParams = '&act='.$this->act.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
01414          $thumbNailCheck = t3lib_BEfunc::getFuncCheck('','SET[displayThumbs]',$_MOD_SETTINGS['displayThumbs'],'browse_links.php',$addParams).' '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs',1);
01415       } else {
01416          $thumbNailCheck='';
01417       }
01418       $noThumbs = $noThumbs?$noThumbs:!$_MOD_SETTINGS['displayThumbs'];
01419 
01420          // Create folder tree:
01421       $foldertree = t3lib_div::makeInstance('TBE_FolderTree');
01422       $foldertree->script='browse_links.php';
01423       $foldertree->ext_noTempRecyclerDirs = ($this->mode == 'filedrag');
01424       $tree=$foldertree->getBrowsableTree();
01425 
01426       list(,,$specUid) = explode('_',$this->PM);
01427 
01428       if ($this->mode=='filedrag')  {
01429          $files = $this->TBE_dragNDrop($foldertree->specUIDmap[$specUid],$pArr[3]);
01430       } else {
01431          $files = $this->TBE_expandFolder($foldertree->specUIDmap[$specUid],$pArr[3],$noThumbs);
01432       }
01433 
01434          // Putting the parts together, side by side:
01435       $content.= '
01436 
01437          <!--
01438             Wrapper table for folder tree / file list:
01439          -->
01440          <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBfiles">
01441             <tr>
01442                <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01443                <td class="c-wCell" valign="top">'.$files.'</td>
01444             </tr>
01445          </table>
01446          ';
01447       $content.=$thumbNailCheck;
01448 
01449          // Adding create folder + upload forms if applicable:
01450       if (!$BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB'))   $content.=$uploadForm;
01451       if ($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB'))   $content.=$createFolder;
01452 
01453          // Add some space
01454       $content.='<br /><br />';
01455 
01456          // Ending page, returning content:
01457       $content.= $this->doc->endPage();
01458       return $content;
01459    }

localFolderTree::SC_browse_links::main_rte wiz = 0  ) 
 

Rich Text Editor (RTE) link selector (MAIN function) Generates the link selector for the Rich Text Editor.

Can also be used to select links for the TCEforms (see $wiz)

Parameters:
boolean If set, the "remove link" is not shown in the menu: Used for the "Select link" wizard which is used by the TCEforms
Returns:
string Modified content variable.

Definition at line 1057 of file browse_links.php.

References $content, $LANG, menu(), PATH_site, and table().

01057                               {
01058       global $LANG;
01059 
01060          // Starting content:
01061       $content=$this->doc->startPage('RTE link');
01062 
01063          // Initializing the action value, possibly removing blinded values etc:
01064       $allowedItems = array_diff(explode(',','page,file,url,mail,spec'),t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1));
01065       reset($allowedItems);
01066       if (!in_array($this->act,$allowedItems))  $this->act = current($allowedItems);
01067 
01068          // Making menu in top:
01069       $menuDef = array();
01070       if (!$wiz)  {
01071          $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
01072          $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
01073          $menuDef['removeLink']['url'] = '#';
01074          $menuDef['removeLink']['addParams'] = 'onclick="self.parent.parent.renderPopup_unLink();return false;"';
01075       }
01076       if (in_array('page',$allowedItems)) {
01077          $menuDef['page']['isActive'] = $this->act=='page';
01078          $menuDef['page']['label'] = $LANG->getLL('page',1);
01079          $menuDef['page']['url'] = '#';
01080          $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\'?act=page\');return false;"';
01081       }
01082       if (in_array('file',$allowedItems)){
01083          $menuDef['file']['isActive'] = $this->act=='file';
01084          $menuDef['file']['label'] = $LANG->getLL('file',1);
01085          $menuDef['file']['url'] = '#';
01086          $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\'?act=file\');return false;"';
01087       }
01088       if (in_array('url',$allowedItems)) {
01089          $menuDef['url']['isActive'] = $this->act=='url';
01090          $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
01091          $menuDef['url']['url'] = '#';
01092          $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\'?act=url\');return false;"';
01093       }
01094       if (in_array('mail',$allowedItems)) {
01095          $menuDef['mail']['isActive'] = $this->act=='mail';
01096          $menuDef['mail']['label'] = $LANG->getLL('email',1);
01097          $menuDef['mail']['url'] = '#';
01098          $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\'?act=mail\');return false;"';
01099       }
01100       if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$allowedItems)) {
01101          $menuDef['spec']['isActive'] = $this->act=='spec';
01102          $menuDef['spec']['label'] = $LANG->getLL('special',1);
01103          $menuDef['spec']['url'] = '#';
01104          $menuDef['spec']['addParams'] = 'onclick="jumpToUrl(\'?act=spec\');return false;"';
01105       }
01106       $content .= $this->doc->getTabMenuRaw($menuDef);
01107 
01108          // Adding the menu and header to the top of page:
01109       $content.=$this->printCurrentUrl($this->curUrlInfo['info']).'<br />';
01110 
01111 
01112          // Depending on the current action we will create the actual module content for selecting a link:
01113       switch($this->act)   {
01114          case 'mail':
01115             $extUrl='
01116 
01117          <!--
01118             Enter mail address:
01119          -->
01120                <form action="" name="lurlform" id="lurlform">
01121                   <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
01122                      <tr>
01123                         <td>'.$GLOBALS['LANG']->getLL('emailAddress',1).':</td>
01124                         <td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
01125                            '<input type="submit" value="'.$GLOBALS['LANG']->getLL('setLink',1).'" onclick="setTarget(\'\');setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
01126                      </tr>
01127                   </table>
01128                </form>';
01129             $content.=$extUrl;
01130          break;
01131          case 'url':
01132             $extUrl='
01133 
01134          <!--
01135             Enter External URL:
01136          -->
01137                <form action="" name="lurlform" id="lurlform">
01138                   <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
01139                      <tr>
01140                         <td>URL:</td>
01141                         <td><input type="text" name="lurl"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
01142                            '<input type="submit" value="'.$GLOBALS['LANG']->getLL('setLink',1).'" onclick="setValue(document.lurlform.lurl.value); return link_current();" /></td>
01143                      </tr>
01144                   </table>
01145                </form>';
01146             $content.=$extUrl;
01147          break;
01148          case 'file':
01149             $foldertree = t3lib_div::makeInstance('rteFolderTree');
01150             $tree=$foldertree->getBrowsableTree();
01151 
01152             if (!$this->curUrlInfo['value'] || $this->curUrlInfo['act']!='file') {
01153                $cmpPath='';
01154             } elseif (substr(trim($this->curUrlInfo['info']),-1)!='/')  {
01155                $cmpPath=PATH_site.dirname($this->curUrlInfo['info']).'/';
01156                if (!isset($this->expandFolder))       $this->expandFolder = $cmpPath;
01157             } else {
01158                $cmpPath=PATH_site.$this->curUrlInfo['info'];
01159             }
01160 
01161             list(,,$specUid) = explode('_',$this->PM);
01162             $files = $this->expandFolder($foldertree->specUIDmap[$specUid]);
01163 
01164             $content.= '
01165 
01166          <!--
01167             Wrapper table for folder tree / file list:
01168          -->
01169                <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles">
01170                   <tr>
01171                      <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01172                      <td class="c-wCell" valign="top">'.$files.'</td>
01173                   </tr>
01174                </table>
01175                ';
01176          break;
01177          case 'spec':
01178             if (is_array($this->thisConfig['userLinks.']))  {
01179                $subcats=array();
01180                $v=$this->thisConfig['userLinks.'];
01181                reset($v);
01182                while(list($k2)=each($v))  {
01183                   $k2i = intval($k2);
01184                   if (substr($k2,-1)=='.' && is_array($v[$k2i.'.'])) {
01185 
01186                         // Title:
01187                      $title = trim($v[$k2i]);
01188                      if (!$title)   {
01189                         $title=$v[$k2i.'.']['url'];
01190                      } else {
01191                         $title=$LANG->sL($title);
01192                      }
01193                         // Description:
01194                      $description=$v[$k2i.'.']['description'] ? $LANG->sL($v[$k2i.'.']['description'],1).'<br />' : '';
01195 
01196                         // URL + onclick event:
01197                      $onClickEvent='';
01198                      if (isset($v[$k2i.'.']['target']))  $onClickEvent.="setTarget('".$v[$k2i.'.']['target']."');";
01199                      $v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
01200                      if (substr($v[$k2i.'.']['url'],0,7)=="http://" || substr($v[$k2i.'.']['url'],0,7)=='mailto:')   {
01201                         $onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
01202                      } else {
01203                         $onClickEvent.="link_spec(unescape('".$this->siteURL.rawurlencode($v[$k2i.'.']['url'])."'));";
01204                      }
01205 
01206                         // Link:
01207                      $A=array('<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">','</a>');
01208 
01209                         // Adding link to menu of user defined links:
01210                      $subcats[$k2i]='
01211                         <tr>
01212                            <td class="bgColor4">'.$A[0].'<strong>'.htmlspecialchars($title).($this->curUrlInfo['info']==$v[$k2i.'.']['url']?'<img'.t3lib_iconWorks::skinImg('','gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" />':'').'</strong><br />'.$description.$A[1].'</td>
01213                         </tr>';
01214                   }
01215                }
01216 
01217                   // Sort by keys:
01218                ksort($subcats);
01219 
01220                   // Add menu to content:
01221                $content.= '
01222 
01223          <!--
01224             Special userdefined menu:
01225          -->
01226                   <table border="0" cellpadding="1" cellspacing="1" id="typo3-linkSpecial">
01227                      <tr>
01228                         <td class="bgColor5" class="c-wCell" valign="top"><strong>'.$LANG->getLL('special',1).'</strong></td>
01229                      </tr>
01230                      '.implode('',$subcats).'
01231                   </table>
01232                   ';
01233             }
01234          break;
01235          case 'page':
01236          default:
01237             $pagetree = t3lib_div::makeInstance('rtePageTree');
01238             $tree=$pagetree->getBrowsableTree();
01239             $cElements = $this->expandPage();
01240             $content.= '
01241 
01242          <!--
01243             Wrapper table for page tree / record list:
01244          -->
01245                <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
01246                   <tr>
01247                      <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
01248                      <td class="c-wCell" valign="top">'.$cElements.'</td>
01249                   </tr>
01250                </table>
01251                ';
01252          break;
01253       }
01254 
01255          // Target:
01256       if ($this->act!='mail') {
01257          $ltarget='
01258 
01259 
01260          <!--
01261             Selecting target for link:
01262          -->
01263             <form action="" name="ltargetform" id="ltargetform">
01264                <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
01265                   <tr>
01266                      <td>'.$GLOBALS['LANG']->getLL('target',1).':</td>
01267                      <td><input type="text" name="ltarget" onchange="setTarget(this.value);" value="'.htmlspecialchars($this->setTarget).'"'.$this->doc->formWidth(10).' /></td>
01268                      <td>
01269                         <select name="ltarget_type" onchange="setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
01270                            <option></option>
01271                            <option value="_top">'.$GLOBALS['LANG']->getLL('top',1).'</option>
01272                            <option value="_blank">'.$GLOBALS['LANG']->getLL('newWindow',1).'</option>
01273                         </select>
01274                      </td>
01275                      <td>';
01276 
01277          if (($this->curUrlInfo['act']=="page" || $this->curUrlInfo['act']=='file') && $this->curUrlArray['href'])   {
01278             $ltarget.='
01279                      <input type="submit" value="'.$GLOBALS['LANG']->getLL('update',1).'" onclick="return link_current();" />';
01280          }
01281 
01282          $selectJS = '
01283             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) {
01284                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;
01285                setTarget(document.ltargetform.ltarget.value);
01286                document.ltargetform.popup_width.selectedIndex=0;
01287                document.ltargetform.popup_height.selectedIndex=0;
01288             }
01289          ';
01290 
01291          $ltarget.='    </td>
01292                   </tr>
01293                   <tr>
01294                      <td>'.$GLOBALS['LANG']->getLL('target_popUpWindow',1).':</td>
01295                      <td colspan="3">
01296                         <select name="popup_width" onchange="'.htmlspecialchars($selectJS).'">
01297                            <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_width',1).'</option>
01298                            <option value="300">300</option>
01299                            <option value="400">400</option>
01300                            <option value="500">500</option>
01301                            <option value="600">600</option>
01302                            <option value="700">700</option>
01303                            <option value="800">800</option>
01304                         </select>
01305                         x
01306                         <select name="popup_height" onchange="'.htmlspecialchars($selectJS).'">
01307                            <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_height',1).'</option>
01308                            <option value="200">200</option>
01309                            <option value="300">300</option>
01310                            <option value="400">400</option>
01311                            <option value="500">500</option>
01312                            <option value="600">600</option>
01313                         </select>
01314                      </td>
01315                   </tr>
01316                </table>
01317             </form>';
01318 
01319             // Add "target selector" box to content:
01320          $content.=$ltarget;
01321 
01322             // Add some space
01323          $content.='<br /><br />';
01324       }
01325 
01326          // End page, return content:
01327       $content.= $this->doc->endPage();
01328       return $content;
01329    }

localFolderTree::SC_browse_links::printContent  ) 
 

Print module content.

Returns:
void

Definition at line 1026 of file browse_links.php.

01026                            {
01027       echo $this->content;
01028    }


Member Data Documentation

localFolderTree::SC_browse_links::$act
 

Link selector action.

page,file,url,mail,spec are allowed values. These are only important with the link selector function and in that case they switch between the various menu options.

Definition at line 662 of file browse_links.php.

localFolderTree::SC_browse_links::$bparams
 

Active with TYPO3 Element Browser: Contains the name of the form field for which this window opens - thus allows us to make references back to the main window in which the form is.

Example value: "data[pages][39][bodytext]|||tt_content|" or "data[tt_content][NEW3fba56fde763d][image]|||gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai|"

Definition at line 685 of file browse_links.php.

localFolderTree::SC_browse_links::$curUrlArray
 

Used with the link selector: Contains the GET input information about the CURRENT link in the RTE/TCEform field.

This consists of "href" and "target" keys. This information is passed around in links.

Definition at line 712 of file browse_links.php.

localFolderTree::SC_browse_links::$curUrlInfo
 

Used with the link selector: Contains a processed version of the input values from curUrlInfo.

This is splitted into pageid, content element id, label value etc. This is used for the internal processing of that information.

Definition at line 717 of file browse_links.php.

localFolderTree::SC_browse_links::$doc
 

Definition at line 642 of file browse_links.php.

localFolderTree::SC_browse_links::$expandFolder
 

When you click a folder name/expand icon to see the content of a certain file folder, this value will contain that value (the path of the expanded file folder).

If the value is NOT set, then it will be restored from the module session data (see main(), mode="file"/"filedrag"). Example value: "/www/htdocs/typo3/32/3dsplm/fileadmin/css/"

Definition at line 672 of file browse_links.php.

localFolderTree::SC_browse_links::$expandPage
 

When you click a page title/expand icon to see the content of a certain page, this value will contain that value (the ID of the expanded page).

If the value is NOT set, then it will be restored from the module session data (see main(), mode="db")

Definition at line 667 of file browse_links.php.

localFolderTree::SC_browse_links::$mode
 

The mode determines the main kind of output from the element browser.

There are these options for values: rte, db, file, filedrag, wizard. "rte" will show the link selector for the Rich Text Editor (see main_rte()) "db" will allow you to browse for pages or records in the page tree (for TCEforms, see main_db()) "file"/"filedrag" will allow you to browse for files or folders in the folder mounts (for TCEforms, main_file()) "wizard" will allow you to browse for links (like "rte") which are passed back to TCEforms (see main_rte(1))

See also:
main()

Definition at line 655 of file browse_links.php.

localFolderTree::SC_browse_links::$P
 

TYPO3 Element Browser, wizard mode parameters.

There is a heap of parameters there, better debug() them out if you need something... :-)

Definition at line 679 of file browse_links.php.

localFolderTree::SC_browse_links::$PM
 

Plus/Minus icon value.

Used by the tree class to open/close notes on the trees.

Definition at line 699 of file browse_links.php.

localFolderTree::SC_browse_links::$pointer
 

Pointer, used when browsing a long list of records etc.

Definition at line 704 of file browse_links.php.

localFolderTree::SC_browse_links::$RTEtsConfigParams
 

Used with the Rich Text Editor.

Example value: "tt_content:NEW3fba58c969f5c:bodytext:23:text:23:"

Definition at line 691 of file browse_links.php.

localFolderTree::SC_browse_links::$setTarget
 

Definition at line 641 of file browse_links.php.

localFolderTree::SC_browse_links::$siteURL
 

Definition at line 639 of file browse_links.php.

localFolderTree::SC_browse_links::$thisConfig
 

Definition at line 640 of file browse_links.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 3 01:06:26 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913