mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Make pluginname readable on Manage Authentication page #89

Closed geoffreyvanwyk closed 5 years ago

geoffreyvanwyk commented 6 years ago

This commit adds the public $authtype attribute to the authplugin<name> class which is used to obtain the plugin name on the "Manage Authentication" page. Otherwise, only [[pluginname]] is shown in the "Name" column of the plugins table.

mudrd8mz commented 6 years ago

Thanks Geoffrey for sharing this fix! Just wondering. Would it be cleaner and more consistent to explicitly set the value in the constructor (like all existing authentication plugins do)? The class property is already declared in the base class and it feels a bit counter-intuitive to re-declare and re-initialize it in the subclass this way.

mudrd8mz commented 6 years ago

We could have a default constructor like this in the auth.mustache file:

    /**
     * Constructor.
     */
    public function __construct() {

        $this->authtype = '{{ component_name }}';
        $this->config = get_config('{{ component }}');
    }
geoffreyvanwyk commented 6 years ago

@mudrd8mz, I will update the pull request.

mudrd8mz commented 5 years ago

Thanks, merged.