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

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 2.9
    • None
    • Administration
    • 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

              Unassigned Unassigned
              poltawski Dan Poltawski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: