Added context support for html processors
authorAlexander Ebert <ebert@woltlab.com>
Sun, 26 Jun 2016 11:23:01 +0000 (13:23 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 26 Jun 2016 11:23:08 +0000 (13:23 +0200)
files/lib/data/conversation/message/ConversationMessage.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php

index b38799c798a6b08e7da6aa5bfc7c8746514c5c75..d60499f64ee4f4f1388f3f27e26c90a14485254a 100644 (file)
@@ -62,13 +62,10 @@ class ConversationMessage extends DatabaseObject implements IMessage {
                // assign embedded objects
                MessageEmbeddedObjectManager::getInstance()->setActiveMessage('com.woltlab.wcf.conversation.message', $this->messageID);
                
-               // TODO
-               return (new HtmlOutputProcessor())->process($this->message);
+               $processor = new HtmlOutputProcessor();
+               $processor->process($this->message, 'com.woltlab.wcf.conversation.message', $this->messageID);
                
-               // TODO
-               // parse and return message
-               /*MessageParser::getInstance()->setOutputType('text/html');
-               return MessageParser::getInstance()->parse($this->message, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes);*/
+               return $processor->getHtml();
        }
        
        /**
index 15ac7c382a97cdc0e854b66e4533664b9cd0a85e..63edb387acb48a46b5ed0ca12c014d43526973c4 100644 (file)
@@ -392,7 +392,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                
                $this->validateBeginEdit();
                
-               $this->validateMessage($this->conversation, $this->getHtmlInputProcessor($this->parameters['data']['message']));
+               $this->validateMessage($this->conversation, $this->getHtmlInputProcessor($this->parameters['data']['message'], $this->message->messageID));
        }
        
        /**
@@ -644,13 +644,13 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        /**
         * @inheritDoc
         */
-       public function getHtmlInputProcessor($message = null) {
+       public function getHtmlInputProcessor($message = null, $objectID = 0) {
                if ($message === null) {
                        return $this->htmlInputProcessor;
                }
                
                $this->htmlInputProcessor = new HtmlInputProcessor();
-               $this->htmlInputProcessor->process($message);
+               $this->htmlInputProcessor->process($message, 'com.woltlab.wcf.conversation.message', $objectID);
                
                return $this->htmlInputProcessor;
        }