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