Fixed title of the landing page in breadcrumbs
authorMarcel Werk <burntime@woltlab.com>
Sun, 18 Dec 2016 17:32:37 +0000 (18:32 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 18 Dec 2016 17:32:42 +0000 (18:32 +0100)
wcfsetup/install/files/lib/system/page/PageLocationManager.class.php

index ee0ed7e69ee197b55f9531c5cc432b562b58a271..dc74dab401b5b0ce896976d158531ef9cab625d0 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\ITitledLinkObject;
 use wcf\system\exception\SystemException;
 use wcf\system\request\RequestHandler;
 use wcf\system\SingletonFactory;
+use wcf\system\WCF;
 
 /**
  * Handles page locations for use with menu active markings.
@@ -98,6 +99,10 @@ class PageLocationManager extends SingletonFactory {
                        $title = $page->getTitle();
                }
                
+               if ($page->isLandingPage) {
+                       $title = WCF::getLanguage()->get(PAGE_TITLE);
+               }
+               
                $this->stack[] = [
                        'identifier' => $identifier,
                        'link' => $link,
@@ -134,13 +139,19 @@ class PageLocationManager extends SingletonFactory {
                                $page = PageCache::getInstance()->getPage($location['pageID']);
                                while ($page !== null && $page->parentPageID) {
                                        $page = PageCache::getInstance()->getPage($page->parentPageID);
+                                       if ($page->isLandingPage) {
+                                               $title = WCF::getLanguage()->get(PAGE_TITLE);
+                                       }
+                                       else {
+                                               $title = $page->getTitle();
+                                       }
                                        
                                        $this->stack[] = [
                                                'identifier' => $page->identifier,
                                                'link' => $page->getLink(),
                                                'pageID' => $page->pageID,
                                                'pageObjectID' => 0,
-                                               'title' => $page->getTitle(),
+                                               'title' => $title,
                                                'useAsParentLocation' => false
                                        ];
                                }