Little fixes for the course_sideblock

This commit is contained in:
moodler 2003-08-11 11:51:08 +00:00
parent 85c06eab07
commit c571f3fc8a
2 changed files with 12 additions and 2 deletions

View File

@ -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[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">$category->name</a>";
$modicon[]=$icon;
}
$fulllist = "<p><a href=\"$CFG->wwwroot/course/search.php\">".get_string("searchcourses")."</a>...";
} else { // Just print course names of single category
$category = array_shift($categories);
$courses = get_courses($category->id);

View File

@ -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,
"<a href=\"index.php\">$strcourses</a> -> $strsearch", "", "");
print_course_search();
print_footer();
exit;
}
print_header("$site->fullname : $strsearchresults", $site->fullname,
"<a href=\"index.php\">$strcourses</a> -> $strsearchresults -> '$search'", "", "");