$editArea = 'Category'; $areaId = 'category'; $model = new ae_CategoryModel(); $model->load($_GET['category']); } else { if (isset($_GET['cofilter']) && ae_Validate::id($_GET['cofilter'])) { $editArea = 'Comment filter'; $areaId = 'cofilter'; $model = new ae_CommentfilterModel(); $model->load($_GET['cofilter']); } else { if (isset($_GET['comment']) && ae_Validate::id($_GET['comment'])) { $editArea = 'Comment'; $areaId = 'comment'; $model = new ae_CommentModel(); $model->load($_GET['comment']); } else { if (isset($_GET['media']) && ae_Validate::id($_GET['media'])) { $editArea = 'Media'; $areaId = 'media'; $model = new ae_MediaModel(); $model->load($_GET['media']); } else { if (isset($_GET['page']) && ae_Validate::id($_GET['page'])) { $editArea = 'Page'; $areaId = 'page'; $model = new ae_PageModel(); $model->load($_GET['page']); } else { if (isset($_GET['post']) && ae_Validate::id($_GET['post'])) { $editArea = 'Post';
/** * Update the comment. * @return {int} ID of the comment. */ function updateComment() { if (!isset($_POST['edit-id'], $_POST['comment-author-name'], $_POST['comment-author-email'], $_POST['comment-author-url'], $_POST['comment-content'], $_POST['comment-user']) || $_POST['comment-content'] === '') { header('Location: ../admin.php?error=missing_data_for_comment'); exit; } $content = nl2br($_POST['comment-content']); $comment = new ae_CommentModel(); $comment->load($_POST['edit-id']); $comment->setAuthorName($_POST['comment-author-name']); $comment->setAuthorEmail($_POST['comment-author-email']); $comment->setAuthorUrl($_POST['comment-author-url']); $comment->setContent($content); $comment->setUserId($_POST['comment-user']); if (!$comment->save()) { return FALSE; } return $comment->getId(); }