Skip to content

Commit

Permalink
Purge the caches and lock protection - #114.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Nov 13, 2021
1 parent 3313245 commit e515cfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lang/en/format_topcoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

// Coursesetting - Show addtional data for modules.
$string['enableadditionalmoddata'] = 'Enable additional information';
$string['enableadditionalmoddatadesc'] = 'This is a \'Site level\' switch to turn the activity information on or off. It needs to be \'on\' for the related settings that operate at a course level to take effect. As this functionality can be computationally expensive, then it is strongly suggested that you undertake full testing before using on a production system.';
$string['enableadditionalmoddatadesc'] = 'This is a \'Site level\' switch to turn the activity information on or off. It needs to be \'on\' for the related settings that operate at a course level to take effect. As this functionality can be computationally expensive, then it is strongly suggested that you undertake full testing before using on a production system. Note: Purges the cache caches when changed.';

$string['showadditionalmoddata'] = 'Show additional information for: {$a} in the course';
$string['showadditionalmoddata_help'] = 'Allow all users to see the activity deadline and users with grading permission to see the number of submissions on the course page for activities.';
Expand All @@ -130,7 +130,7 @@
$string['resetallactivitymeta_help'] = 'Resets all the additional module information to follow the site default value.';

$string['courseadditionalmoddatamaxstudents'] = 'Set the maximum number of students on a course that \'Show additional information\' will apply to';
$string['courseadditionalmoddatamaxstudentsdesc'] = 'Additional information can take time to calculate, especially on large courses, so here you can set the maximum number of students that a couse can have for the functionality to show on that course. Above that value, the \'Additional information\' will NOT be calculated or show regardless of the course settings! A value of \'0\' means \'unlimited\'.';
$string['courseadditionalmoddatamaxstudentsdesc'] = 'Additional information can take time to calculate, especially on large courses, so here you can set the maximum number of students that a couse can have for the functionality to show on that course. Above that value, the \'Additional information\' will NOT be calculated or show regardless of the course settings! A value of \'0\' means \'unlimited\'. Note: Purges the cache caches when changed.';

$string['courseadditionalmoddatastudentsinfo'] = 'Additional information status:';
$string['courseadditionalmoddatastudentsinfounlimited'] = 'Additional information will show for the enabled activities for {$a} students.';
Expand Down
8 changes: 6 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,17 @@
1 => new lang_string('no'),
2 => new lang_string('yes')
);
$settings->add(new admin_setting_configselect($name, $title, $description, $default, $choices));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('cache_helper::purge_all');
$settings->add($setting);

$name = 'format_topcoll/courseadditionalmoddatamaxstudents';
$title = get_string('courseadditionalmoddatamaxstudents', 'format_topcoll');
$description = get_string('courseadditionalmoddatamaxstudentsdesc', 'format_topcoll');
$default = 0;
$settings->add(new admin_setting_configtext($name, $title, $description, $default, PARAM_INT));
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_INT);
$setting->set_updatedcallback('cache_helper::purge_all');
$settings->add($setting);

$name = 'format_topcoll/defaultshowadditionalmoddata';
$title = get_string('defaultshowadditionalmoddata', 'format_topcoll');
Expand Down

0 comments on commit e515cfb

Please sign in to comment.