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.
When a checkbox is not checked, it does not submit in the form, therefore
this must be an !empty() test instead of an (int) casting.
This issue is a part of the MDL-47194 Task.
This issue is a part of the MDL-39707 Epic.