add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/announcements/{$course}/post/{$post}"); } else if (empty($course)) { $Dippler->add_system_message(_("Course not found"), 'error'); forward('courses/my'); } else if (empty($post)) { $Dippler->add_system_message(_("Post not found"), 'error'); forward("course/announcements/{$course}"); } else { $comment = new CourseBlogComment(); $comment->title = $title; $comment->body = $body; $comment->courseblog_post = $post; $comment_id = $comment->create(); if (!$comment_id) { $Dippler->add_system_message(_("Comment could not be created."), 'error'); forward("course/announcements/{$course}/post/{$post}"); } $Dippler->add_system_message(_("Comment added.")); // Clear cache $Dippler->clearSessionInputValues(); forward($comment->getURL()); } forward('courses/my'); ?>