Blocks: Links

block_links
Maintained by Picture of Stephen Bourget Stephen Bourget
This block is allows a site administrator to display links to users based on specific user profile fields
318 sites
302 downloads
30 fans
116 sites
57 downloads
14 fans

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

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

Comments RSS

Show comments
  • Picture of Stephen Bourget
    Fri, Jun 24, 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)
  • Picture of David Mudrák
    Fri, Aug 12, 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.

  • Picture of Andreas Panagiotopoulos
    Tue, Aug 23, 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!
  • Picture of Stephen Bourget
    Tue, Aug 23, 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.
  • Picture of Andreas Panagiotopoulos
    Wed, Aug 24, 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
  • Picture of Gary Lynch
    Sat, Aug 19, 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
  • Picture of Stephen Bourget
    Sun, Aug 20, 2017, 6:22 AM
    Yes, just use the version (M2.9 (2016062302)) It works with Moodle 2.9 - 3.2.
  • Picture of Gary Lynch
    Mon, Aug 21, 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?
  • Picture of Stephen Bourget
    Sat, Aug 26, 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.
  • Picture of Troy May
    Tue, Sep 12, 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?
  • Picture of Stephen Bourget
    Tue, Sep 12, 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.
  • Picture of Gary Lynch
    Wed, Sep 27, 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
  • Picture of Stephen Bourget
    Thu, Sep 28, 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.
  • Picture of Gary Lynch
    Thu, Sep 28, 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?
  • Picture of Gary Lynch
    Fri, Oct 27, 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