public function Tinhte_XenTag_actionSave(XenForo_DataWriter_DiscussionMessage_Post $dw) { /* @var $tagModel Tinhte_XenTag_Model_Tag */ $tagModel = $this->getModelFromCache('Tinhte_XenTag_Model_Tag'); $forum = $dw->getExtraData(XenForo_DataWriter_DiscussionMessage_Post::DATA_FORUM); $thread = $this->_getPostModel()->Tinhte_XenTag_getThread($dw->get('post_id')); if ($tagModel->canTagThread($thread, $forum)) { $tags = $this->getModelFromCache('Tinhte_XenTag_Model_Tag')->processInput($this->_input); if ($tags !== false) { /* @var $threadDw XenForo_DataWriter_Discussion_Thread */ $threadDw = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread'); $threadDw->setExistingData($dw->get('thread_id')); $threadDw->Tinhte_XenTag_setTags($tags); $threadDw->save(); } } // sondh@2012-08-11 // just to be safe... unset($GLOBALS[Tinhte_XenTag_Constants::GLOBALS_CONTROLLERPUBLIC_POST_SAVE]); }