<?php
namespace wcf\data\conversation;
use wcf\data\conversation\message\ConversationMessage;
+use wcf\data\ITitledLinkObject;
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObject;
-use wcf\system\breadcrumb\Breadcrumb;
-use wcf\system\breadcrumb\IBreadcrumbProvider;
use wcf\system\conversation\ConversationHandler;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\UserInputException;
* @property-read integer $isDraft
* @property-read string $draftData
*/
-class Conversation extends DatabaseObject implements IBreadcrumbProvider, IRouteController {
+class Conversation extends DatabaseObject implements IRouteController, ITitledLinkObject {
/**
* @inheritDoc
*/
/**
* @inheritDoc
*/
- public function getBreadcrumb() {
- return new Breadcrumb($this->subject, LinkHandler::getInstance()->getLink('Conversation', [
- 'object' => $this
- ]));
+ public function getLink() {
+ return LinkHandler::getInstance()->getLink('Conversation', ['object' => $this]);
}
/**
use wcf\data\conversation\Conversation;
use wcf\data\conversation\ConversationAction;
use wcf\data\user\UserProfile;
-use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\conversation\ConversationHandler;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\UserInputException;
use wcf\system\message\quote\MessageQuoteManager;
+use wcf\system\page\PageLocationManager;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
parent::readData();
// add breadcrumbs
- WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
+ PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList');
}
/**
use wcf\data\conversation\message\ConversationMessageAction;
use wcf\data\conversation\message\ViewableConversationMessageList;
use wcf\data\conversation\Conversation;
-use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\message\quote\MessageQuoteManager;
use wcf\system\message\QuickReplyManager;
+use wcf\system\page\PageLocationManager;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
}
// add breadcrumbs
- WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
- WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb());
+ PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.Conversation', $this->conversation->conversationID, $this->conversation);
+ PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList');
// get message list
$this->messageList = new ViewableConversationMessageList();
use wcf\data\conversation\message\ViewableConversationMessageList;
use wcf\data\conversation\ConversationAction;
use wcf\data\user\UserProfile;
-use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
+use wcf\system\page\PageLocationManager;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
}
// add breadcrumbs
- WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
- WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb());
+ PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.Conversation', $this->conversation->conversationID, $this->conversation);
+ PageLocationManager::getInstance()->addParentLocation('com.woltlab.wcf.conversation.ConversationList');
// get message list
$this->messageList = new ViewableConversationMessageList();
use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\clipboard\ClipboardHandler;
use wcf\system\exception\IllegalLinkException;
-use wcf\system\request\LinkHandler;
+use wcf\system\page\PageLocationManager;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
if ($this->filter != '') {
// add breadcrumbs
- WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
+ // 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');
}
// read stats
use wcf\data\smiley\SmileyCache;
use wcf\system\attachment\AttachmentHandler;
use wcf\system\bbcode\BBCodeHandler;
-use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\message\quote\MessageQuoteManager;
+use wcf\system\page\PageLocationManager;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
parent::readData();
// add breadcrumbs
- WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
+ 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'
])));
+ */
}
// update last visit time count