Best practice forum (Archived)

Topic and Activity - restrict access based on language

 
? ?
Topic and Activity - restrict access based on language
di ? ? - Monday, 18 November 2013, 08:54
 

Within the restrict access area of course topics and activities, access to the topic or activity can be restricted based upon user profile field. I think most user profile fields are available, however the language (lang) field is not available. I think this would be a great enhancement to the access restrictions, to be able to restrict access based upon the users' language setting in the user profile field (defaulting to system default language). This would enhance our ability to localize a course to a user, to only display the content that is applicable to the users' language. After our initial analysis, it would seem that this would be a fairly "easy" enhancement, and also one that makes a lot of sense.

I would appreciate any feedback from the Totara subscriber community and Totara devs on this. Based upon feedback we'll either make a formal enhancement request to TotaraLMS or possibly develope this and offer it back for consideration to core.

See screenshot following for the current user fields available in topic/activity access restrictions:

? ?
Re: Topic and Activity - restrict access based on language
di ? ? - Monday, 18 November 2013, 14:47
 

We have added the language field option to the list of options.
There are 2 lines of code in 2 files that need to be added.

1) /lib/conditionlib.php on line 641: 'lang' => get_user_field_name('lang'),
2) /lib/moodlelib.php on line 3730: case 'language' : return get_string('lang');

Can someone advice on how to proceed adding that enhancement to future Totara releases?

Simon Coggins
Re: Topic and Activity - restrict access based on language
di Simon Coggins - Monday, 18 November 2013, 16:20
Gruppo Totara

Hi Plamen,

Since this is part of Moodle, the best approach would be to create an improvement ticket in the Moodle tracker and submit your patch:

http://tracker.moodle.org/

You'd just need to give a short description of the issue then submit a link to a repository containing the change.

Once it is merged into Moodle we could backport it into the current version of Totara.

Simon

 

? ?
Re: Topic and Activity - restrict access based on language
di ? ? - Monday, 2 December 2013, 13:38
 

FYI: Moodle tracker issue here - https://tracker.moodle.org/browse/MDL-42991