/** * rejects the comments, and removes from the database from the db */ function _rejectComments() { $comments = new UnmoderatedComments(); foreach ($this->_updateComments as $commentId) { $comments->deleteComment($commentId); } $this->_view = new AdminUnmoderatedCommentsview($this->_blogInfo); $this->_view->setSuccessMessage($this->_locale->tr("moderate_comments_rejected_ok")); $this->setCommonData(); // clear the cache CacheControl::resetBlogCache($this->_blogInfo->getId()); return true; }
function render() { // load some configuration settings $blogSettings = $this->_blogInfo->getSettings(); $pluginEnabled = $blogSettings->getValue("plugin_moderate_enabled"); // fetch the comments that have not been moderated yet $comments = new UnmoderatedComments(); $unmoderatedComments = $comments->getUnmoderatedComments($this->_blogInfo->getId()); // create a view and export the settings to the template $this->setValue("pluginEnabled", $pluginEnabled); $this->setValue("comments", $unmoderatedComments); if (!$pluginEnabled) { $locale = $this->_blogInfo->getLocale(); $text = $locale->tr("error_moderate_not_enabled"); $this->setErrorMessage($text); } parent::render(); }