Moodle Plugins directory: Links | Moodle.org
Links
Blocks ::: block_links
Maintained by
Stephen Bourget
This block is allows a site administrator to display links to users based on specific user profile fields
Latest release:
217 sites
292 downloads
23 fans
Current versions available: 5
This block is allows a site administrator to display links to users based on specific user profile fields
Contributors
Stephen Bourget (Lead maintainer)
Please login to view contributors details and/or to contact them
Hi Stephen. Thanks for clarification and for adding the info. It helped and I was able to test the plugin successfully.
One thing I found not intuitive to me is that I would naturally expect that links are stored per block instance, not globally. I can imagine that in your particular use-case, cross-site management of links is easier though. Still, maybe it is something you should elaborate a bit in the plugin description. Otherwise I found the code readable and following Moodle coding standards. Well done on that.
I am happy to approve this block now. You are cleared to land, welcome to the plugins directory.
Moreover, can we add custom profile fields?
Thank you!
1. Create a constant for the field you want to use.
https://github.com/sbourget/moodle-block_links/blob/master/lib.php#L27
2. To add the field to the drop down list, you need to edit the settings.php file and add the constant to the array
https://github.com/sbourget/moodle-block_links/blob/master/settings.php#L34
3. Then add an additional condition to the select case structure to match the link to the user:
https://github.com/sbourget/moodle-block_links/blob/master/lib.php#L61
It should be possible to a custom field as well.
Should you add other fields, feel free to submit a patch or pull request to github.
There is an extra step as well.
4. Add an additional condition to the select case structure to select the availble values of field when adding a link. This case will be a query to distinct values of the specific field:
https://github.com/sbourget/moodle-block_links/blob/master/edit_form.php#L73
My organisation is not in the position to upgrade yet due to recruitment issues?
This would solve my problem of access to some custom reports i have created in php/sql
Just one other thing. is it easy to add Description profile field to the dropdown list of field?
Thank you for an excellent plugin that has saved myself alot of work
I have followed the posts regarding adding extra field (description) to drop downs but i dont understand what it is i need to do in step 4 of the instructions? I have added the field to settings and lib.php. Would you mind giving me some direction please?