} /* -------------------------------------------------------End of Contact part--------------------------------------------------------- */ /* -------------------------------------------------------Lesson information part--------------------------------------------------------- */ if (isset($_GET['ctg']) && $_GET['ctg'] == 'lesson_info') { //The user asked to display information on a lesson //session_start(); //Isn't needed here if the head session_start() is in place if (!$smarty->is_cached('index.tpl', $cacheId) || !$GLOBALS['configuration']['smarty_caching']) { include "directions_tree.php"; try { if (isset($_GET['lessons_ID'])) { if (isset($lessons[$_GET['lessons_ID']]) && $lessons[$_GET['lessons_ID']] instanceof EfrontLesson) { $smarty->assign("T_HAS_LESSON", $lessons[$_GET['lessons_ID']]->lesson['has_lesson']); } $lesson = new EfrontLesson($_GET['lessons_ID']); $lesson->lesson['price_string'] = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true); $lesson->lesson['num_students'] = sizeof($lesson->getStudentUsers()); $lesson->lesson['seats_remaining'] = $lesson->lesson['max_users'] - $lesson->lesson['num_students']; $lesson->lesson['seats_remaining'] >= 0 or $lesson->lesson['seats_remaining'] = 0; $smarty->assign("T_LESSON", $lesson); $lessonInformation = $lesson->getInformation(); $content = new EfrontContentTree($lesson); if (sizeof($content->tree) > 0) { $smarty->assign("T_CONTENT_TREE", $content->toHTML(false, 'dhtml_content_tree', array('noclick' => 1))); } $lessonInfo = new LearningObjectInformation(unserialize($lesson->lesson['info'])); $smarty->assign("T_LESSON_INFO", $lessonInfo); $additionalInfo = $lesson->getInformation(); $smarty->assign("T_ADDITIONAL_LESSON_INFO", $additionalInfo); if ($lesson->lesson['course_only']) { $smarty->assign("T_LESSON_COURSES", $lesson->getCourses()); if (isset($_GET['from_course']) && $_GET['from_course']) {
$languages = EfrontSystem::getLanguages(true); if (isset($_GET['lessons_ID']) && eF_checkParameter($_GET['lessons_ID'], 'id')) { $lesson = new EfrontLesson($_GET['lessons_ID']); $lessonInformation = $lesson->getInformation(); //$lessonInformation['language'] = $languages[$lesson -> lesson['languages_NAME']]; if ($lessonInformation['professors']) { foreach ($lessonInformation['professors'] as $value) { $professorsString[] = formatLogin($value['login']); } $lessonInformation['professors'] = implode(", ", $professorsString); } $lesson->lesson['price'] ? $priceString = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true) : ($priceString = false); $lessonInformation['price_string'] = $priceString; if ($lesson->lesson['max_users']) { $lessonInformation['max_users'] = $lesson->lesson['max_users']; $lessonInformation['seats_remaining'] = $lesson->lesson['max_users'] - sizeof($lesson->getStudentUsers()); $lessonInformation['seats_remaining'] >= 0 or $lessonInformation['seats_remaining'] = 0; } // if (!$lessonInformation['price']) { // unset($lessonInformation['price_string']); // } try { if ($_GET['from_course'] && eF_checkParameter($_GET['from_course'], 'id')) { $course = new EfrontCourse($_GET['from_course']); $schedule = $course->getLessonScheduleInCourse($lesson); if ($schedule['start_date'] || $schedule['end_date']) { $lessonInformation['from_timestamp'] = $schedule['start_date']; $lessonInformation['to_timestamp'] = $schedule['end_date']; } else { $lessonInformation['from_timestamp'] = $schedule['active_in_lesson'] + 24 * 60 * 60 * $schedule['start_period']; $lessonInformation['to_timestamp'] = $lessonInformation['from_timestamp'] + 24 * 60 * 60 * $schedule['end_period'];