Ejemplo n.º 1
0
    $question_lesson = eF_getTableData("questions", "lessons_ID", "id = " . $_GET['edit_question']);
    if (!empty($question_lesson) && $question_lesson[0]['lessons_ID'] != 0) {
        $lesson = new EfrontLesson($question_lesson[0]['lessons_ID']);
        $skills_to_propose = array();
        // If the lesson belongs only to courses, get all skills of its courses
        if ($lesson->lesson['course_only']) {
            $lesson_belonging_courses = $lesson->getCourses(true);
            foreach ($lesson_belonging_courses as $course) {
                $course_skills = $course->getSkills(true);
                foreach ($course_skills as $skillID => $skill) {
                    $skills_to_propose[] = $skillID;
                }
            }
        } else {
            // Else get only its own skills
            $lesson_skills = $lesson->getSkills(true);
            foreach ($lesson_skills as $skillID => $skill) {
                $skills_to_propose[] = $skillID;
            }
        }
        if (!empty($skills_to_propose)) {
            echo implode(" ", $skills_to_propose);
        } else {
            header("HTTP/1.0 500 ");
        }
        exit;
    } else {
        header("HTTP/1.0 500 ");
        exit;
    }
}
Ejemplo n.º 2
0
             if ($lesson['languages_NAME'] != $editedUser->user['languages_NAME']) {
                 unset($lessons[$key]);
             }
         }
     }
     if ($lesson['course_only']) {
         unset($lessons[$key]);
     }
 }
 foreach ($lessons as $key => $lesson) {
     if (!$lesson['partof']) {
         unset($lessons[$key]);
     } else {
         $obj = new EfrontLesson($lesson['id']);
         $lessons[$key]['link'] = $obj->toHTMLTooltipLink(basename($_SERVER['PHP_SELF']) . '?ctg=lessons&edit_lesson=' . $lesson['id']);
         $lessons[$key]['skills_offered'] = sizeof($obj->getSkills(true));
     }
 }
 $roles = EfrontLessonUser::getLessonsRoles(true);
 $smarty->assign("T_ROLES_ARRAY", $roles);
 isset($_GET['limit']) ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
 if (isset($_GET['sort'])) {
     isset($_GET['order']) ? $order = $_GET['order'] : ($order = 'asc');
     $lessons = eF_multiSort($lessons, $_GET['sort'], $order);
 }
 if (isset($_GET['filter'])) {
     $lessons = eF_filterData($lessons, $_GET['filter']);
 }
 $smarty->assign("T_ASSIGNED_LESSONS_SIZE", sizeof($lessons));
 if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
     isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);