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:
190 sites
133 downloads
24 fans
Current versions available: 5

This block is allows a site administrator to display links to users based on specific user profile fields

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Stephen Bourget (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Stephen Bourget
    Fri, 24 June 2016, 4:14 AM
    I've added some documentation which should explain that, but if you have data in the user profile fields then you can restrict the link so it will only be displayed to users who have the matching information in their user profile (We use the block here where we have multiple schools sharing the same Moodle install and we want to display different resources to different users based on where they are located) It works well if you have your user information sync from an external system like LDAP and lock the profile fields that you are storing the user specific information. (In our case it we use institution)
  • David Mudrák
    Fri, 12 Aug 2016, 5:04 PM

    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.

  • Andreas Panagiotopoulos
    Tue, 23 Aug 2016, 2:58 PM
    Thank you for this useful plugin! But how can we add more profile fields to be selected instead from these 4 (institution, department etc)? Which files can i edit?

    Moreover, can we add custom profile fields?

    Thank you!
  • Stephen Bourget
    Tue, 23 Aug 2016, 10:10 PM
    To add new fields, you will need to do the following:

    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.
  • Andreas Panagiotopoulos
    Wed, 24 Aug 2016, 3:02 PM
    Thank you Stephen for your reply and your help!

    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
  • Gary Lynch
    Sat, 19 Aug 2017, 7:10 PM
    Is there a way to get this plugin to work with version 3.1.3+?
    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
  • Stephen Bourget
    Sun, 20 Aug 2017, 6:22 AM
    Yes, just use the version (M2.9 (2016062302)) It works with Moodle 2.9 - 3.2.
  • Gary Lynch
    Mon, 21 Aug 2017, 6:37 PM
    Excellent Thank you smile
    Just one other thing. is it easy to add Description profile field to the dropdown list of field?
  • Stephen Bourget
    Sat, 26 Aug 2017, 5:44 AM
    It's possible to add it, but you would need to modify the code for the plugin. The areas you would need to modify are listed in the comment above from August 23 & 24 2016.
  • Troy May
    Tue, 12 Sept 2017, 1:17 AM
    How difficult would it be to make links appears as single buttons instead of text links? That might be way better in terms of graphical appearance. Thoughts?
  • Stephen Bourget
    Tue, 12 Sept 2017, 1:23 AM
    It's possible. You would need to modify the code for the plugin. You need to modify the add_link() function (https://github.com/sbourget/moodle-block_links/blob/master/block_links.php#L109) which is used to create the HTML for each link.
  • Gary Lynch
    Wed, 27 Sept 2017, 11:10 PM
    Hi Stephen.. Is it possible to allow this block to be displayed on the front page or a page resource rather than just a course? My rational for this is to enable custom external report links available to certain groups based on a specific institution
  • Stephen Bourget
    Thu, 28 Sept 2017, 12:24 AM
    There is no restriction on where you can add this block. So it should be possible to add it onto the front page or on a report page as long as your theme supports adding other blocks in that location.
  • Gary Lynch
    Thu, 28 Sept 2017, 4:55 PM
    Hi Stephen Thank you for the rapid reply just for information using Adaptable theme it does not provide the option in 'block' to add it on frontpage so do i need to contact theme developer?
  • Gary Lynch
    Fri, 27 Oct 2017, 6:28 PM
    HI Stephen
    Thank you for an excellent plugin that has saved myself alot of work smile
    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?
1 2
Please login to post comments