PATH:
home
/
letacommog
/
letaweb
/
admin
/
api
/
blog
<?php class CommentManager extends BaseManager { protected $temp_id; public function actiongetNewsData() { $id = $_POST['id']; $comment = BNews_Comments::model()->findByPk((int) $id); if(isset($comment)) { if(isset($comment->news)) { $this->ajaxSuccess($comment->news->attributes); return true; } } $this->ajaxError(1); } public function actiondeleteItems() { $ids = $_POST['ids']; $criteria = new CDbCriteria(); $criteria->addInCondition('id', $ids); BNews_Comments::model()->deleteAll($criteria); $this->ajaxSuccess(1); } public function actionsaveForm() { $form = new NewsCommentForm('update'); if (isset($_POST['NewsCommentForm'])) { $form->attributes = $_POST['NewsCommentForm']; if (($model = $form->save()) === false) { $errors = $form->getErrors(); $this->ajaxError($errors); return; } else { $this->ajaxSuccess(1); return; } } $this->ajaxError(1); } public function saveForm() { $comment = BNews_Comments::model()->findByPk((int) $id); $id = $_POST['id']; $comment = BNews_Comments::model()->findByPk((int) $id); if ($comment->user_id == 0) { $name = $_POST['name']; $url = $_POST['url']; $email = $_POST['email']; $comment->name = $name; $comment->email = $email; $comment->url = $url; } $content = $_POST['content']; $approved = $_POST['approved']; $is_spam = $_POST['is_spam']; $comment->content = $content; if (!$approved && $comment->approved) { $comment->date_approved = ''; } if ($approved && !$comment->approved) { $comment->date_approved = date('Y-m-d H:i:s'); } $comment->approved = $approved; $comment->is_spam = $is_spam; $comment->save(); $this->ajaxSuccess(1); } }
[+]
..
[+]
post
[-] PostManager.php
[edit]
[-] CommentManager.php
[edit]