pawanwiziq / moodlenew-mod_wiziq

moodle latest
0 stars 0 forks source link

please use config_plugins table instead of polluting global $CFG #6

Open danmarsden opened 6 years ago

danmarsden commented 6 years ago

plugins are supposed to put their settings into the config_plugins table instead of using the global $CFG - your settings in this file: https://github.com/pawanwiziq/moodlenew-mod_wiziq/blob/master/settings.php#L26

should really be prefixed with "wiziq" which would move them to the config plugins table and you would then use get_config() style functions to retrieve the settings.

eg: the setting "wiziq_content_webservice" would be defined as:

or changed to a shorter version like: admin_setting_configtext('wiziq\content_webservice',

quite often in my plugins I'll do something like: $cfg = get_config('pluginname') and then reuse lowercase $cfg for the plugin - otherwise you can get individual settings like get_config('pluginname', 'setting')

FYI - This may not be a blocker for re-approval in the plugins db, but is something that you should do at some point.