-
Improvement
-
Resolution: Won't Do
-
Major
-
None
-
2.9
-
MOODLE_29_STABLE
There are cases where some settings do not make sense when another setting is disabled - e.g. forum has rss settings which do not make sense when rss is disabled.
At the moment a pattern used is:
if ($CFG->enablerss) {
|
$ADMIN->add(...);
|
}
|
The problem with this approach is that the settings inside the if then are not defined at all in the tree and using a setting added this way can cause notices if not using empty()/isset() to check for its value.
Note that we have a way to avoid admin_settingpage() to be displayed (but still defined in the tree) and it would be useful to have more abstractions like that - for example, a setting section.