TYPO3 CMS  TYPO3_6-2
BrowseLinksController.php
Go to the documentation of this file.
1 <?php
3 
23 
24  public $mode = 'rte';
25 
26  public $button = 'link';
27 
28  protected $content = '';
29 
33  public function __construct() {
34  $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/mod3/locallang.xlf');
35  $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xlf');
36  }
43  public function main() {
44  // Setting alternative web browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
45  $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
46  // Clear temporary DB mounts
47  $tmpMount = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('setTempDBmount');
48  if (isset($tmpMount)) {
49  $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', (int)$tmpMount);
50  }
51  // Set temporary DB mounts
52  $tempDBmount = (int)$GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint');
53  if ($tempDBmount) {
54  $altMountPoints = $tempDBmount;
55  }
56  if ($altMountPoints) {
57  $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
58  $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
59  }
60  // Setting alternative file browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
61  $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
62  if ($altMountPoints) {
63  $altMountPoints = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $altMountPoints);
64  foreach ($altMountPoints as $filePathRelativeToFileadmindir) {
65  // @todo: add this feature for FAL and TYPO3 6.2
66  }
67  }
68  // Render type by user function
69  $browserRendered = FALSE;
70  if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
71  foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
72  $browserRenderObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
73  if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
74  if ($browserRenderObj->isValid($this->mode, $this)) {
75  $this->content .= $browserRenderObj->render($this->mode, $this);
76  $browserRendered = TRUE;
77  break;
78  }
79  }
80  }
81  }
82  // If type was not rendered, use default rendering functions
83  if (!$browserRendered) {
84  $GLOBALS['SOBE']->browser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\BrowseLinks');
85  $GLOBALS['SOBE']->browser->init();
86  $modData = $GLOBALS['BE_USER']->getModuleData('browse_links.php', 'ses');
87  list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
88  $GLOBALS['BE_USER']->pushModuleData('browse_links.php', $modData);
89  $this->content = $GLOBALS['SOBE']->browser->main_rte();
90  }
91  }
92 
99  public function printContent() {
100  echo $this->content;
101  }
102 
103 }
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]