public function action_insert_ng_comment() { $item_id = $_POST['comment_id']; if ($item_id != NULL || $item_id != '') { $comment = $_POST['ng_comment' . $item_id]; $item_type = ORM::factory('itemtype')->where('name', '=', 'caption')->find(); $user = Auth::instance()->get_user(); Helper_NGComment::insert_comment($user->id, $item_id, $item_type->id, $comment); } else { Message::set(Message::ERROR, 'NG Comment was not added.'); } Request::instance()->redirect('admin/btcomments'); }