public function getLink() {
return LinkHandler::getInstance()->getLink('Conversation', array(
'object' => $this->getConversation(),
- 'messageID' => $this->messageID,
+ 'messageID' => $this->messageID
), '#message'.$this->messageID);
}
<?php
namespace wcf\data\conversation\message;
use wcf\data\conversation\Conversation;
+use wcf\data\search\ISearchResultObject;
+use wcf\system\request\LinkHandler;
use wcf\system\search\SearchResultTextParser;
/**
* @subpackage data.conversation.message
* @category Community Framework
*/
-class SearchResultConversationMessage extends ViewableConversationMessage {
+class SearchResultConversationMessage extends ViewableConversationMessage implements ISearchResultObject {
/**
* conversation object
* @var wcf\data\conversation\Conversation
public function getFormattedMessage() {
return SearchResultTextParser::getInstance()->parse($this->getDecoratedObject()->getFormattedMessage());
}
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getSubject()
+ */
+ public function getSubject() {
+ return $this->subject;
+ }
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getLink()
+ */
+ public function getLink($query = '') {
+ if ($query) {
+ return LinkHandler::getInstance()->getLink('Conversation', array(
+ 'object' => $this->getConversation(),
+ 'messageID' => $this->messageID,
+ 'highlight' => urlencode($query)
+ ), '#message'.$this->messageID);
+ }
+
+ return $this->getDecoratedObject()->getLink();
+ }
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getTime()
+ */
+ public function getTime() {
+ return $this->time;
+ }
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getObjectTypeName()
+ */
+ public function getObjectTypeName() {
+ return 'com.woltlab.wcf.conversation.message';
+ }
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getContainerTitle()
+ */
+ public function getContainerTitle() {
+ return '';
+ }
+
+ /**
+ * @see wcf\data\search\ISearchResultObject::getContainerLink()
+ */
+ public function getContainerLink() {
+ return '';
+ }
}
public $messageCache = array();
/**
- * @see wcf\system\search\ISearchableObjectType::cacheMessageData()
+ * @see wcf\system\search\ISearchableObjectType::cacheObjects()
*/
- public function cacheMessageData(array $objectIDs, array $additionalData = null) {
+ public function cacheObjects(array $objectIDs, array $additionalData = null) {
$messageList = new SearchResultConversationMessageList();
$messageList->getConditionBuilder()->add('conversation_message.messageID IN (?)', array($objectIDs));
$messageList->readObjects();
foreach ($messageList->getObjects() as $message) {
- $this->messageCache[$message->messageID] = array('type' => 'com.woltlab.wcf.conversation.message', 'message' => $message);
+ $this->messageCache[$message->messageID] = $message;
}
}
/**
- * @see wcf\system\search\ISearchableObjectType::cacheMessageData()
+ * @see wcf\system\search\ISearchableObjectType::getObject()
*/
- public function getMessageData($objectID) {
+ public function getObject($objectID) {
if (isset($this->messageCache[$objectID])) return $this->messageCache[$objectID];
return null;
}
- /**
- * @see wcf\system\search\ISearchableObjectType::getResultTemplateName()
- */
- public function getResultTemplateName() {
- return 'searchResultConversationMessage';
- }
-
/**
* @see wcf\system\search\ISearchableObjectType::getJoins()
*/
<item name="wcf.conversation.label.assignLabels"><![CDATA[Label zuweisen]]></item>
</category>
+ <category name="wcf.search">
+ <item name="wcf.search.type.com.woltlab.wcf.conversation.message"><![CDATA[Konversationen]]></item>
+ <item name="wcf.search.object.com.woltlab.wcf.conversation.message"><![CDATA[Konversation]]></item>
+ </category>
+
<category name="wcf.user.notification">
<item name="wcf.user.notification.conversation.message.output"><![CDATA[Hat auf die Konversation „<a href="{link controller='Conversation' object=$message->getConversation()}messageID={@$message->messageID}{/link}#message{@$message->messageID}">{$message->getTitle()}</a>“ geantwortet.]]></item>
<item name="wcf.user.notification.conversation.message.shortOutput"><![CDATA[Neue Antwort auf Konversation]]></item>
+++ /dev/null
-<article class="message messageReduced marginTop">
- <div>
- <section class="messageContent">
- <div>
- <header class="messageHeader">
- <p class="messageCounter"><a href="{link controller='Conversation' object=$item[message]->getConversation()}messageID={@$item[message]->messageID}{/link}#message{@$item[message]->messageID}" title="{lang}wcf.conversation.message.permalink{/lang}" class="button jsTooltip">{#$startIndex}</a></p>
-
- <div class="box32">
- <a href="{link controller='User' object=$item[message]->getUserProfile()}{/link}" class="framed">{@$item[message]->getUserProfile()->getAvatar()->getImageTag(32)}</a>
-
- <hgroup class="messageHeadline">
- <h1><a href="{link controller='Conversation' object=$item[message]->getConversation()}messageID={@$item[message]->messageID}&highlight={$query|urlencode}{/link}#message{@$item[message]->messageID}">{$item[message]->subject}</a></h1>
- <h2>
- <span class="username"><a href="{link controller='User' object=$item[message]->getUserProfile()}{/link}" class="userLink" data-user-id="{@$item[message]->userID}">{$item[message]->username}</a></span>
- {@$item[message]->time|time}
- </h2>
- </hgroup>
- </div>
- </header>
-
- <div class="messageBody">
- <div>
- {@$item[message]->getFormattedMessage()}
- </div>
-
- <footer class="messageOptions">
- <nav class="breadcrumbs marginTop">
- <ul>
- <li><a href="{link controller='Conversation' object=$item[message]->getConversation()}highlight={$query|urlencode}{/link}" title="{$item[message]->subject}"><span>{$item[message]->subject}</span></a> <span class="pointer"><span>»</span></span></li>
- </ul>
- </nav>
-
- <nav>
- <ul class="smallButtons buttonGroup"><li class="toTopLink"><a href="{@$__wcf->getAnchor('top')}" title="{lang}wcf.global.scrollUp{/lang}" class="button jsTooltip"><span class="icon icon16 icon-arrow-up"></span> <span class="invisible">{lang}wcf.global.scrollUp{/lang}</span></a></li></ul>
- </nav>
- </footer>
- </div>
- </div>
- </section>
- </div>
-</article>