Skip to content

Commit

Permalink
[BUG] Page tree disappears when using RecordPicker in TCEforms
Browse files Browse the repository at this point in the history
The page tree disapperas as soon as you click "Add image" e.g.
in a tt_content element and want to add a media element, so
the vidi based record picker appears.

This is due to the creapy "hide navigation panel code" which currently
is needed as we do not use a common navigation component panel.

Fixes: #31807
  • Loading branch information
nxpthx committed Nov 28, 2011
1 parent 7d44495 commit 3510046
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Classes/Service/ModuleLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ class Tx_Vidi_Service_ModuleLoader {
* @var string
*/
protected $javaScriptBasePath;


/**
* @var boolean
*/
protected $isMainModule = TRUE;

/**
* @param string $extensionKey
* @param string $moduleKey
Expand Down Expand Up @@ -167,6 +172,7 @@ public function register($omitModule = false, $moduleCode = '') {
$GLOBALS['TBE_MODULES_EXT']['vidi'][$moduleCode]['ddInterface'] = $this->ddInterface;
$GLOBALS['TBE_MODULES_EXT']['vidi'][$moduleCode]['gridDataService'] = $this->gridService;
$GLOBALS['TBE_MODULES_EXT']['vidi'][$moduleCode]['columnRestriction'] = $this->columnsToShow;
$GLOBALS['TBE_MODULES_EXT']['vidi'][$moduleCode]['isMainModule'] = $this->isMainModule;

if ($omitModule === FALSE) {
Tx_Extbase_Utility_Extension::registerModule(
Expand Down Expand Up @@ -357,12 +363,16 @@ public static function checkAndCreateStarterFile($moduleCode) {
$files[] = $configuration['extKey'] . '/' . str_replace('.js', '', $value);
}

$starterCode = "if (top.TYPO3 != undefined && top.TYPO3.Backend != undefined) {
$starterCode = '';

if ($configuration['isMainModule'] && count($configuration['trees'])) {
$starterCode = "if (top.TYPO3 != undefined && top.TYPO3.Backend != undefined) {
top.TYPO3.Backend.NavigationContainer.hide();
top.TYPO3.Backend.NavigationDummy.show();
top.TYPO3.Backend.doLayout();
}
";
}

$starterCode .= 'require(["' . implode('", "', $jsFilesRequireJS) . '"], function() {' . LF . "\n\tTYPO3.Vidi.Application.initialize();\n\n";

Expand Down Expand Up @@ -454,5 +464,19 @@ public function getColumnsToShow($table) {
return $this->columnsToShow[$table];
}

/**
* @param boolean $isMainModule
*/
public function setIsMainModule($isMainModule) {
$this->isMainModule = $isMainModule;
}

/**
* @return boolean
*/
public function getIsMainModule() {
return $this->isMainModule;
}


}

0 comments on commit 3510046

Please sign in to comment.