Exemplo n.º 1
0
 protected function build_course_list()
 {
     // Go through all the parameters and grab all the courses that match what's being requested.
     // We'll sort through them and throw out any that don't apply at the run stage -- it's
     // more efficient that way.
     if ($this->params['get_site_courses']) {
         $this->courses = $this->courses + get_site_courses($this->site_id);
     }
     if ($this->params['get_page_courses']) {
         $this->courses = $this->courses + get_page_courses($this->get_source_page_id());
     }
     foreach ($this->params['get_courses_by_tags'] as $tag) {
         $this->courses = $this->courses + get_courses_by_category($tag);
     }
     if ($this->params['get_courses_by_page_categories']) {
         $this->courses = $this->courses + $this->get_page_category_courses();
     }
     if ($this->params['get_courses_by_subjects']) {
         $this->courses = $this->courses + get_courses_by_subjects($this->params['get_courses_by_subjects'], 'academic_catalog_2014_site');
     }
     if ($this->params['get_courses_by_site_subjects']) {
         $this->courses = $this->courses + $this->get_courses_by_site_subjects();
     }
     if ($this->params['randomize']) {
         shuffle($this->courses);
     } else {
         uasort($this->courses, 'sort_courses_by_name');
     }
 }
Exemplo n.º 2
0
 function get_course_list($subject)
 {
     $subject_courses = get_courses_by_subjects(array($subject));
     $site_courses = get_site_courses($this->site_id);
     $html = '<h3>Active Courses</h3>';
     $html .= '<ul class="courseListActive">';
     foreach ($subject_courses as $id => $course) {
         if (isset($site_courses[$id])) {
             $html .= $this->get_course_list_row($course);
             unset($subject_courses[$id]);
         }
     }
     $html .= '</ul>';
     $html .= '<h3>Inactive Courses</h3>';
     $html .= '<ul class="courseListInactive">';
     foreach ($subject_courses as $id => $course) {
         $html .= $this->get_course_list_row($course);
     }
     $html .= '</ul>';
     return $html;
 }