Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49363

Admin setting abstraction to allow setting to be hidden/disabled when dependent on other settings

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: