f9903ed0 |
1 | <?PHP // $Id$ |
97c270e9 |
2 | // Display list of all courses |
f9903ed0 |
3 | |
b0e3a925 |
4 | require_once("../config.php"); |
5 | require_once("lib.php"); |
f9903ed0 |
6 | |
c2cb4545 |
7 | optional_variable($category, "0"); |
ba2e5d73 |
8 | |
9 | $strcourses = get_string("courses"); |
0a263205 |
10 | $strcategories = get_string("categories"); |
11 | $strmycourses = get_string("mycourses"); |
12 | $strfulllistofcourses = get_string("fulllistofcourses"); |
ba2e5d73 |
13 | |
c2cb4545 |
14 | if ($category = get_record("course_categories", "id", $category)) { |
15 | print_header($strcourses, $strcourses, "<a href=\"index.php\">$strcourses</a> -> $category->name", |
16 | "", "", true, update_category_button($category->id)); |
ba2e5d73 |
17 | |
ba2e5d73 |
18 | } else { |
c2cb4545 |
19 | print_header($strcourses, $strcourses, $strcourses); |
20 | $category->id = 0; |
ba2e5d73 |
21 | } |
0a263205 |
22 | |
ba2e5d73 |
23 | |
c2cb4545 |
24 | /// Print the category selector |
ba2e5d73 |
25 | |
c2cb4545 |
26 | $categories = get_categories(); |
27 | $multicategories = count($categories) > 1; |
28 | |
29 | if (count($categories) > 1) { |
30 | $parentlist = array(); |
31 | $displaylist = array(); |
32 | $displaylist["0"] = $strfulllistofcourses; |
33 | make_categories_list($displaylist, $parentlist, ""); |
34 | |
35 | echo "<table align=center><tr><td>"; |
36 | popup_form("index.php?category=", $displaylist, "switchcategory", "$category->id", "", "", "", false); |
37 | echo "</td></tr></table><br />"; |
ba2e5d73 |
38 | } |
d887b5a7 |
39 | |
c2cb4545 |
40 | if (empty($category->id)) { |
41 | print_courses(0, "80%"); |
42 | } else { |
43 | print_courses($category, "80%"); |
44 | } |
f9903ed0 |
45 | |
46 | print_footer(); |
47 | |
48 | ?> |
49 | |
50 | |