0; $i--) { chdir(".."); } include($context_file_name); chdir($current_directory); } function truncate_path($the_path, $root_path) { return ereg_replace("^" . $root_path, "", $the_path); } function path_to_URL($the_path, $root_path, $root_url) { return $root_url . truncate_path($the_path, $root_path); } /* html_linked_text($the_text, $the_link) creates HTML linking */ /* $the_text to the URL $the_link in the obvious way with */ /* ... . If $the_link is empty, there is no anchor markup. */ function html_linked_text($the_text, $the_link) { if ($the_link == "") { return $the_text; } else { return "" . $the_text . ""; } } function html_bgcolor_body($color) { return ""; } $GLOBALS["OD_BG_COLOR"] = "#FFFFFF"; $GLOBALS["BG_COLOR"] = $GLOBALS["OD_BG_COLOR"]; /* course_root_url is a stub for a future function to lookup courses */ /* in a table. */ function course_root_url($dept, $course_number, $quarter, $year, $section) { list($yno) = sscanf($year, "%d"); if ($yno <= 2001) { return "http://www.classes.cs.uchicago.edu/classes/archive/" . $year . "/" . $quarter . "/" . "CS" . $course_number . "/"; } else { return "http://www.classes.cs.uchicago.edu/classes/archive/" . $year . "/" . $quarter . "/" . $course_number . "-" . $section . "/"; } } function course_item($course_name, $dept, $course_number, $quarter, $year, $section) { return $course_name . " (" . html_linked_text($dept . " " . $course_number, course_root_url($dept, $course_number, $quarter, $year, $section)) . "). " . ucfirst($quarter) . " " . $year; } function course_item_short($course_name, $dept, $course_number, $quarter, $year, $section) { return html_linked_text($dept . " " . $course_number, course_root_url($dept, $course_number, $quarter, $year, $section)); } ?>