TYPO3 CMS  TYPO3_6-2
SelectImageController.php
Go to the documentation of this file.
1 <?php
3 
23 
24  public $mode = 'rte';
25 
26  public $button = 'image';
27 
28  protected $content = '';
29 
33  public function __construct() {
34  $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.xlf');
35  $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/mod4/locallang.xlf');
36  $GLOBALS['LANG']->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xlf');
37  }
38 
45  public function main() {
46  // Setting alternative browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
47  $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
48  if ($altMountPoints) {
49  $altMountPoints = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $altMountPoints);
50  foreach ($altMountPoints as $filePathRelativeToFileadmindir) {
51  // @todo: add this feature for FAL and TYPO3 6.2
52  }
53  }
54  // Rendering type by user function
55  $browserRendered = FALSE;
56  if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.php']['browserRendering'])) {
57  foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser.php']['browserRendering'] as $classRef) {
58  $browserRenderObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
59  if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
60  if ($browserRenderObj->isValid($this->mode, $this)) {
61  $this->content .= $browserRenderObj->render($this->mode, $this);
62  $browserRendered = TRUE;
63  break;
64  }
65  }
66  }
67  }
68  // If type was not rendered, use default rendering functions
69  if (!$browserRendered) {
70  $GLOBALS['SOBE']->browser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Rtehtmlarea\\SelectImage');
71  $GLOBALS['SOBE']->browser->init();
72  $modData = $GLOBALS['BE_USER']->getModuleData('select_image.php', 'ses');
73  list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
74  $GLOBALS['BE_USER']->pushModuleData('select_image.php', $modData);
75  $this->content = $GLOBALS['SOBE']->browser->main_rte();
76  }
77  }
78 
85  public function printContent() {
86  echo $this->content;
87  }
88 
89 }
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'][]