MDL-57678 core_course: Deprecate make_categories_options()

Padding nested course categories by space to make them render in a tree
structure does not really make a lot of sense as they are already being
rendered as full paths. It's simpler to show them without the
indentation.
Given this, there's not much point keeping make_categories_options().
So it's better to deprecate this function and call
core_course_category::make_categories_list() directly instead.
This commit is contained in:
Jun Pataleta
2020-07-15 18:25:57 +08:00
parent ee23a8cf25
commit 2c45ad6f18
4 changed files with 20 additions and 19 deletions
+16
View File
@@ -3351,3 +3351,19 @@ function user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $
return $DB->get_recordset_sql("$select $from $where $sort", $params, $limitfrom, $limitnum);
}
/**
* Returns the list of full course categories to be used in html_writer::select()
*
* Calls {@see core_course_category::make_categories_list()} to build the list.
*
* @deprecated since Moodle 4.0
* @todo This will be finally removed for Moodle 4.4 as part of MDL-69124.
* @return array array mapping course category id to the display name
*/
function make_categories_options() {
$deprecatedtext = __FUNCTION__ . '() is deprecated. Please use \core_course_category::make_categories_list() instead.';
debugging($deprecatedtext, DEBUG_DEVELOPER);
return core_course_category::make_categories_list('', 0, ' / ');
}