From 2163ec8f916952b8a816170469c1b42a3c3fc7ea Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 25 Sep 2016 10:55:30 +0200 Subject: [PATCH] Resolve page location-related todos --- files/lib/page/ConversationListPage.class.php | 5 ++--- files/lib/page/ConversationPage.class.php | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/lib/page/ConversationListPage.class.php b/files/lib/page/ConversationListPage.class.php index 931c700..efe062d 100644 --- a/files/lib/page/ConversationListPage.class.php +++ b/files/lib/page/ConversationListPage.class.php @@ -174,9 +174,8 @@ class ConversationListPage extends SortablePage { } if ($this->filter != '') { - // add breadcrumbs - // TODO: this is not working at the moment as PageLocationManager already sets this as the current page based on request data which is later discarded - PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList'); + // `-1` = pseudo object id to have to pages with identifier `com.woltlab.wcf.conversation.ConversationList` + PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList', -1); } // read stats diff --git a/files/lib/page/ConversationPage.class.php b/files/lib/page/ConversationPage.class.php index 8d1bb19..6311f73 100644 --- a/files/lib/page/ConversationPage.class.php +++ b/files/lib/page/ConversationPage.class.php @@ -16,6 +16,7 @@ use wcf\system\exception\IllegalLinkException; use wcf\system\exception\PermissionDeniedException; use wcf\system\message\quote\MessageQuoteManager; use wcf\system\page\PageLocationManager; +use wcf\system\page\ParentPageLocation; use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\HeaderUtil; @@ -166,14 +167,14 @@ class ConversationPage extends MultipleLinkPage { parent::readData(); // add breadcrumbs - PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList'); if ($this->conversation->isDraft) { - /* TODO - WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.folder.draft'), LinkHandler::getInstance()->getLink('ConversationList', [ - 'filter' => 'draft' - ]))); - */ + // `-1` = pseudo object id to have to pages with identifier `com.woltlab.wcf.conversation.ConversationList` + PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList', -1, new ParentPageLocation( + WCF::getLanguage()->get('wcf.conversation.folder.draft'), + LinkHandler::getInstance()->getLink('ConversationList', ['filter' => 'draft']) + )); } + PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList'); // update last visit time count if ($this->conversation->isNew() && $this->objectList->getMaxPostTime() > $this->conversation->lastVisitTime) { -- 2.20.1