custompix)) { $pixpath = "$CFG->wwwroot/pix"; } else { $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix"; } $displaylist = array(); $parentlist = array(); 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'", "", ""); print_heading("$strsearchresults"); $lastcategory = -1; if ($courses = get_courses_search($search, "category ASC, sortorder DESC", $page*$perpage, $perpage)) { foreach ($courses as $course) { if ($course->category != $lastcategory) { $lastcategory = $course->category; echo "

"; echo "category\">"; echo $displaylist[$course->category]; echo "

"; } $course->fullname = highlight("$search", $course->fullname); $course->summary = highlight("$search", $course->summary); print_course($course); print_spacer(5,5); } if (count($courses) == $perpage) { $options = array(); $options["search"] = $search; $options["page"] = $page+1; $options["perpage"] = $perpage; echo "
"; echo "
"; print_single_button("search.php", $options, get_string("findmorecourses")); echo "
"; } else { print_heading(get_string("nomorecourses", "", $search)); } } else { print_heading(get_string("nocoursesfound", "", $search)); } echo "

"; print_course_search($search); print_footer(); ?>