TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
ExportPageTreeView.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Impexp\View;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 
27 {
31  public function __construct()
32  {
33  parent::__construct();
34  $this->init();
35  }
36 
46  public function wrapTitle($title, $row, $bank = 0)
47  {
48  return trim($title) === '' ? '<em>[' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.no_title')) . ']</em>' : htmlspecialchars($title);
49  }
50 
60  public function PM_ATagWrap($icon, $cmd, $bMark = '', $isOpen = false)
61  {
62  return $icon;
63  }
64 
72  public function wrapIcon($icon, $row)
73  {
74  return $icon;
75  }
76 
84  public function ext_tree($pid, $clause = '')
85  {
86  // Initialize:
87  $this->init(' AND ' . $this->BE_USER->getPagePermsClause(1) . $clause);
88  // Get stored tree structure:
89  $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages'], ['allowed_classes' => false]);
90  $treeArr = [];
91  $idx = 0;
92  // Set first:
93  $this->bank = $idx;
94  $isOpen = $this->stored[$idx][$pid] || $this->expandFirst;
95  // save ids
96  $curIds = $this->ids;
97  $this->reset();
98  $this->ids = $curIds;
99  if ($pid > 0) {
100  $rootRec = BackendUtility::getRecordWSOL('pages', $pid);
101  $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
102  $firstHtml = $iconFactory->getIconForRecord('pages', $rootRec, Icon::SIZE_SMALL)->render();
103  } else {
104  $rootRec = [
105  'title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
106  'uid' => 0
107  ];
108  $firstHtml = $this->getRootIcon($rootRec);
109  }
110  $this->tree[] = ['HTML' => $firstHtml, 'row' => $rootRec, 'hasSub' => $isOpen];
111  if ($isOpen) {
112  // Set depth:
113  if ($this->addSelfId) {
114  $this->ids[] = $pid;
115  }
116  $this->getTree($pid, 999, '');
117  $idH = [];
118  $idH[$pid]['uid'] = $pid;
119  if (!empty($this->buffer_idH)) {
120  $idH[$pid]['subrow'] = $this->buffer_idH;
121  }
122  $this->buffer_idH = $idH;
123  }
124  // Add tree:
125  return array_merge($treeArr, $this->tree);
126  }
127 }
static getRecordWSOL($table, $uid, $fields= '*', $where= '', $useDeleteClause=true, $unsetMovePointers=false)
getTree($uid, $depth=999, $depthData= '')
PM_ATagWrap($icon, $cmd, $bMark= '', $isOpen=false)
if(TYPO3_MODE=== 'BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']
static makeInstance($className,...$constructorArguments)
init($clause= '', $orderByFields= '')