Backup and restore settings needs to be refactored before introducing
subsections. With the current code adding two new hierachy levels
(subsections and activities in subsections) will require many
unnecessary lines of code because most of the structure is hard-coded.
With this patch when backup/restore present the course structure uses a
stack to control how mani divs are opened, instead of relying on adhoc
class attributes per each div.
About the tasks for sections and activities, the class has been
refactored. This way when subsections are introduced it will require
less lines of code and the final patch will be more comprehensible.
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration
It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.
So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.