From: moodler Date: Mon, 11 Aug 2003 11:51:08 +0000 (+0000) Subject: Little fixes for the course_sideblock X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c571f3fc8a2a14620e1dc2fd1f12fd69c9588cf1;p=moodle.git Little fixes for the course_sideblock --- diff --git a/course/lib.php b/course/lib.php index 1ab87c7348..d0c9d3eee6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -953,13 +953,14 @@ function print_courses_sideblock($category=0, $width="100%") { } } - $categories = get_categories(0); // Parent = 0 ie top-level categories only + $categories = get_categories("0"); // Parent = 0 ie top-level categories only if (count($categories) > 1) { // Just print top level category links foreach ($categories as $category) { $linkcss = $category->visible ? "" : " class=\"dimmed\" "; $moddata[]="wwwroot/course/category.php?id=$category->id\">$category->name"; $modicon[]=$icon; } + $fulllist = "

wwwroot/course/search.php\">".get_string("searchcourses")."..."; } else { // Just print course names of single category $category = array_shift($categories); $courses = get_courses($category->id); diff --git a/course/search.php b/course/search.php index dfa3678f2a..9db8ae1fe2 100644 --- a/course/search.php +++ b/course/search.php @@ -5,7 +5,7 @@ require_once("../config.php"); require_once("lib.php"); - require_variable($search); // search words + optional_variable($search, ""); // search words optional_variable($page, "0"); // which page to show optional_variable($perpage, "10"); // which page to show @@ -24,9 +24,18 @@ make_categories_list($displaylist, $parentlist, ""); $strcourses = get_string("courses"); + $strsearch = get_string("search"); $strsearchresults = get_string("searchresults"); $strcategory = get_string("category"); + if (!$search) { + print_header("$site->fullname : $strsearch", $site->fullname, + "$strcourses -> $strsearch", "", ""); + print_course_search(); + print_footer(); + exit; + } + print_header("$site->fullname : $strsearchresults", $site->fullname, "$strcourses -> $strsearchresults -> '$search'", "", "");