2 namespace TYPO3\CMS\Backend\Tree\Pagetree;
52 protected function initDataProvider()
66 $this->initDataProvider();
67 $node = $this->dataProvider->getRoot();
68 return $node->toArray();
80 $this->initDataProvider();
83 if ($nodeId ===
'root') {
84 $nodeCollection = $this->dataProvider->getTreeMounts();
86 $nodeCollection = $this->dataProvider->getNodes($node, $node->getMountPoint());
88 return $nodeCollection->toArray();
99 public function getFilteredTree($nodeId, $nodeData, $searchFilter)
101 if (strval($searchFilter) ===
'') {
106 $this->initDataProvider();
107 if ($nodeId ===
'root') {
108 $nodeCollection = $this->dataProvider->getTreeMounts($searchFilter);
110 $nodeCollection = $this->dataProvider->getFilteredNodes($node, $searchFilter, $node->getMountPoint());
112 return $nodeCollection->toArray();
125 $doktypeLabelMap = array();
126 foreach (
$GLOBALS[
'TCA'][
'pages'][
'columns'][
'doktype'][
'config'][
'items'] as $doktypeItemConfig) {
127 if ($doktypeItemConfig[1] ===
'--div--') {
130 $doktypeLabelMap[$doktypeItemConfig[1]] = $doktypeItemConfig[0];
135 $isAdmin =
$GLOBALS[
'BE_USER']->isAdmin();
137 if (!$isAdmin && empty($allowedDoktypes)) {
140 foreach ($doktypes as $doktype) {
141 if (!$isAdmin && !in_array($doktype, $allowedDoktypes)) {
144 $label =
$GLOBALS[
'LANG']->sL($doktypeLabelMap[$doktype],
true);
145 $icon = $this->iconFactory->getIcon(
$GLOBALS[
'TCA'][
'pages'][
'ctrl'][
'typeicon_classes'][$doktype],
Icon::SIZE_SMALL)->render();
147 'nodeType' => $doktype,
148 'cls' =>
'typo3-pagetree-topPanel-button',
162 public function getIndicators()
166 $indicatorHtmlArr = $indicatorProvider->getAllIndicators();
168 'html' => implode(
' ', $indicatorHtmlArr),
169 '_COUNT' => count($indicatorHtmlArr)
181 $file =
'LLL:EXT:lang/locallang_core.xlf:';
182 $indicators = $this->getIndicators();
183 $configuration = array(
185 'copyHint' =>
$GLOBALS[
'LANG']->sL($file .
'tree.copyHint',
true),
186 'fakeNodeHint' =>
$GLOBALS[
'LANG']->sL($file .
'mess.please_wait',
true),
187 'activeFilterMode' =>
$GLOBALS[
'LANG']->sL($file .
'tree.activeFilterMode',
true),
188 'dropToRemove' =>
$GLOBALS[
'LANG']->sL($file .
'tree.dropToRemove',
true),
189 'buttonRefresh' =>
$GLOBALS[
'LANG']->sL($file .
'labels.refresh',
true),
190 'buttonNewNode' =>
$GLOBALS[
'LANG']->sL($file .
'tree.buttonNewNode',
true),
191 'buttonFilter' =>
$GLOBALS[
'LANG']->sL($file .
'tree.buttonFilter',
true),
192 'dropZoneElementRemoved' =>
$GLOBALS[
'LANG']->sL($file .
'tree.dropZoneElementRemoved',
true),
193 'dropZoneElementRestored' =>
$GLOBALS[
'LANG']->sL($file .
'tree.dropZoneElementRestored',
true),
194 'searchTermInfo' =>
$GLOBALS[
'LANG']->sL($file .
'tree.searchTermInfo',
true),
195 'temporaryMountPointIndicatorInfo' =>
$GLOBALS[
'LANG']->sl($file .
'labels.temporaryDBmount',
true),
196 'deleteDialogTitle' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteItem',
true),
197 'deleteDialogMessage' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteWarning',
true),
198 'recursiveDeleteDialogMessage' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:recursiveDeleteWarning',
true)
200 'Configuration' => array(
201 'hideFilter' =>
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.pageTree.hideFilter'),
203 'canDeleteRecursivly' =>
$GLOBALS[
'BE_USER']->uc[
'recursiveDelete'] ==
true,
204 'disableIconLinkToContextmenu' =>
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.pageTree.disableIconLinkToContextmenu'),
205 'indicator' => $indicators[
'html'],
209 'InputClear' => $this->iconFactory->getIcon(
'actions-input-clear',
Icon::SIZE_SMALL)->render(),
210 'Close' => $this->iconFactory->getIcon(
'actions-close',
Icon::SIZE_SMALL)->render(
'inline'),
211 'TrashCan' => $this->iconFactory->getIcon(
'actions-edit-delete',
Icon::SIZE_SMALL)->render(
'inline'),
212 'TrashCanRestore' => $this->iconFactory->getIcon(
'actions-edit-restore',
Icon::SIZE_SMALL)->render(
'inline'),
213 'Info' => $this->iconFactory->getIcon(
'actions-document-info',
Icon::SIZE_SMALL)->render(
'inline'),
214 'NewNode' => $this->iconFactory->getIcon(
'actions-page-new',
Icon::SIZE_SMALL)->render(),
215 'Filter' => $this->iconFactory->getIcon(
'actions-filter',
Icon::SIZE_SMALL)->render(),
216 'Refresh' => $this->iconFactory->getIcon(
'actions-refresh',
Icon::SIZE_SMALL)->render()
219 return $configuration;