Moodle Plugins directory: Admin Settings Config | Moodle.org
Admin Settings Config
Local plugins ::: local_adminsettingsconfig
Maintained by
Mark Sharp
This is local plugin that adds a new JSON setting type for your plugins.
Latest release:
8 sites
1 fans
Current versions available: 1
This is local plugin that adds a new setting type for your plugins. Currently, this plugin just adds a JSON setting type. The plugin ensures that the text inserted into the textarea is valid JSON, and throws an error if it isn't.
Useful links
Contributors
Mark Sharp (Lead maintainer)
Please login to view contributors details and/or to contact them
I have a bit of a code snippet on the github page: https://github.com/sharpchi/moodle-adminsettingsconfig
Basically, when you're creating settings for your plugin, you have various types of settings: text, textarea, select, multiselect, htmleditor, colourpicker etc. The benefits of using some of the more specialised settings type is that they validate the input, so the colourpicker will check that whatever is input is a valid colour code.
My plugin is really somewhere where we can add settings types that are not in core. At the moment it just has JSON, which extends the textarea, but crucially validates the input as valid JSON format. If others have a setting type they'd like to add to this plugin, I'm happy to receive pull requests.
The implementation for plugin developers is to make this plugin a dependency for their plugin, then use the config settings that are defined. See the example on github.
Hope that helps.