Custom context levels

Custom context levels

by Petr Skoda -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers

Good day,

it's been a while since I contributed to Moodle. I am back to Moodle coding and I have a few questions for you developers:

  1. Is anybody using $CFG->custom_context_classes setting to inject custom context levels?
  2. Did you ever want to have a custom context level in your Moodle plugin?

I am asking because of a proposed patch in MDL-74936 which refactors all context classes to namespaces and adds support for new plugin context levels. I also created MDL-74937 which demonstrates how it could be used to add new Cohort context level.

I'd be nice to hear your opinions, ideas or potential use cases.

Ciao,
Petr

Average of ratings: -
In reply to Petr Skoda

Re: Custom context levels

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Petr,

welcome back smile.
I would love that. This would solve a lot of workarounds I use to not modify the core.

Best regards
Andreas

In reply to Petr Skoda

Re: Custom context levels

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Absolutely! I know of several plugins that use custom contexts, including the metadata one I maintain, which creates contexts for groups and cohorts.
Having a maintained way to do this would be far preferable. Thanks.