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

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

            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.