public function indexAction() { $commentModel = new Admin_Model_Comment(); $this->view->comments = $commentModel->fetchAll(K_Db_Select::create()->where(array('comment_status' => 'опубликован'))->order('comment_date DESC')); $capchaText = K_Secur::genCapchaText(); $this->view->capacha64 = K_Secur::genCapcha($capchaText); K_Auth::setUserKey('capchaText', $capchaText); K_Auth::setUserKey('capchaTime', time()); }
public function changestatusAction() { $commentModel = new Admin_Model_Comment(); $commentId = intval($this->getParam('id')); if (in_array($_POST['param'], array('опубликован', 'ожидает публикации'))) { $status = $_POST['param']; } if ($status && $commentId) { $commentModel->update(array('comment_status' => $status), array('comment_id' => $commentId)); $this->putAjax("OK"); } else { $this->putAjax("ERROR"); } }
public static function onDelete($data) { $commentModel = new Admin_Model_Comment(); $commentModel->remove(K_Db_Select::create()->where(array('comment_new' => $data['tree_id']))); }