Restriction by language icon

Restriction by language

Maintained by Renaat Debleu
Restrict module and section access based on user language.
Price option: Free

Supports Moodle 2.7-5.2 See all versions
Latest release: 2 months ago
Installations: 2560
Downloads (last 90 days): 1866

Frankenstyle name: availability_language

Comments

Product ratings and reviews are coming to Moodle Marketplace. Until then, existing comments remain available to read, but new posts have been disabled.

The availability language restriction limits access to modules and/or sections. You cannot restrict courses - user filters - enrolment methods with an availability restriction. Read the documentation of access restrictions (https://docs.moodle.org/404/en/Restrict_access_settings) and readme of this plugin (https://github.com/ewallah/moodle-availability_language).
This plugin only pops up when there is more than 1 language installed AND when the language of the course is not forced.
Hi, This plugin is not showing the restriction by language in auto enroll method user filter, also not in any activity access setting, i am using moodle 4.3
Hello Ezzeddin,
What do you exactly mean by making this plugin work at course level? This is a availability restriction plugin, restricting modules only. Check the global documentation about conditional availability settings.
If you want to restrict access to courses based on the language selected, you will need to change your theme.
R.
Hello Renaat,
Would there be a turn-a-round to make this plugin work at course level? If so, would you guide me about?
Thanks,
Hello Joseph,
THX for your feedback.
The plugin is following the same rules as other availability conditions. If you use the group availability and you are not part of the group, you get a sorry message as a student if you are not part of the group. With a language, you get the same behaviour. When I would change this behaviour, all reports and course formats relying on the function get_user_visible() would receive wrong info from the plugin.
So you need a functionality that is not an availability restriction. You can add this enhancement in a course_format or a theme, but not in a availability restriction.
Hi Renaat and thanks for a great plugin, just what I needed...
I have one query, when the "student" switches languages from within one course, I do NOT want this message to be displayed "Sorry, this activity is currently hidden".
Could you make this display an ON/OFF option in a newer version of your plugin? Thanks!
2 possibilities:
- Using negation: Not available unless language equals C
- Using or: Available when language equals A OR language equals B
Have a look at the docs (https://docs.moodle.org/311/en/Using_restrict_access)!
How can I restrict content for two among 3 languages?
Hi Alexander
First, let me state that there is no such thing as hiding a course. If a user gets a link via mail or does a search, he/she will find your course, if he/she can access the course depends on the enrolment settings. The only thing I suggested is that it is possible to hide certain courses in the list of all courses.
So have a look at the theme plugins (https://moodle.org/plugins/?q=type:theme), a lot of them modified the method to show the list of courses/categories to have a more beautiful page. But if you can modify the way they are presented, you can also modify if they are shown or not.
As a non programmer, it will be difficult (you will need to create a child theme and overriding the coursecat_coursebox method), but give it a try. You never know you have hidden talents as a programmer!
Greetings
R
Hi Renaat, Many thanks for the plugin!
I want to do the same as Jean-Baptiste (show/hide courses based on user language), but I'm not a developer. Can you please describe how to do that in more detail? I have 3.1. Thank you so much!
Best regards,
Alexander
Hello Jean-Baptiste,
availability conditions are module level: You can hide or show modules, not courses,
If you want to filter data depending on user language, you could modify your theme renderer:
class theme_????_core_course_renderer extends core_course_renderer {
protected function coursecat_coursebox(coursecat_helper $chelper, $course, $additionalclasses = '') {
switch(current_language()) {
case 'fr':
// Show French courses only
default:
// Show English courses only
...
Greetings,
Hello,
Is there a way to hide a course based on user language ?
I have some courses in english, and the same courses in french (but separate courses). I would like to filter depending on user language.
Best regards
Probably my bad as i was thinking in the Moodle 3 badge for official plugins, but as long as it runs, who really cares about badges? smile
Hi Brandon,
The current version (2014092000) supports Moodle version 2.7, 2.8, 2.9 and 3.0. Personally, I run three Moodle 3.0 sites and one test 3.1 site where the plugin is installed. Some weeks after the release of 3.1 (after some extra testing), this future version will also be supported.
But what do you exactly mean with 'having it certified'?
Hi, I'm currently running a Moodle 2.9.3+ site and planning to update it to Moodle 3 or 3.1 (sometime in the future), and i would love to know if you guys have already tested your plug in a Moodle 3+ environment? When would you have it certified?
Thanks