From fee4c94a989f23f98c55654dda02fbe35ab02294 Mon Sep 17 00:00:00 2001
From: Jan Helke <typo3@helke.de>
Date: Wed, 28 Oct 2015 17:27:57 +0100
Subject: [PATCH] [BUGFIX] Enable icon for "Show Content From Page" for root
 page

When the root page is showing content from another page now the
correct "root" icon is displayed instead of the icon for normal
pages.

Resolves: #70617
Releases: master
Change-Id: I42d7aae521b40518d8087b004c44af02aeb9a177
Reviewed-on: https://review.typo3.org/44335
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Classes/Imaging/IconFactory.php | 6 +++++-
 typo3/sysext/core/Configuration/TCA/pages.php     | 1 +
 typo3/sysext/core/ext_tables.php                  | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/core/Classes/Imaging/IconFactory.php b/typo3/sysext/core/Classes/Imaging/IconFactory.php
index 49a13851aac6..5ecb1e809ea8 100644
--- a/typo3/sysext/core/Classes/Imaging/IconFactory.php
+++ b/typo3/sysext/core/Classes/Imaging/IconFactory.php
@@ -203,7 +203,11 @@ class IconFactory
                     $recordType[4] = 'contains-' . $row['module'];
                 }
                 if ((int)$row['content_from_pid'] > 0) {
-                    $recordType[4] = (int)$row['nav_hide'] === 0 ? 'page-contentFromPid' : 'page-contentFromPid-hideinmenu';
+                    if ($row['is_siteroot']) {
+                        $recordType[4] = 'page-contentFromPid-root';
+                    } else {
+                        $recordType[4] = (int)$row['nav_hide'] === 0 ? 'page-contentFromPid' : 'page-contentFromPid-hideinmenu';
+                    }
                 }
             }
             if (is_array($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes'])) {
diff --git a/typo3/sysext/core/Configuration/TCA/pages.php b/typo3/sysext/core/Configuration/TCA/pages.php
index cec41d7ceafc..7fb4e07b2b34 100644
--- a/typo3/sysext/core/Configuration/TCA/pages.php
+++ b/typo3/sysext/core/Configuration/TCA/pages.php
@@ -53,6 +53,7 @@ return array(
             'contains-board' => 'apps-pagetree-folder-contains-board',
             'contains-news' => 'apps-pagetree-folder-contains-news',
             'page-contentFromPid' => 'apps-pagetree-page-content-from-page',
+            'page-contentFromPid-root' => 'apps-pagetree-page-content-from-page-root',
             'page-contentFromPid-hideinmenu' => 'apps-pagetree-page-content-from-page-hideinmenu',
             'default' => 'apps-pagetree-page-default'
         ),
diff --git a/typo3/sysext/core/ext_tables.php b/typo3/sysext/core/ext_tables.php
index 68e981655a83..8220db7a83d8 100644
--- a/typo3/sysext/core/ext_tables.php
+++ b/typo3/sysext/core/ext_tables.php
@@ -301,6 +301,7 @@ $GLOBALS['TBE_STYLES']['spriteIconApi']['coreSpriteImageNames'] = array(
     'apps-pagetree-page-backend-users-hideinmenu',
     'apps-pagetree-page-backend-users-root',
     'apps-pagetree-page-content-from-page',
+    'apps-pagetree-page-content-from-page-root',
     'apps-pagetree-page-content-from-page-hideinmenu',
     'apps-pagetree-page-default',
     'apps-pagetree-page-domain',
-- 
GitLab