function prereqs_get_prereq_string_for_course
Search API
7.x prereqs.module | prereqs_get_prereq_string_for_course($course_id) |
6.x prereqs.module | prereqs_get_prereq_string_for_course($course_id) |
Just gets whatever is in the database for this course.
3 calls to prereqs_get_prereq_string_for_course()
- prereqs_content_alter in modules/
prereqs/ prereqs.module - Implememnt hook_content_alter
- prereqs_get_prereq_array_for_course in modules/
prereqs/ prereqs.module - Return back a friendly array of prereq courses that are required for THIS course_id.
- prereqs_get_prereq_warnings_for_course in modules/
prereqs/ prereqs.module - This is meant to be a general function to find all relavent prereq warnings for the supplied course.
File
- modules/
prereqs/ prereqs.module, line 350 - This is the module file for the prereqs module.
Code
function prereqs_get_prereq_string_for_course($course_id) {
$prereq_data = db_result(db_query("SELECT prereq_data from prereqs_prereqs WHERE course_id = ?", $course_id));
$prereq_data = @(String) trim($prereq_data);
// Get rid of windows trouble characters.
$prereq_data = str_replace("\r", "", $prereq_data);
// Make sure "or's" are lowercase.
$prereq_data = str_replace(" OR ", " or ", $prereq_data);
$prereq_data = str_replace(" oR ", " or ", $prereq_data);
$prereq_data = str_replace(" Or ", " or ", $prereq_data);
$prereq_data = str_replace(" 0R ", " or ", $prereq_data); // zero-r (to catch typos)
$prereq_data = str_replace(" 0r ", " or ", $prereq_data); // zero-R
return $prereq_data;
}