Пример #1
0
$toolNameList = claro_get_tool_name_list();
// Get tool id where new events have been recorded since last login
if (claro_is_user_authenticated()) {
    $date = $claro_notifier->get_notification_date(claro_get_current_user_id());
    $modified_tools = $claro_notifier->get_notified_tools(claro_get_current_course_id(), $date, claro_get_current_user_id());
} else {
    $modified_tools = array();
}
/**
 * TOOL LIST
 */
$is_allowedToEdit = claro_is_allowed_to_edit();
// Fetch the portlets
$portletiterator = new CourseHomePagePortletIterator(ClaroCourse::getIdFromCode($cidReq));
// Fetch the session courses (if any)
if (ClaroCourse::isSourceCourse($thisCourse->id)) {
    $sessionCourses = $thisCourse->getSessionCourses();
} else {
    $sessionCourses = array();
}
// Notices for course managers
if (claro_is_allowed_to_edit()) {
    if ($thisCourse->status == 'pending') {
        $dialogBox->warning(get_lang('This course is deactivated: you can reactive it from your course list'));
    } elseif ($thisCourse->status == 'date') {
        if (!empty($thisCourse->publicationDate) && $thisCourse->publicationDate > claro_mktime()) {
            $dialogBox->warning(get_lang('This course will be enabled on the %date', array('%date' => claro_date('d/m/Y', $thisCourse->publicationDate))));
        }
        if (!empty($thisCourse->expirationDate) && $thisCourse->expirationDate > claro_mktime()) {
            $dialogBox->warning(get_lang('This course will be disable on the %date', array('%date' => claro_date('d/m/Y', $thisCourse->expirationDate))));
        }
Пример #2
0
}
if ('clist' != $cfrom) {
    $addToURL .= '&offsetC=' . $offsetC;
}
$dialogBox = new DialogBox();
// Parse command
if (!empty($courseCode)) {
    $courseToDelete = new ClaroCourse();
    $courseToDelete->load($courseCode);
} else {
    $courseToDelete = null;
}
if ('exDelete' == $cmd) {
    if (!is_null($courseToDelete)) {
        // Cannot delete a course if it has session courses
        if (!ClaroCourse::isSourceCourse($courseId)) {
            $do = 'delete';
        } else {
            $dialogBox->error(get_lang('This course has session courses.  You have to delete them before.'));
        }
    } else {
        switch (claro_failure::get_last_failure()) {
            case 'course_not_found':
                $dialogBox->error(get_lang('Course not found'));
                break;
            default:
                $dialogBox->error(get_lang('Course not found'));
        }
    }
} elseif ('rqDelete' == $cmd) {
    if (!is_null($courseToDelete)) {