2001-11-22 06:23:56 +00:00
|
|
|
<?PHP // $Id$
|
2002-08-11 15:41:54 +00:00
|
|
|
// Display list of all courses
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
require("../config.php");
|
|
|
|
require("lib.php");
|
|
|
|
|
2002-09-09 12:37:34 +00:00
|
|
|
optional_variable($category, "");
|
2002-09-09 11:48:11 +00:00
|
|
|
|
|
|
|
$strcourses = get_string("courses");
|
2002-09-09 12:37:34 +00:00
|
|
|
$strcategories = get_string("categories");
|
|
|
|
$strmycourses = get_string("mycourses");
|
|
|
|
$strfulllistofcourses = get_string("fulllistofcourses");
|
2002-09-09 11:48:11 +00:00
|
|
|
|
2002-12-20 14:44:14 +00:00
|
|
|
if (!$categories = get_categories()) {
|
2002-09-09 11:48:11 +00:00
|
|
|
error("Could not find any course categories!");
|
|
|
|
}
|
|
|
|
|
2002-09-09 12:37:34 +00:00
|
|
|
if ($category == "all") {
|
|
|
|
$title = $strfulllistofcourses;
|
|
|
|
$navigation = "<A HREF=\"index.php\">$strcourses</A> -> $title";
|
|
|
|
} else if ($category == "my") {
|
|
|
|
$title = $strmycourses;
|
|
|
|
$navigation = "<A HREF=\"index.php\">$strcourses</A> -> $title";
|
|
|
|
} else if (isset($categories[$category])) {
|
|
|
|
$title = $categories[$category]->name;
|
|
|
|
$navigation = "<A HREF=\"index.php\">$strcourses</A> -> $title";
|
2002-09-09 11:48:11 +00:00
|
|
|
} else {
|
|
|
|
$navigation = $strcourses;
|
|
|
|
}
|
2002-09-09 12:37:34 +00:00
|
|
|
|
2002-09-09 11:48:11 +00:00
|
|
|
print_header($strcourses, $strcourses, $navigation);
|
|
|
|
|
|
|
|
$showcategories = (count($categories) > 1);
|
|
|
|
if ($showcategories) {
|
2002-12-12 02:58:05 +00:00
|
|
|
echo "<TABLE WIDTH=\"100%\" CELLPADDING=\"8\" BORDER=\"0\">";
|
|
|
|
echo "<TR><TD WIDTH=\"200\" VALIGN=\"TOP\">";
|
|
|
|
print_course_categories($categories, $category, 200);
|
|
|
|
echo "</TD><TD WIDTH=\"*\" VALIGN=\"TOP\">";
|
2002-09-09 11:48:11 +00:00
|
|
|
} else {
|
|
|
|
echo "<TABLE WIDTH=80% ALIGN=CENTER><TR><TD VALIGN=top>";
|
|
|
|
$category="all";
|
2002-09-09 12:37:34 +00:00
|
|
|
unset($title);
|
2002-09-09 11:48:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($category) {
|
2002-09-09 12:37:34 +00:00
|
|
|
if (isset($title)) {
|
2002-12-09 07:35:40 +00:00
|
|
|
print_heading_block($title);
|
2002-09-09 11:48:11 +00:00
|
|
|
}
|
2002-09-09 12:37:34 +00:00
|
|
|
echo "<BR>";
|
2002-09-09 11:48:11 +00:00
|
|
|
print_all_courses($category);
|
|
|
|
}
|
2002-06-10 05:19:03 +00:00
|
|
|
|
2002-06-10 11:16:07 +00:00
|
|
|
echo "</TD></TR></TABLE>";
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
print_footer();
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|