Improved quote system
authorAlexander Ebert <ebert@woltlab.com>
Wed, 3 Apr 2013 00:04:44 +0000 (02:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 3 Apr 2013 00:04:44 +0000 (02:04 +0200)
files/lib/data/conversation/message/ConversationMessageAction.class.php

index 47bbd3f8d9fae39e17899f050a6fa84d3f8c207e..1771665259ce8a69b68731dd0fc51a26ca29b613 100644 (file)
@@ -434,4 +434,27 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(array('com.woltlab.wcf.conversation.message'))
                );
        }
+       
+       /**
+        * @see wcf\data\IMessageQuoteAction::validateGetRenderedQuotes()
+        */
+       public function validateGetRenderedQuotes() {
+               $this->readInteger('parentObjectID');
+               
+               $this->conversation = new Conversation($this->parameters['parentObjectID']);
+               if (!$this->conversation->conversationID) {
+                       throw new UserInputException('parentObjectID');
+               }
+       }
+       
+       /**
+        * @see wcf\data\IMessageQuoteAction::getRenderedQuotes()
+        */
+       public function getRenderedQuotes() {
+               $quotes = MessageQuoteManager::getInstance()->getQuotesByParentObjectID('com.woltlab.wbb.conversation.message', $this->conversation->conversationID);
+       
+               return array(
+                       'template' => implode("\n\n", $quotes)
+               );
+       }
 }