[TASK] Improve page tree in access module 19/51719/2
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 16 Feb 2017 15:06:51 +0000 (16:06 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Feb 2017 23:14:29 +0000 (00:14 +0100)
If the root page is selected, the following is improved:

- show the sitename instead of '[root-level]'
- show the world icon for the first pages (all with pid = 0)

Resolves: #79857
Releases: master
Change-Id: I449a34e356ec43f8679bb9cdcd4c790fd4701004
Reviewed-on: https://review.typo3.org/51719
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/beuser/Classes/Controller/PermissionController.php

index a1fd88e..afd4c79 100644 (file)
@@ -689,7 +689,8 @@ abstract class AbstractTreeView
         }
         $title = $this->showDefaultTitleAttribute ? htmlspecialchars('UID: ' . $row['uid']) : $this->getTitleAttrib($row);
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-        $icon = '<span title="' . $title . '">' . $iconFactory->getIconForRecord($this->table, $row, Icon::SIZE_SMALL)->render() . '</span>';
+        $icon = $row['pid'] === 0 ? $iconFactory->getIcon('apps-pagetree-folder-root', Icon::SIZE_SMALL) : $iconFactory->getIconForRecord($this->table, $row, Icon::SIZE_SMALL);
+        $icon = '<span title="' . $title . '">' . $icon->render() . '</span>';
         return $this->wrapIcon($icon, $row);
     }
 
index 6317ded..e731d9c 100644 (file)
@@ -210,7 +210,7 @@ class PermissionController extends ActionController
     public function indexAction()
     {
         if (!$this->id) {
-            $this->pageInfo = ['title' => '[root-level]', 'uid' => 0, 'pid' => 0];
+            $this->pageInfo = ['title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], 'uid' => 0, 'pid' => 0];
         }
 
         if ($this->getBackendUser()->workspace != 0) {
@@ -280,7 +280,7 @@ class PermissionController extends ActionController
         $this->view->assign('depth', $this->depth);
 
         if (!$this->id) {
-            $this->pageInfo = ['title' => '[root-level]', 'uid' => 0, 'pid' => 0];
+            $this->pageInfo = ['title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], 'uid' => 0, 'pid' => 0];
         }
         if ($this->getBackendUser()->workspace != 0) {
             // Adding FlashMessage with the permission setting matrix: