2 namespace TYPO3\CMS\Backend\View;
65 parent::__construct();
76 public function wrapIcon($thePageIcon, &$row)
83 $lockIcon =
'<a href="#" onclick="' . htmlspecialchars($aOnClick) .
'">'
84 .
'<span title="' . htmlspecialchars($lockInfo[
'msg']) .
'">' . $iconFactory->getIcon(
'status-warning-in-use',
Icon::SIZE_SMALL)->render() .
'</span></a>';
89 if (!$this->ext_IconMode) {
91 }
elseif ($this->ext_IconMode ===
'titlelink') {
93 $thePageIcon =
'<a href="#" onclick="' . htmlspecialchars($aOnClick) .
'">' . $thePageIcon .
'</a>';
96 $dragDropIcon =
'<span class="list-tree-icon dragIcon" id="dragIconID_' . $row[
'uid'] .
'">' . $thePageIcon .
'</span> ';
99 if ($this->ext_showPageId) {
100 $pageIdStr =
'<span class="dragId">[' . $row[
'uid'] .
']</span> ';
104 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'GLOBAL'][
'recStatInfoHooks'])) {
105 $_params = array(
'pages', $row[
'uid']);
106 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'GLOBAL'][
'recStatInfoHooks'] as $_funcRef) {
110 return $dragDropIcon . $lockIcon . $pageIdStr . $stat;
125 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/class.webpagetree.php'][
'pageTitleOverlay'])) {
126 $_params = array(
'title' => &
$title,
'row' => &$row);
127 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/class.webpagetree.php'][
'pageTitleOverlay'] as $_funcRef) {
137 return '<span class="list-tree-title dragTitle" id="dragTitleID_' . $row[
'uid'] .
'">' . $thePageTitle .
'</span>';
148 $titleLen = (int)$this->BE_USER->uc[
'titleLen'];
149 if (!is_array($treeArr)) {
152 $out =
'<ul class="list-tree list-tree-root">';
156 if (($PMpos = strpos($PM,
'#')) !==
false) {
157 $PM = substr($PM, 0, $PMpos);
159 $PM = explode(
'_', $PM);
163 $expandedPageUid = null;
164 $collapsedPageUid = null;
165 if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX && is_array($PM) && count($PM) === 4 && $PM[2] != 0) {
167 $expandedPageUid = $PM[2];
170 $collapsedPageUid = $PM[2];
176 $closeDepth = array();
178 $invertedDepthOfAjaxRequestedItem = 0;
179 foreach ($treeArr as $k => $treeItem) {
180 $classAttr = $treeItem[
'row'][
'_CSSCLASS'];
181 $uid = $treeItem[
'row'][
'uid'];
182 $idAttr = htmlspecialchars($this->domIdPrefix . $this->
getId($treeItem[
'row']) .
'_' . $treeItem[
'bank']);
186 if ($treeItem[
'isFirst'] && !$doCollapse && (!$doExpand || (
int)$expandedPageUid !== (
int)$uid)) {
187 $itemHTML =
'<ul class="list-tree">';
191 if ($treeItem[
'hasSub']) {
192 $classAttr .=
' list-tree-control-open';
194 $itemHTML .=
'<li id="' . $idAttr .
'" ' . ($classAttr ?
' class="' . trim($classAttr) .
'"' :
'')
195 .
'><span class="list-tree-group">' . $treeItem[
'HTML']
196 . $this->
wrapTitle($this->
getTitleStr($treeItem[
'row'], $titleLen), $treeItem[
'row'], $treeItem[
'bank']) .
'</span>';
197 if (!$treeItem[
'hasSub']) {
198 $itemHTML .=
'</li>';
203 if ($treeItem[
'isLast'] && !($doExpand && $expandedPageUid == $uid)) {
204 $closeDepth[$treeItem[
'invertedDepth']] = 1;
208 if ($treeItem[
'isLast'] && !$treeItem[
'hasSub'] && !$doCollapse && !($doExpand && $expandedPageUid == $uid)) {
209 for ($i = $treeItem[
'invertedDepth']; $closeDepth[$i] == 1; $i++) {
211 $itemHTML .=
'</ul></li>';
215 if ($doCollapse && (
int)$collapsedPageUid === (int)$uid) {
216 $this->ajaxStatus =
true;
220 if ($doExpand && (
int)$expandedPageUid === (int)$uid) {
221 $ajaxOutput .= $itemHTML;
222 $invertedDepthOfAjaxRequestedItem = $treeItem[
'invertedDepth'];
223 }
elseif ($invertedDepthOfAjaxRequestedItem) {
224 if ($treeItem[
'invertedDepth'] < $invertedDepthOfAjaxRequestedItem) {
225 $ajaxOutput .= $itemHTML;
227 $this->ajaxStatus =
true;
234 $this->ajaxStatus =
true;
254 public function PMicon($row, $a, $c, $nextCount, $exp)
258 $cmd = $this->bank .
'_' . ($exp ?
'0_' :
'1_') . $row[
'uid'] .
'_' . $this->treeName;
275 if ($this->thisScript) {
278 return '<a class="list-tree-control' . (!$isExpand ?
' list-tree-control-open' :
' list-tree-control-closed') .
'" onclick="' . $js .
'"><i class="fa"></i></a>';
298 foreach ($this->MOUNTS as $idx => $uid) {
301 $isOpen = $this->stored[$idx][$uid] || $this->expandFirst || $uid ===
'0';
305 $this->ids = $curIds;
309 $cmd = $this->bank .
'_' . ($isOpen ?
'0_' :
'1_') . $uid .
'_' . $this->treeName;
310 $firstHtml =
'<a class="list-tree-control list-tree-control-' . ($isOpen ?
'open' :
'closed')
311 .
'" href="' . htmlspecialchars($this->
getThisScript() .
'PM=' . $cmd) .
'"><i class="fa"></i></a>';
316 $firstHtml .= $this->
getIcon($rootRec);
322 if (is_array($rootRec)) {
324 $uid = $rootRec[
'uid'];
326 $this->tree[] = array(
'HTML' => $firstHtml,
'row' => $rootRec,
'bank' => $this->bank,
'hasSub' =>
true,
'invertedDepth' => 1000);
330 if ($this->addSelfId) {
336 $treeArr = array_merge($treeArr, $this->tree);