Previously, the resource toolbox initialiser was using JS to find the show/hide icon, then find its section ancestor, then check if the section was hidden - only to pointlessly set pointer:auto if it was. That didn't meet the aim stated in the comments ("Disable" show/hide icons (change cursor to not look clickable) if section is hidden), but this patch meets that goal with a single CSS rule.
- Course format may define additional fields (format options) to store for course and each section
- Edit course form allows to edit format-specific options and refreshes their list on format change
- Course format may provide it's own form for editing a section
- Default form for editing section allows to edit all format-specific fields
- Class section_info refactored, it defines magic methods such as __get() to access basic section
information and format-specific options (retrieved only on the first request)
- format_base::update_course_format_options() allows to watch pre-update state of the course,
format_legacy automatically copies the options with the same names between formats
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.
Rather than calculate the sectionid for the activity chooser on page load,
we do so when opening the chooser. This resolves issues where sections have
been moved without swapping all of the section IDs around.
Initially, the default section title was swapped within the course format
javascript functions. Though some section titles may be custom and does not
require swapping, in addition they may have links to single section view. This
introduces some callback functions for define what needs to be done in
sections libs and js files.
These changes fix several points and suggested changes:
* increase the size of the help popup to 800x600
* fix issues with centering of the dialogue
* swap next/cancel buttons
* convert next button to use string for 'Add'
* convert add text to 'Add an activity or resource'
* Change markup way from 'activity module style' to its own markup
* Remove 'a new' from the 'add an activity' string
* Remove the 'personalisation' from the nohelp lang string