sharpchi / moodle-atto_templates4u

Templates button for Moodle's atto text editor
1 stars 7 forks source link

Add function to enable button if user has capability #6

Closed adpe closed 4 years ago

adpe commented 4 years ago

New request origin from https://github.com/sharpchi/moodle-atto_templates/pull/4

sharpchi commented 4 years ago

Hi @adpe I had some difficulty getting your code to work. I think it was around using user as an archetype. I also changed to contextlevel to course (I've checked and this works for profile contexts, block contexts etc), and I reorganised the ternary operator on the enable button, to make it clearer to read. Would appreciate if you could check the updates work for you.

You might need to uninstall and reinstall the plugin for the user permissions to change. The changes are on the permissions branch.

adpe commented 4 years ago

HI @sharpchi

Please check my new changes and would be great have this integrated into master, Adrian

Edit

Please update the version and release it like you want (I don't edited the file because of that).

adpe commented 4 years ago

Kind of merged in https://github.com/sharpchi/moodle-atto_templates4u/commit/a81a3213f5ace82044bf55a282d509a49213b85c. So I will close this one.

Thanks @sharpchi, Adrian