base = $base; $this->admin = $base->admin; $this->referer = $this->admin->get_referer(); if ( '' != wp_get_original_referer() ) { $this->referer = wp_get_original_referer(); } $this->referer = remove_query_arg( array('approved', 'unapproved', 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $this->referer ); global $action; wp_reset_vars(array('action')); if ( 'cdc' == $action ) { $action = 'delete'; } elseif ( 'mac' == $action ) { $action = 'approve'; } if ( isset( $_GET['dt'] ) ) { if ( 'spam' == $_GET['dt'] ) { $action = 'spam'; } elseif ( 'trash' == $_GET['dt'] ) { $action = 'trash'; } } switch($action) { case 'spam': case 'approve': case 'delete': case 'trash': $this->confirm($action); break; case 'editcomment': $this->edit_form(); break; case 'deletecomment': case 'trashcomment': case 'untrashcomment': case 'spamcomment': case 'unspamcomment': $this->delete_comment($action); exit(); case 'approvecomment': case 'unapprovecomment': $this->approve_comment($action); exit(); case 'editedcomment': $this->edited_comment(); exit(); default: break; } } // ================================================== private function edit_form() { global $user_ID, $title; $comment = intval($_GET['c']); if (! $comment = get_comment($comment)) { $this->base->ks_die(__('Oops, no comment with this ID.')); } if (! current_user_can('edit_post', $comment->comment_post_ID)) { $this->base->ks_die(__('You are not allowed to edit comments on this post.')); } $comment = get_comment_to_edit($comment); $title = sprintf(__('Editing Comment # %s'), $comment->comment_ID); include dirname(__FILE__) . '/admin-header.php'; $submitbutton_text = __('Edit Comment'); $form_action = 'editedcomment'; $form_extra = ''; ?>
base->ks_die(__('Oops, no comment with this ID.') . sprintf(' ' . __('Go back') . '', 'edit-comments.php' ), '', false); } if (! current_user_can('edit_post', $comment->comment_post_ID)) { $this->base->ks_die('delete' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.')); } include dirname(__FILE__) . '/admin-header.php'; switch ($action) { case 'spam': $message = __('You are about to mark the following comment as spam:'); break; case 'trash': $message = __('You are about to move the following comment to the Trash:', 'ktai_style'); break; case 'delete': $message = __('You are about to delete the following comment:'); break; default: $message = __('You are about to approve the following comment:'); break; } echo '' . $message . '
' . __('Are you sure you want to do this?') . '