From: Alexander Ebert Date: Sun, 26 Jun 2016 11:23:01 +0000 (+0200) Subject: Added context support for html processors X-Git-Tag: 3.0.0_Beta_1~61 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2cccc1b69468888b3989375ab5bf057db0b47c97;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git Added context support for html processors --- diff --git a/files/lib/data/conversation/message/ConversationMessage.class.php b/files/lib/data/conversation/message/ConversationMessage.class.php index b38799c..d60499f 100644 --- a/files/lib/data/conversation/message/ConversationMessage.class.php +++ b/files/lib/data/conversation/message/ConversationMessage.class.php @@ -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(); } /** diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index 15ac7c3..63edb38 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -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; }