function course_search_menu_handle_replacement_pattern
Search API
7.x course_search.module | course_search_menu_handle_replacement_pattern($str) |
6.x course_search.module | course_search_menu_handle_replacement_pattern($str) |
Implements hook
File
- modules/
course_search/ course_search.module, line 120 - This module allows users to search for courses, descriptions, and, if supported, rotation schedules and sample syllabi.
Code
function course_search_menu_handle_replacement_pattern($str) {
if (strpos($str, "%SCHOOL_ID%") !== 0) {
if (!isset($_SESSION ['last_saved_school_id'])) {
$_SESSION ['last_saved_school_id'] = 0;
}
// It contains this replacement pattern!
$str = str_replace("%SCHOOL_ID%", intval($_SESSION ['last_saved_school_id']), $str);
unset($_SESSION ['last_saved_school_id']);
}
if (strpos($str, "%SEV_FILTER%") !== 0) {
// It contains this replacement pattern!
$str = str_replace("%SEV_FILTER%", (@$_GET ["sev_filter"] OR ""), $str);
}
if (strpos($str, "%TYPE_FILTER%") !== 0) {
// It contains this replacement pattern!
$str = str_replace("%TYPE_FILTER%", (@$_GET ["type_filter"] OR ""), $str);
}
if (strpos($str, "%PAGE%") !== 0) {
// It contains this replacement pattern!
$str = str_replace("%PAGE%", (@$_GET ["page"] OR ""), $str);
}
return $str;
}