diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -100,12 +100,13 @@ class Schedule return $this->scheduleName; } - //-------------------------------------------------- - // Adds a new class to the schedule. - //-------------------------------------------------- - function addCourse($n) + /** + * \brief + * Adds a new class to the schedule. + */ + function addCourse($course_id, $title) { - $this->courses[] = new Course($n); + $this->courses[] = new Course($course_id, $title); } /** @@ -413,6 +414,7 @@ class Schedule '

+ @@ -486,9 +488,9 @@ class Schedule { for($j = 0; $j < count($this->courses); $j++) { - $class = $this->courses[$j]; + $course = $this->courses[$j]; $section_index = $this->storage[$i][$j]; - $section = $class->getSection($section_index); + $section = $course->getSection($section_index); /* iterate through all of a class's meeting times */ $meetings = $section->getMeetings(); @@ -517,12 +519,19 @@ class Schedule if ($rowspan[$dayLoop] > 1) $single_multi = 'multi'; + $title = $course->title_get(); + if (empty($title)) + $title = ''; + else + $title .= ' '; echo ' ' - . htmlentities($class->getName(), ENT_QUOTES) . '-' + . '' . htmlentities($title) . '' . PHP_EOL + . htmlentities($course->getName(), ENT_QUOTES) . '-' . htmlentities($section->getLetter(), ENT_QUOTES) . "\n" . '' . htmlentities($section->getProf(), ENT_QUOTES) . "\n" . '' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "\n" @@ -532,7 +541,7 @@ class Schedule /* for the ``Registration Codes'' dialogue: */ if (empty($permutations_courses[$j])) { - $singleton_course = new Course($course->getName()); + $singleton_course = new Course($course->getName(), $course->title_get()); $singleton_course->section_add($section); $permutation_courses[$j] = $singleton_course->to_json_array(); } @@ -560,8 +569,6 @@ class Schedule echo " \n"; } - /* presort */ - ksort($permutation_courses); // End of table echo " \n" . ' '. htmlentities(json_encode($permutation_courses)) . "\n"