moodle/course/index.php

60 lines
1.6 KiB
PHP
Raw Normal View History

2001-11-22 06:23:56 +00:00
<?PHP // $Id$
// 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, "");
$strcourses = get_string("courses");
2002-09-09 12:37:34 +00:00
$strcategories = get_string("categories");
$strmycourses = get_string("mycourses");
$strfulllistofcourses = get_string("fulllistofcourses");
if (!$categories = get_categories()) {
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";
} else {
$navigation = $strcourses;
}
2002-09-09 12:37:34 +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\">";
} else {
echo "<TABLE WIDTH=80% ALIGN=CENTER><TR><TD VALIGN=top>";
$category="all";
2002-09-09 12:37:34 +00:00
unset($title);
}
if ($category) {
2002-09-09 12:37:34 +00:00
if (isset($title)) {
print_heading_block($title);
}
2002-09-09 12:37:34 +00:00
echo "<BR>";
print_all_courses($category);
}
2002-06-10 11:16:07 +00:00
echo "</TD></TR></TABLE>";
2001-11-22 06:23:56 +00:00
print_footer();
?>