dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
This reverts commit 6601690202764d786a5ee4b7bbd9afb5b91dd0ec.
This commit was adding the 'returnurl' param unnecessarily to the
course links in the navigation block, causing a lot of long URLs
to be created.
This patch improves usability of enrolment page in case of course is not
enrollable. 'Continue' button now returns student to referring page instead of
main moodle page (as it used to be). To make this improvement, passing correct
returnurl parameter to enrol/index.php page was implemented for links that may
be accessible for not-enrolled students.
This adds a category expanded which:
* fetches child content in a category tree if it has not already been loaded;
* toggles relevant classes on the category node to show and hide child content; and
* applies appropriate animations to improve user experience.