load(); if ($course && $course->getType() == 'course' && $course->canEdit()) { if (!$user_id) { $Dippler->add_system_message(_("No all parameters provided."), 'error'); forward($course->getSettingsURL('facilitators')); } if ($course->isFacilitator($user_id)) { $Dippler->add_system_message(_("Already a facilitator."), 'error'); forward($course->getSettingsURL('facilitators')); } $facilitator = new Facilitator(); $facilitator->course = $course_id; $facilitator->status = 5; $facilitator->user_id = $user_id; $added = $facilitator->add(); if ($added) { $Dippler->add_system_message(_("Facilitator added.")); } else { $Dippler->add_system_message(_("Facilitator could not be added."), "error"); } forward($course->getSettingsURL('facilitators')); } forward(); ?>