MDL-37009 function print_course_search() is moved to deprecatedlib.php

This commit is contained in:
Marina Glancy 2013-03-06 16:54:41 +11:00
parent f4b571ab2b
commit a8d683ca8e
2 changed files with 25 additions and 12 deletions

View File

@ -1767,18 +1767,6 @@ function print_my_moodle() {
}
}
function print_course_search($value="", $return=false, $format="plain") {
global $PAGE;
debugging('Function print_course_search() is deprecated, please use course renderer', DEBUG_DEVELOPER);
$renderer = $PAGE->get_renderer('core', 'course');
if ($return) {
return $renderer->course_search_form($value, $format);
} else {
echo $renderer->course_search_form($value, $format);
}
}
function print_remote_course($course, $width="100%") {
global $CFG, $USER;

View File

@ -3922,3 +3922,28 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
$rs->close();
return $categories;
}
/**
* Displays a course search form
*
* This function is deprecated, please use course renderer:
* $renderer = $PAGE->get_renderer('core', 'course');
* echo $renderer->course_search_form($value, $format);
*
* @deprecated since 2.5
*
* @param string $value default value to populate the search field
* @param bool $return if true returns the value, if false - outputs
* @param string $format display format - 'plain' (default), 'short' or 'navbar'
* @return null|string
*/
function print_course_search($value="", $return=false, $format="plain") {
global $PAGE;
debugging('Function print_course_search() is deprecated, please use course renderer', DEBUG_DEVELOPER);
$renderer = $PAGE->get_renderer('core', 'course');
if ($return) {
return $renderer->course_search_form($value, $format);
} else {
echo $renderer->course_search_form($value, $format);
}
}