Skip to content

Commit

Permalink
Bugfix: String in language pack didn't work for Moodle installed in s…
Browse files Browse the repository at this point in the history
…ubdirectories
  • Loading branch information
abias committed Jun 16, 2017
1 parent 2f6f177 commit c7ed85c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2017-05-19 - Bugfix: String in language pack didn't work for Moodle installed in subdirectories - Credits to David Mudrák
* 2017-05-29 - Add Travis CI support

### v3.2-r2
Expand Down
2 changes: 1 addition & 1 deletion lang/en/local_session_keepalive.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$string['setting_keepaliveend_desc'] = 'With these two settings, you can control the daytime (relating to server time) when session keepalive should be active. If you set both settings to 0:00, session keepalive will be active during the whole day which is also the default. However, if you are sure that you will only want session keepalive during a defined time slot, you can limit session keepalive to this time slot to save the load on the server side during the rest of the day.';
$string['setting_keepaliveinterval'] = 'Keepalive interval';
$string['setting_keepaliveinterval_desc'] = 'With this setting, you can set the interval (in minutes) in which the users\' browsers will check for unsent user input and keep the session alive if needed. Even if this request is very lightweight on the server side, you shouldn\'t set the interval shorter as necessary because unnecessary short intervals, together with a large amount of concurrent active users, might generate perceivable additional load on your server. For normal Moodle setups, the default setting should be fine.<br>
The interval is best set to half of the session timeout configured in the <a href="/admin/settings.php?section=sessionhandling">session handling configuration page</a> (currently set to {$a} minutes). Example: If the session timeout is set to 120 minutes, set the keepalive time to 60 minutes. The users\' browsers will then perform the first keepalive request 60 minutes after the page load which is still plenty of time before the session normally expires.';
The interval is best set to half of the session timeout configured on the {$a->page} configuration page (currently set to {$a->minutes} minutes). Example: If the session timeout is set to 120 minutes, set the keepalive time to 60 minutes. The users\' browsers will then perform the first keepalive request 60 minutes after the page load which is still plenty of time before the session normally expires.';
$string['setting_keepalivestart'] = 'Keepalive start time';
$string['setting_keepaliveweekdays'] = 'Keepalive weekdays';
$string['setting_keepaliveweekdays_desc'] = 'With this setting, you can control the weekdays when session keepalive should be active. By default, all weekdays are enabled. However, if you are sure that you will never need session keepalive on weekends or certain working days, you can disable these weekdays to save the load on the server side on these days.';
8 changes: 7 additions & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@

// Create keepalive interval control widget.
$choices = array(10 => 10, 30 => 30, 60 => 60, 90 => 90, 120 => 120, 180 => 180, 240 => 240, 300 => 300);
$sessionhandlingurl = new \moodle_url('/admin/settings.php', array('section' => 'sessionhandling'));
$link = \html_writer::link($sessionhandlingurl, get_string('sessionhandling', 'core_admin'));
$sessiontimeoutmin = ($CFG->sessiontimeout / 60);
$page->add(new admin_setting_configselect('local_session_keepalive/keepaliveinterval',
get_string('setting_keepaliveinterval', 'local_session_keepalive', null, true),
get_string('setting_keepaliveinterval_desc', 'local_session_keepalive', ($CFG->sessiontimeout / 60), true),
get_string('setting_keepaliveinterval_desc',
'local_session_keepalive',
array('minutes' => $sessiontimeoutmin, 'page' => $link),
true),
60,
$choices));
unset($choices);
Expand Down

0 comments on commit c7ed85c

Please sign in to comment.