Exemplo n.º 1
0
 $form->addElement('text', 'duration', _AVAILABLEFOR, 'style = "width:50px;"');
 $form->addRule('duration', _THEFIELD . ' "' . _AVAILABLEFOR . '" ' . _MUSTBENUMERIC, 'numeric', null, 'client');
 if (isset($_GET['edit_course'])) {
     $editCourse = new EfrontCourse($_GET['edit_course']);
     $smarty->assign('T_EDIT_COURSE', $editCourse);
     $editCourse->course['price'] = number_format($editCourse->course['price'], 2, '.', '');
     $form->setDefaults($editCourse->options);
     $form->setDefaults($editCourse->course);
     $form->setDefaults(array($editCourse->options['recurring'] . '_duration' => $editCourse->options['recurring_duration']));
     if (G_VERSIONTYPE != 'community') {
         #cpp#ifndef COMMUNITY
         if (G_VERSIONTYPE != 'standard') {
             #cpp#ifndef STANDARD
             if ($editCourse->course['instance_source']) {
                 $instanceSource = new EfrontCourse($editCourse->course['instance_source']);
                 $courseInstances = $instanceSource->getInstances();
                 //Instances inherit course code and direction from their source
                 $form->setDefaults(array("directions_ID" => $instanceSource->course['directions_ID']));
                 $form->freeze(array('directions_ID'));
                 $smarty->assign("T_INSTANCE_SOURCE", $editCourse->course['instance_source']);
             } else {
                 $courseInstances = $editCourse->getInstances();
                 $smarty->assign("T_INSTANCE_SOURCE", $editCourse->course['id']);
             }
             $smarty->assign("T_COURSE_INSTANCES", $courseInstances);
         }
         #cpp#endif
     }
     #cpp#endif
 } else {
     $form->setDefaults(array('active' => 1, 'show_catalog' => 1, 'price' => 0, 'languages_NAME' => $GLOBALS['configuration']['default_language']));
Exemplo n.º 2
0
                 $content = new EfrontContentTree($lesson);
                 if (sizeof($content->tree) > 0) {
                     $contentTree[$key] = $content->toHTML(false, 'dhtml_content_tree_' . $lesson->lesson['id'], array('noclick' => 1));
                 }
                 $lessonInfo[$key] = new LearningObjectInformation(unserialize($lesson->lesson['info']));
                 $additionalInfo[$key] = $lesson->getInformation();
             }
             $smarty->assign("T_ADDITIONAL_LESSON_INFO", $additionalInfo);
             $smarty->assign("T_COURSE_LESSON_INFO", $lessonInfo);
             $smarty->assign("T_CONTENT_TREE", $contentTree);
             $smarty->assign("T_LANGUAGES", EfrontSystem::getLanguages(true));
             $smarty->assign("T_COURSE_LESSONS", $lessons);
             $constraints = array('archive' => false, 'active' => true, 'sort' => 'name', 'condition' => 'show_catalog=1');
             if ($course->course['instance_source']) {
                 $parentCourse = new EfrontCourse($course->course['instance_source']);
                 $instances = $parentCourse->getInstances($constraints);
                 $instances[$parentCourse->course['id']] = $parentCourse;
             } else {
                 $instances = $course->getInstances($constraints);
                 $instances[$course->course['id']] = $course;
             }
             $smarty->assign("T_COURSE_INSTANCES", $instances);
             $courseInfo = new LearningObjectInformation(unserialize($course->course['info']));
             $smarty->assign("T_COURSE_INFO", $courseInfo);
             $additionalInfo = $course->getInformation();
             $smarty->assign("T_ADDITIONAL_COURSE_INFO", $additionalInfo);
         }
     }
 } catch (Exception $e) {
     $smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
     $message = $e->getMessage() . ' &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
Exemplo n.º 3
0
     if (sizeof($content->tree) > 0) {
         $contentTree[$key] = $content->toHTML(false, 'dhtml_content_tree_' . $lesson->lesson['id'], array('noclick' => 1));
     }
     $lessonInfo[$key] = new LearningObjectInformation(unserialize($lesson->lesson['info']));
     $additionalInfo[$key] = $lesson->getInformation();
     $additionalInfo[$key]['start_date'] = $lesson->lesson['start_date'];
     $additionalInfo[$key]['end_date'] = $lesson->lesson['end_date'];
 }
 $smarty->assign("T_ADDITIONAL_LESSON_INFO", $additionalInfo);
 $smarty->assign("T_COURSE_LESSON_INFO", $lessonInfo);
 $smarty->assign("T_CONTENT_TREE", $contentTree);
 $smarty->assign("T_LANGUAGES", EfrontSystem::getLanguages(true));
 $smarty->assign("T_COURSE_LESSONS", $lessons);
 if ($course->course['instance_source']) {
     $parentCourse = new EfrontCourse($course->course['instance_source']);
     $instances = $parentCourse->getInstances();
     $instances[$parentCourse->course['id']] = $parentCourse;
 } else {
     $instances = $course->getInstances();
     $instances[$course->course['id']] = $course;
 }
 foreach ($instances as $key => $instance) {
     if (!$instance->course['show_catalog']) {
         unset($instances[$key]);
     }
 }
 $smarty->assign("T_COURSE_INSTANCES", $instances);
 $courseInfo = new LearningObjectInformation(unserialize($course->course['info']));
 $smarty->assign("T_COURSE_INFO", $courseInfo);
 $additionalInfo = $course->getInformation();
 $smarty->assign("T_ADDITIONAL_COURSE_INFO", $additionalInfo);