diff --git a/course/lib.php b/course/lib.php index 98703cc2d78..f875317bfeb 100644 --- a/course/lib.php +++ b/course/lib.php @@ -637,20 +637,14 @@ function get_category_or_system_context($categoryid) { } /** - * Returns full course categories trees to be used in html_writer::select() + * Returns the list of full course categories to be used in html_writer::select() * - * Calls {@link core_course_category::make_categories_list()} to build the tree and - * adds whitespace to denote nesting + * Calls {@see core_course_category::make_categories_list()} to build the list. * * @return array array mapping course category id to the display name */ function make_categories_options() { - $cats = core_course_category::make_categories_list('', 0, ' / '); - foreach ($cats as $key => $value) { - // Prefix the value with the number of spaces equal to category depth (number of separators in the value). - $cats[$key] = str_repeat(' ', substr_count($value, ' / ')). $value; - } - return $cats; + return core_course_category::make_categories_list('', 0, ' / '); } /**