*/
class PageTreeNavigationController {
// Internal:
/**
* @todo Define visibility
*/
public $content;
/**
* @todo Define visibility
*/
public $pagetree;
/**
* document template object
*
* @var \TYPO3\CMS\Backend\Template\DocumentTemplate
* @todo Define visibility
*/
public $doc;
// Temporary mount point (record), if any
/**
* @todo Define visibility
*/
public $active_tempMountPoint = 0;
/**
* @todo Define visibility
*/
public $backPath;
// Internal, static: GPvar:
/**
* @todo Define visibility
*/
public $currentSubScript;
/**
* @todo Define visibility
*/
public $cMR;
// If not '' (blank) then it will clear (0) or set (>0) Temporary DB mount.
/**
* @todo Define visibility
*/
public $setTempDBmount;
/**
* @todo Define visibility
*/
public $template;
// Depends on userTS-setting
/**
* @todo Define visibility
*/
public $hasFilterBox;
/**
* Initialiation of the class
*
* @return void
* @todo Define visibility
*/
public function init() {
// Setting backPath
$this->backPath = $GLOBALS['BACK_PATH'];
// Setting GPvars:
$this->cMR = GeneralUtility::_GP('cMR');
$this->currentSubScript = GeneralUtility::_GP('currentSubScript');
$this->setTempDBmount = GeneralUtility::_GP('setTempDBmount');
// look for User setting
$this->hasFilterBox = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter');
// Create page tree object:
$this->pagetree = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\PageTreeView');
$this->pagetree->ext_IconMode = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
$this->pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
$this->pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
$this->pagetree->ext_separateNotinmenuPages = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.separateNotinmenuPages');
$this->pagetree->ext_alphasortNotinmenuPages = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.alphasortNotinmenuPages');
$this->pagetree->thisScript = 'alt_db_navframe.php';
$this->pagetree->addField('alias');
$this->pagetree->addField('shortcut');
$this->pagetree->addField('shortcut_mode');
$this->pagetree->addField('mount_pid');
$this->pagetree->addField('mount_pid_ol');
$this->pagetree->addField('nav_hide');
$this->pagetree->addField('nav_title');
$this->pagetree->addField('url');
// Temporary DB mounts:
$this->initializeTemporaryDBmount();
}
/**
* Initialization for the visual parts of the class
* Use template rendering only if this is a non-AJAX call
*
* @return void
*/
public function initPage() {
// Setting highlight mode:
$this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
// If highlighting is active, define the CSS class for the active item depending on the workspace
if ($this->doHighlight) {
$hlClass = $GLOBALS['BE_USER']->workspace === 0 ? 'active' : 'active active-ws wsver' . $GLOBALS['BE_USER']->workspace;
}
// Create template object:
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_db_navframe.html');
$this->doc->showFlashMessages = FALSE;
// Get HTML-Template
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
$this->doc->getDragDropCode('pages');
$this->doc->getContextMenuCode();
$this->doc->getPageRenderer()->loadScriptaculous('effects');
$this->doc->getPageRenderer()->loadExtJS();
if ($this->hasFilterBox) {
$this->doc->getPageRenderer()->addJsFile('sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js');
}
$this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
// setting prefs for pagetree and drag & drop
' . ($this->doHighlight ? 'Tree.highlightClass = "' . $hlClass . '";' : '') . '
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) { //
var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
if (theUrl.indexOf("?") != -1) {
theUrl += "&id=" + id
} else {
theUrl += "?id=" + id
}
top.fsMod.currentBank = bank;
top.TYPO3.Backend.ContentContainer.setUrl(theUrl);
' . ($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
' . (!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ') . '
return false;
}
' . ($this->cMR ? 'jumpTo(top.fsMod.recentIds[\'web\'],\'\');' : '') . ($this->hasFilterBox ? 'var TYPO3PageTreeFilter = new PageTreeFilter();' : '') . '
');
$this->doc->bodyTagId = 'typo3-pagetree';
}
/**
* Main function, rendering the browsable page tree
*
* @return void
* @todo Define visibility
*/
public function main() {
// Produce browse-tree:
$tree = $this->pagetree->getBrowsableTree();
// Outputting Temporary DB mount notice:
if ($this->active_tempMountPoint) {
$flashText = '
' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xlf:labels.temporaryDBmount', 1) . '
' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xlf:labels.path', 1) . ': ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($this->active_tempMountPoint['_thePath'], -50)) . '
';
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $flashText, '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
$this->content .= $flashMessage->render();
}
// Outputting page tree:
$this->content .= '