/** * Delete course (statically) * * This function is used to delete an existing course. In order to do * this, it caclulates all the course dependendant elements, deletes them * and finally deletes the course itself. This function is the same as * Efrontcourse :: delete(), except that it is called statically, so it * instatiates first the course objects and then calls delete() on it. * Alternatively, $course may be already a course object. * <br/>Example: * <code> * try { * EfrontCourse :: delete(32); //32 is the course id * } catch (Exception $e) { * echo $e -> getMessage(); * } * </code> * * @param mixed $course The course id or a course object * @return boolean True if everything is ok * @since 3.5.0 * @access public * @static * @todo remove - deprecated */ public static function deleteCourse($course) { if (!$course instanceof EfrontCourse) { $course = new EfrontCourse($course); } return $course->delete(); }
eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure"); } else { if (isset($currentUser->coreAccess['lessons']) && $currentUser->coreAccess['lessons'] != 'change') { $_change_ = false; } else { $_change_ = true; } } $smarty->assign("_change_", $_change_); if (isset($_GET['delete_course']) && eF_checkParameter($_GET['delete_course'], 'id')) { try { if (!$_change_) { throw new Exception(_UNAUTHORIZEDACCESS); } $course = new EfrontCourse($_GET['delete_course']); $course->delete(); } catch (Exception $e) { handleAjaxExceptions($e); } exit; } elseif (isset($_GET['archive_course']) && eF_checkParameter($_GET['archive_course'], 'login')) { //The administrator asked to delete a course try { if (!$_change_) { throw new Exception(_UNAUTHORIZEDACCESS); } $course = new Efrontcourse($_GET['archive_course']); $course->archive(); } catch (Exception $e) { handleAjaxExceptions($e); }