/**
  * Returns the language labels, sprites and configuration options for the pagetree
  *
  * @return void
  */
 public function loadResources()
 {
     $file = 'LLL:EXT:lang/locallang_core.xml:';
     $indicators = $this->getIndicators();
     $configuration = array('LLL' => array('copyHint' => $GLOBALS['LANG']->sL($file . 'tree.copyHint', TRUE), 'fakeNodeHint' => $GLOBALS['LANG']->sL($file . 'mess.please_wait', TRUE), 'activeFilterMode' => $GLOBALS['LANG']->sL($file . 'tree.activeFilterMode', TRUE), 'dropToRemove' => $GLOBALS['LANG']->sL($file . 'tree.dropToRemove', TRUE), 'buttonRefresh' => $GLOBALS['LANG']->sL($file . 'labels.refresh', TRUE), 'buttonNewNode' => $GLOBALS['LANG']->sL($file . 'tree.buttonNewNode', TRUE), 'buttonFilter' => $GLOBALS['LANG']->sL($file . 'tree.buttonFilter', TRUE), 'dropZoneElementRemoved' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRemoved', TRUE), 'dropZoneElementRestored' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored', TRUE), 'searchTermInfo' => $GLOBALS['LANG']->sL($file . 'tree.searchTermInfo', TRUE), 'temporaryMountPointIndicatorInfo' => $GLOBALS['LANG']->sl($file . 'labels.temporaryDBmount', TRUE), 'deleteDialogTitle' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteItem', TRUE), 'deleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteWarning', TRUE), 'recursiveDeleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:recursiveDeleteWarning', TRUE)), 'Configuration' => array('hideFilter' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'), 'displayDeleteConfirmation' => $GLOBALS['BE_USER']->jsConfirmation(4), 'canDeleteRecursivly' => $GLOBALS['BE_USER']->uc['recursiveDelete'] == TRUE, 'disableIconLinkToContextmenu' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu'), 'indicator' => $indicators['html'], 'temporaryMountPoint' => t3lib_tree_pagetree_Commands::getMountPointPath()), 'Sprites' => array('Filter' => t3lib_iconWorks::getSpriteIconClasses('actions-system-tree-search-open'), 'NewNode' => t3lib_iconWorks::getSpriteIconClasses('actions-page-new'), 'Refresh' => t3lib_iconWorks::getSpriteIconClasses('actions-system-refresh'), 'InputClear' => t3lib_iconWorks::getSpriteIconClasses('actions-input-clear'), 'TrashCan' => t3lib_iconWorks::getSpriteIconClasses('actions-edit-delete'), 'TrashCanRestore' => t3lib_iconWorks::getSpriteIconClasses('actions-edit-restore'), 'Info' => t3lib_iconWorks::getSpriteIconClasses('actions-document-info')));
     return $configuration;
 }
 /**
  * Sets a temporary mount point
  *
  * @param stdClass $nodeData
  * @return array
  */
 public static function setTemporaryMountPoint($nodeData)
 {
     /** @var $node t3lib_tree_pagetree_Node */
     $node = t3lib_div::makeInstance('t3lib_tree_pagetree_Node', (array) $nodeData);
     $GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint'] = $node->getId();
     $GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
     return t3lib_tree_pagetree_Commands::getMountPointPath();
 }
 /**
  * Returns the page tree mounts for the current user
  *
  * Note: If you add the search filter parameter, the nodes will be filtered by this string.
  *
  * @param string $searchFilter
  * @return array
  */
 public function getTreeMounts($searchFilter = '')
 {
     /** @var $nodeCollection t3lib_tree_pagetree_NodeCollection */
     $nodeCollection = t3lib_div::makeInstance('t3lib_tree_pagetree_NodeCollection');
     $isTemporaryMountPoint = FALSE;
     $mountPoints = intval($GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint']);
     if (!$mountPoints) {
         $mountPoints = array_map('intval', $GLOBALS['BE_USER']->returnWebmounts());
         $mountPoints = array_unique($mountPoints);
     } else {
         $isTemporaryMountPoint = TRUE;
         $mountPoints = array($mountPoints);
     }
     if (!count($mountPoints)) {
         return $nodeCollection;
     }
     $showRootlineAboveMounts = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPathAboveMounts');
     foreach ($mountPoints as $mountPoint) {
         if ($mountPoint === 0) {
             $sitename = 'TYPO3';
             if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] !== '') {
                 $sitename = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
             }
             $record = array('uid' => 0, 'title' => $sitename);
             $subNode = t3lib_tree_pagetree_Commands::getNewNode($record);
             $subNode->setLabelIsEditable(FALSE);
             $subNode->setType('pages_root');
         } else {
             if (in_array($mountPoint, $this->hiddenRecords)) {
                 continue;
             }
             $record = t3lib_BEfunc::getRecordWSOL('pages', $mountPoint, '*', '', TRUE);
             if (!$record) {
                 continue;
             }
             $subNode = t3lib_tree_pagetree_Commands::getNewNode($record, $mountPoint);
             if ($showRootlineAboveMounts && !$isTemporaryMountPoint) {
                 $rootline = t3lib_tree_pagetree_Commands::getMountPointPath($record['uid']);
                 $subNode->setReadableRootline($rootline);
             }
         }
         if (count($mountPoints) <= 1) {
             $subNode->setExpanded(TRUE);
             $subNode->setCls('typo3-pagetree-node-notExpandable');
         }
         $subNode->setIsMountPoint(TRUE);
         $subNode->setDraggable(FALSE);
         $subNode->setIsDropTarget(FALSE);
         if ($searchFilter === '') {
             $childNodes = $this->getNodes($subNode, $mountPoint);
         } else {
             $childNodes = $this->getFilteredNodes($subNode, $searchFilter, $mountPoint);
             $subNode->setExpanded(TRUE);
         }
         $subNode->setChildNodes($childNodes);
         $nodeCollection->append($subNode);
     }
     return $nodeCollection;
 }