/**
  * Main function, detecting the current mode of the element browser and branching out to internal methods.
  *
  * @return void
  */
 public function main()
 {
     // Clear temporary DB mounts
     $tmpMount = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('setTempDBmount');
     if (isset($tmpMount)) {
         $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', (int) $tmpMount);
     }
     // Set temporary DB mounts
     $tempDBmount = (int) $GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint');
     if ($tempDBmount) {
         $altMountPoints = $tempDBmount;
     }
     if ($altMountPoints) {
         $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
         $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
     }
     $this->content = '';
     // Look for alternative mountpoints
     switch ((string) $this->mode) {
         case 'rte':
         case 'db':
         case 'wizard':
             // Setting alternative browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
             $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
             if ($altMountPoints) {
                 $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
                 $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
             }
     }
     // Render type by user func
     $browserRendered = FALSE;
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
             $browserRenderObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
             if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
                 if ($browserRenderObj->isValid($this->mode, $this)) {
                     $this->content .= $browserRenderObj->render($this->mode, $this);
                     $browserRendered = TRUE;
                     break;
                 }
             }
         }
     }
     // if type was not rendered use default rendering functions
     if (!$browserRendered) {
         $this->browser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\Browser\\ElementBrowser');
         $this->browser->init();
         $modData = $GLOBALS['BE_USER']->getModuleData('browse_links.php', 'ses');
         list($modData, $store) = $this->browser->processSessionData($modData);
         $GLOBALS['BE_USER']->pushModuleData('browse_links.php', $modData);
         // Output the correct content according to $this->mode
         switch ((string) $this->mode) {
             case 'rte':
                 $this->content = $this->browser->main_rte();
                 break;
             case 'db':
                 $this->content = $this->browser->main_db();
                 break;
             case 'file':
             case 'filedrag':
                 $this->content = $this->browser->main_file();
                 break;
             case 'folder':
                 $this->content = $this->browser->main_folder();
                 break;
             case 'wizard':
                 $this->content = $this->browser->main_rte(TRUE);
                 break;
         }
     }
 }
Ejemplo n.º 2
0
	/**
	 * Initialize document template object
	 *
	 * @return void
	 */
	protected function initDocumentTemplate() {
		parent::initDocumentTemplate();
		$this->doc->getContextMenuCode();
		// Apply the same styles as those of the base script
		$this->doc->bodyTagId = 'typo3-browse-links-php';
		$this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
		// Add attributes to body tag. Note: getBodyTagAdditions will invoke the hooks
		$this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
		$this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function(Tree) {
			Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
		}');
	}
Ejemplo n.º 3
0
    /**
     * Initialize document template object
     *
     * @return void
     */
    protected function initDocumentTemplate()
    {
        parent::initDocumentTemplate();
        $this->doc->bodyTagId = 'typo3-browse-links-php';
        $this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
        $this->doc->JScode .= $this->doc->wrapScriptTags('
			Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
		');
        $this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
        $this->doc->getContextMenuCode();
    }
Ejemplo n.º 4
0
    /**
     * Initialize document template object
     *
     * @return void
     */
    protected function initDocumentTemplate()
    {
        parent::initDocumentTemplate();
        $this->doc->bodyTagAdditions = 'onload="SelectImage.initEventListeners();"';
        $pageRenderer = $this->getPageRenderer();
        $pageRenderer->addCssFile(ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function(Tree) {
			Tree.ajaxID = "sc_alt_file_navframe_expandtoggle";
		}');
        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Rtehtmlarea/Modules/SelectImage', 'function(SelectImage) {
			SelectImage.editorNo = ' . GeneralUtility::quoteJSvalue($this->editorNo) . ';
			SelectImage.act = ' . GeneralUtility::quoteJSvalue($this->act ?: reset($this->allowedItems)) . ';
			SelectImage.sys_language_content = ' . GeneralUtility::quoteJSvalue($this->sys_language_content) . ';
			SelectImage.RTEtsConfigParams = ' . GeneralUtility::quoteJSvalue(rawurlencode($this->RTEtsConfigParams)) . ';
			SelectImage.bparams = ' . GeneralUtility::quoteJSvalue($this->bparams) . ';
		}');
    }
Ejemplo n.º 5
0
 /**
  * Initialize document template object
  *
  * @return void
  */
 protected function initDocumentTemplate()
 {
     parent::initDocumentTemplate();
     $this->doc->getContextMenuCode();
     // Apply the same styles as those of the base script
     $this->doc->bodyTagId = 'typo3-browse-links-php';
     $this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
     // Add attributes to body tag. Note: getBodyTagAdditions will invoke the hooks
     $this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
 }
Ejemplo n.º 6
0
    /**
     * Initialize document template object
     *
     * @return void
     */
    protected function initDocumentTemplate()
    {
        parent::initDocumentTemplate();
        $this->doc->bodyTagId = 'typo3-browse-links-php';
        $this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
        $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function(Tree) {
			Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
		}');
        $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Rtehtmlarea/Modules/SelectImage', 'function(SelectImage) {
			SelectImage.editorNo = ' . GeneralUtility::quoteJSvalue($this->editorNo) . ';
			SelectImage.act = ' . GeneralUtility::quoteJSvalue($this->act ?: reset($this->allowedItems)) . ';
			SelectImage.sys_language_content = ' . GeneralUtility::quoteJSvalue($this->sys_language_content) . ';
			SelectImage.RTEtsConfigParams = ' . GeneralUtility::quoteJSvalue(rawurlencode($this->RTEtsConfigParams)) . ';
			SelectImage.bparams = ' . GeneralUtility::quoteJSvalue($this->bparams) . ';
		}');
        $this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
        $this->doc->getContextMenuCode();
    }