} $b = new Bug((int) $bugID); $data['newComment'] = $b->addComment($commentText); $b->notify('comment'); $data['error'] = "OK"; $data['message'] = $LANG['New_comment_OK']; } if ($action === 'modComm') { if (!isset($bugID)) { throw new Exception("modComm: bug's ID is missing!"); } if (!is_array($comment)) { throw new Exception("modComm: 'comment' is not an array!"); } $b = new Bug((int) $bugID); $b->updateComment((int) $comment['id'], $comment['message']); $data['error'] = "OK"; $data['message'] = $LANG['Update_comment_OK']; } if ($action === 'delComm') { if (!isset($bugID)) { throw new Exception("delComm: bug's ID is missing!"); } if (!isset($commID)) { throw new Exception("delComm: Comment ID is missing!"); } $b = new Bug((int) $bugID); $b->deleteComment((int) $commID); $data['error'] = "OK"; $data['message'] = $LANG['Delete_comment_OK']; }