Skip to content

Commit e515cfb

Browse files
committed
Purge the caches and lock protection - #114.
1 parent 3313245 commit e515cfb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lang/en/format_topcoll.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118

119119
// Coursesetting - Show addtional data for modules.
120120
$string['enableadditionalmoddata'] = 'Enable additional information';
121-
$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.';
121+
$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.';
122122

123123
$string['showadditionalmoddata'] = 'Show additional information for: {$a} in the course';
124124
$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.';
@@ -130,7 +130,7 @@
130130
$string['resetallactivitymeta_help'] = 'Resets all the additional module information to follow the site default value.';
131131

132132
$string['courseadditionalmoddatamaxstudents'] = 'Set the maximum number of students on a course that \'Show additional information\' will apply to';
133-
$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\'.';
133+
$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.';
134134

135135
$string['courseadditionalmoddatastudentsinfo'] = 'Additional information status:';
136136
$string['courseadditionalmoddatastudentsinfounlimited'] = 'Additional information will show for the enabled activities for {$a} students.';

settings.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,17 @@
516516
1 => new lang_string('no'),
517517
2 => new lang_string('yes')
518518
);
519-
$settings->add(new admin_setting_configselect($name, $title, $description, $default, $choices));
519+
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
520+
$setting->set_updatedcallback('cache_helper::purge_all');
521+
$settings->add($setting);
520522

521523
$name = 'format_topcoll/courseadditionalmoddatamaxstudents';
522524
$title = get_string('courseadditionalmoddatamaxstudents', 'format_topcoll');
523525
$description = get_string('courseadditionalmoddatamaxstudentsdesc', 'format_topcoll');
524526
$default = 0;
525-
$settings->add(new admin_setting_configtext($name, $title, $description, $default, PARAM_INT));
527+
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_INT);
528+
$setting->set_updatedcallback('cache_helper::purge_all');
529+
$settings->add($setting);
526530

527531
$name = 'format_topcoll/defaultshowadditionalmoddata';
528532
$title = get_string('defaultshowadditionalmoddata', 'format_topcoll');

0 commit comments

Comments
 (0)