$searchterm) { if (strlen($searchterm) < 2) { unset($searchterms[$key]); } } $search = trim(implode(" ", $searchterms)); } $site = get_site(); if ($CFG->forcelogin) { require_login(); } $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_simple_box_start("center"); echo "
"; echo "
"; print_course_search("", false, "plain"); echo "

"; print_string("searchhelp"); echo "

"; echo "
"; print_simple_box_end(); print_footer(); exit; } $searchform = print_course_search($search, true, "navbar"); print_header("$site->fullname : $strsearchresults", $site->fullname, "$strcourses -> $strsearch -> '$search'", "", "", "", $searchform); $lastcategory = -1; if ($courses = get_courses_search($searchterms, "fullname ASC", $page*$perpage, $perpage, $totalcount)) { print_heading("$strsearchresults: $totalcount"); print_paging_bar($totalcount, $page, $perpage, "search.php?search=$search&perpage=$perpage&"); foreach ($courses as $course) { $course->fullname = highlight("$search", $course->fullname); $course->summary = highlight("$search", $course->summary); $course->summary .= "

"; $course->summary .= "$strcategory: category\">"; $course->summary .= $displaylist[$course->category]; $course->summary .= "

"; print_course($course); print_spacer(5,5); } print_paging_bar($totalcount, $page, $perpage, "search.php?search=$search&perpage=$perpage&"); } else { print_heading(get_string("nocoursesfound", "", $search)); } echo "

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