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