- Avoid using field course_sections.sequence for retrieving the modules list, use functionality from
get_fast_modinfo() instead;
- In the following functions/methods mark arguments $mod, $modnames, $modnamesused and $sections as
not used because they can be taken any time from get_fast_modinfo():
- function print_section()
- protected function format_section_renderer_base::section_summary()
- private function format_section_renderer_base::section_activity_summary
- public function format_section_renderer_base::print_single_section_page
- public function format_section_renderer_base::print_multiple_section_page
- added function get_module_types_names() returning the list of localised strings used for module names;
- added function cm_info::get_used_module_names();
- added magic properties cm_info:: and cm_info:: returning human readable module name;
- replaced usage of function get_all_mods() with get_fast_modinfo() and get_module_types_names();
- function print_section_add_menus() may now retrieve the modules names list itself;
- deprecated function get_all_mods()
Function add_mod_to_section() has very confusing arguments when object looks like record from
table course_modules but field ->section refers to relative section number (course_sections.section).
In table course_modules the field section refers to course_sections.id.
Also add_mod_to_section() does not update table course_modules and does not call rebuild_course_cache()
which developer can forget to do afterwards.
- Added function course_add_cm_to_section()
- In the core code add_mod_to_section() is replaced with course_add_cm_to_section()
- Function add_mod_to_section() is deprecated
This reverts commit 954c272e548c0578fde9d1bc0979ac46b72bc3b9.
With MDL-35714, each test gets gc_collect_cycles() called, so
no need to call it "manually".
- added class format_base as the base for all course formats
- added class format_site for the pseudo-format 'site' used for displaying activities on the front page
- added class format_legacy that overrides format_base functions with calling old-style 'callback_xxx' functions
- replaced all usage of 'callback_xxx' functions with format_base methods
- made arguments of get_section_name(), get_course_url() more flexible
- deprecated function get_generic_section_name(), it's contents is moved to format_base
- global_navigation::format_display_course_content() is removed, plugins can supress the sections navigations using extend_course_navigation()
This commit coverts everything in the codebase to use the new
users_order_by_sql function when sorting lists of users. More details in
the bug.
Note that this does not change places where users are displayed in a
sortable table, and the sort order comes from the table.
Use YUI event delegation to handle events in course section "toolboxes" (visibility and highlight toggles) rather than attaching event handlers to each individual button we care about. Also remove the (now unused) replace_button() function.
Use YUI event delegation to handle events in course resource "toolboxes" (sets of editing icons) rather than attaching event handlers to each individual button we care about. Don't waste time setting the CSS cursor to what it already is, use .all() rather than replace_button() if we just need the node.
Section toolboxes could probably also be done this way to some extent, but the payoff may not be worth the effort - they're so minimal that they don't tend to cause issues.
Use YUI's DragDrop delegates for course dragdrop, rather than initialising a Drag object for each individual section and each individual activity/resource. Also, clone a single drag handle for activities/resources, rather than repeatedly creating a whole new one with the same parameters for each activity/resource.