[BUGFIX] Show mountpoint path in record + link browsers if enabled in UserTS 50/49750/3
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 1 Sep 2016 13:31:59 +0000 (15:31 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 26 Oct 2016 14:38:49 +0000 (16:38 +0200)
If options.pageTree.showPathAboveMounts is enabled in
UserTS, respect the setting also in record and link
browsers.

Resolves: #77734
Releases: master, 7.6
Change-Id: I492d8a7eb3a8c557c231be7aaf58dfa8dd90cc7d
Reviewed-on: https://review.typo3.org/49750
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Build/Resources/Public/Less/TYPO3/_element_tree.less
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/ElementBrowserPageTreeView.php
typo3/sysext/backend/Resources/Public/Css/backend.css
typo3/sysext/recordlist/Classes/Browser/DatabaseBrowser.php
typo3/sysext/recordlist/Classes/LinkHandler/PageLinkHandler.php

index 219795d..baaa2b3 100644 (file)
                &:before {
                        display: none;
                }
+               &.list-tree-path {
+                       margin-left: -@tree-control-size;
+               }
                > .list-tree-group {
                        > .list-tree-control {
                                margin-left: -@tree-control-size;
index 94e1bad..72f3876 100644 (file)
@@ -396,6 +396,15 @@ abstract class AbstractTreeView
                 if (is_array($rootRec)) {
                     $firstHtml .= $this->getIcon($rootRec);
                 }
+
+                if ($this->ext_showPathAboveMounts) {
+                    $mountPointPid = $rootRec['pid'];
+                    if ($lastMountPointPid !== $mountPointPid) {
+                        $title = \TYPO3\CMS\Backend\Tree\Pagetree\Commands::getMountPointPath($mountPointPid);
+                        $this->tree[] = ['isMountPointPath' => true, 'title' => $title];
+                    }
+                    $lastMountPointPid = $mountPointPid;
+                }
             } else {
                 // Artificial record for the tree root, id=0
                 $rootRec = $this->getRootRecord();
index 1ed6596..ff54f52 100644 (file)
@@ -100,6 +100,11 @@ class ElementBrowserPageTreeView extends BrowseTreeView
         // so we know how many we have to close when all children are done rendering
         $closeDepth = [];
         foreach ($treeArr as $treeItem) {
+            if ($treeItem['isMountPointPath']) {
+                $out .= '<li class="list-tree-path">' . $treeItem['title'] . '</li>';
+                continue;
+            }
+
             $classAttr = $treeItem['row']['_CSSCLASS'];
             if ($treeItem['isFirst']) {
                 $out .= '<ul class="list-tree">';
index be41d69..a1da708 100644 (file)
@@ -11406,6 +11406,9 @@ div.t3-form-field-container:first-child .t3-form-field-label-flex {
 .list-tree-root > li:before {
   display: none;
 }
+.list-tree-root > li.list-tree-path {
+  margin-left: -20px;
+}
 .list-tree-root > li > .list-tree-group > .list-tree-control {
   margin-left: -20px;
 }
index cca4669..82fb5e4 100644 (file)
@@ -89,6 +89,7 @@ class DatabaseBrowser extends AbstractElementBrowser implements ElementBrowserIn
         $pageTree->ext_pArrPages = $allowedTables === 'pages';
         $pageTree->ext_showNavTitle = (bool)$backendUser->getTSConfigVal('options.pageTree.showNavTitle');
         $pageTree->ext_showPageId = (bool)$backendUser->getTSConfigVal('options.pageTree.showPageIdWithTitle');
+        $pageTree->ext_showPathAboveMounts = (bool)$backendUser->getTSConfigVal('options.pageTree.showPathAboveMounts');
         $pageTree->addField('nav_title');
         $tree = $pageTree->getBrowsableTree();
 
index 412d417..48f2179 100644 (file)
@@ -119,8 +119,9 @@ class PageLinkHandler extends AbstractLinkHandler implements LinkHandlerInterfac
         /** @var ElementBrowserPageTreeView $pageTree */
         $pageTree = GeneralUtility::makeInstance(ElementBrowserPageTreeView::class);
         $pageTree->setLinkParameterProvider($this);
-        $pageTree->ext_showPageId = (bool)$backendUser->getTSConfigVal('options.pageTree.showPageIdWithTitle');
         $pageTree->ext_showNavTitle = (bool)$backendUser->getTSConfigVal('options.pageTree.showNavTitle');
+        $pageTree->ext_showPageId = (bool)$backendUser->getTSConfigVal('options.pageTree.showPageIdWithTitle');
+        $pageTree->ext_showPathAboveMounts = (bool)$backendUser->getTSConfigVal('options.pageTree.showPathAboveMounts');
         $pageTree->addField('nav_title');
 
         $this->view->assign('temporaryTreeMountCancelLink', $this->getTemporaryTreeMountCancelNotice());