private function _checkModerateComment() { $action = Tools::getValue('action'); if (Tools::isSubmit('submitModerate')) { $moderate = Tools::getValue('moderate'); if (intval($moderate) != 0) { $moderate = 1; } Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', intval($moderate)); $this->_html .= '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="' . $this->l('Confirmation') . '" />' . $this->l('Settings updated') . '</div>'; } else { if (empty($action) === false && intval(Configuration::get('PRODUCT_COMMENTS_MODERATE'))) { $id_product_comment = Tools::getValue('id_product_comment'); require_once dirname(__FILE__) . '/ProductComment.php'; switch ($action) { case 'accept': $comment = new ProductComment($id_product_comment); $comment->validate(); break; case 'delete': $comment = new ProductComment($id_product_comment); $comment->delete(); ProductComment::deleteGrades($id_product_comment); break; default: } } } }
private function _checkDeleteComment() { $action = Tools::getValue('delete_action'); if (empty($action) === false) { $product_comments = Tools::getValue('delete_id_product_comment'); if (count($product_comments)) { require_once dirname(__FILE__) . '/ProductComment.php'; if ($action == 'delete') { foreach ($product_comments as $id_product_comment) { if (!$id_product_comment) { continue; } $comment = new ProductComment((int) $id_product_comment); $comment->delete(); ProductComment::deleteGrades((int) $id_product_comment); } } } } }
/** * Delete a comment, grade and report data * * @return boolean succeed */ public function delete() { parent::delete(); ProductComment::deleteGrades($this->id); ProductComment::deleteReports($this->id); ProductComment::deleteUsefulness($this->id); }
private function _checkModerateComment() { $action = Tools::getValue('action'); if (empty($action) === false && (int) Configuration::get('PRODUCT_COMMENTS_MODERATE')) { $product_comments = Tools::getValue('id_product_comment'); if (sizeof($product_comments)) { require_once dirname(__FILE__) . '/ProductComment.php'; switch ($action) { case 'accept': foreach ($product_comments as $id_product_comment) { if (!$id_product_comment) { continue; } $comment = new ProductComment((int) $id_product_comment); $comment->validate(); } break; case 'delete': foreach ($product_comments as $id_product_comment) { if (!$id_product_comment) { continue; } $comment = new ProductComment((int) $id_product_comment); $comment->delete(); ProductComment::deleteGrades((int) $id_product_comment); } break; default: } } } }