‪TYPO3CMS  10.4
ExportPageTreeView.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
24 
30 {
34  public function ‪__construct()
35  {
36  parent::__construct();
37  $this->‪init();
38  }
39 
49  public function ‪wrapTitle(‪$title, $row, ‪$bank = 0)
50  {
51  return trim(‪$title) === '' ? '<em>[' . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.no_title')) . ']</em>' : htmlspecialchars(‪$title);
52  }
53 
63  public function ‪PM_ATagWrap($icon, $cmd, $bMark = '', $isOpen = false)
64  {
65  return $icon;
66  }
67 
75  public function ‪wrapIcon($icon, $row)
76  {
77  return $icon;
78  }
79 
87  public function ‪ext_tree($pid, ‪$clause = '')
88  {
89  // Initialize:
90  $this->‪init(' AND ' . $this->BE_USER->getPagePermsClause(‪Permission::PAGE_SHOW) . ‪$clause);
91  // Get stored tree structure:
92  $this->stored = json_decode($this->BE_USER->uc['browseTrees']['browsePages'], true);
93  $treeArr = [];
94  $idx = 0;
95  // Set first:
96  $this->bank = $idx;
97  $isOpen = $this->stored[$idx][$pid] || ‪$this->expandFirst;
98  // save ids
99  $curIds = ‪$this->ids;
100  $this->‪reset();
101  $this->ids = $curIds;
102  if ($pid > 0) {
103  $rootRec = ‪BackendUtility::getRecordWSOL('pages', $pid);
104  $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
105  $firstHtml = $iconFactory->getIconForRecord('pages', $rootRec, ‪Icon::SIZE_SMALL)->render();
106  } else {
107  $rootRec = [
108  'title' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
109  'uid' => 0
110  ];
111  $firstHtml = $this->‪getRootIcon($rootRec);
112  }
113  $this->tree[] = ['HTML' => $firstHtml, 'row' => $rootRec, 'hasSub' => $isOpen];
114  if ($isOpen) {
115  // Set depth:
116  if ($this->addSelfId) {
117  $this->ids[] = $pid;
118  }
119  $this->‪getTree($pid, 999, '');
120  $idH = [];
121  $idH[$pid]['uid'] = $pid;
122  if (!empty($this->buffer_idH)) {
123  $idH[$pid]['subrow'] = ‪$this->buffer_idH;
124  }
125  $this->buffer_idH = $idH;
126  }
127  // Add tree:
128  return array_merge($treeArr, $this->tree);
129  }
130 }
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:30
‪TYPO3\CMS\Impexp\View\ExportPageTreeView\__construct
‪__construct()
Definition: ExportPageTreeView.php:34
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$clause
‪string $clause
Definition: AbstractTreeView.php:119
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$title
‪string $title
Definition: AbstractTreeView.php:74
‪TYPO3\CMS\Impexp\View\ExportPageTreeView
Definition: ExportPageTreeView.php:30
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$ids
‪array $ids
Definition: AbstractTreeView.php:182
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$buffer_idH
‪array $buffer_idH
Definition: AbstractTreeView.php:197
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$expandFirst
‪bool $expandFirst
Definition: AbstractTreeView.php:39
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:33
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:24
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\reset
‪reset()
Definition: AbstractTreeView.php:296
‪TYPO3\CMS\Impexp\View\ExportPageTreeView\ext_tree
‪array ext_tree($pid, $clause='')
Definition: ExportPageTreeView.php:87
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\getRootIcon
‪string getRootIcon($rec)
Definition: AbstractTreeView.php:606
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$bank
‪int $bank
Definition: AbstractTreeView.php:219
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:33
‪TYPO3\CMS\Impexp\View\ExportPageTreeView\wrapTitle
‪string wrapTitle($title, $row, $bank=0)
Definition: ExportPageTreeView.php:49
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:139
‪TYPO3\CMS\Backend\Tree\View\BrowseTreeView\init
‪init($clause='', $orderByFields='')
Definition: BrowseTreeView.php:78
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractTreeView.php:941
‪TYPO3\CMS\Impexp\View\ExportPageTreeView\wrapIcon
‪string wrapIcon($icon, $row)
Definition: ExportPageTreeView.php:75
‪TYPO3\CMS\Backend\Tree\View\BrowseTreeView
Definition: BrowseTreeView.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView\getTree
‪int getTree($uid, $depth=999, $depthData='')
Definition: AbstractTreeView.php:695
‪TYPO3\CMS\Impexp\View\ExportPageTreeView\PM_ATagWrap
‪string PM_ATagWrap($icon, $cmd, $bMark='', $isOpen=false)
Definition: ExportPageTreeView.php:63
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Impexp\View
Definition: ExportPageTreeView.php:16