'."\n";
+ $itemcount ++;
+
}
$$rowtotal += $itemcount;
return $datatable;
@@ -3281,7 +3384,13 @@ sub print_usersessions {
if ($position eq 'top') {
if (keys(%serverhomes) > 1) {
my %spareid = ¤t_offloads_to($dom,$settings,\%servers);
- $datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,$rowtotal);
+ my $curroffloadnow;
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{'offloadnow'}) eq 'HASH') {
+ $curroffloadnow = $settings->{'offloadnow'};
+ }
+ }
+ $datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,$curroffloadnow,$rowtotal);
} else {
$datatable .= '
'.
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.');
@@ -3531,7 +3640,7 @@ sub current_offloads_to {
}
sub spares_row {
- my ($dom,$servers,$spareid,$serverhomes,$altids,$rowtotal) = @_;
+ my ($dom,$servers,$spareid,$serverhomes,$altids,$curroffloadnow,$rowtotal) = @_;
my $css_class;
my $numinrow = 4;
my $itemcount = 1;
@@ -3551,12 +3660,21 @@ sub spares_row {
}
}
next unless (ref($spareid->{$server}) eq 'HASH');
+ my $checkednow;
+ if (ref($curroffloadnow) eq 'HASH') {
+ if ($curroffloadnow->{$server}) {
+ $checkednow = ' checked="checked"';
+ }
+ }
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
$datatable .= '
'.
&mt('[_1] when busy, offloads to:'
- ,''.$server.'').
+ ,''.$server.'').' '.
+ ''."\n".
+ ''.
"\n";
my (%current,%canselect);
my @choices =
@@ -4449,7 +4567,8 @@ sub email_as_username {
sub captcha_choice {
my ($context,$settings,$itemcount) = @_;
- my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext);
+ my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext,
+ $vertext,$currver);
my %lt = &captcha_phrases();
$keyentry = 'hidden';
if ($context eq 'cancreate') {
@@ -4467,6 +4586,11 @@ sub captcha_choice {
$pubtext = $lt{'pub'};
$privtext = $lt{'priv'};
$keyentry = 'text';
+ $vertext = $lt{'ver'};
+ $currver = $settings->{'recaptchaversion'};
+ if ($currver ne '2') {
+ $currver = 1;
+ }
}
if (ref($settings->{'recaptchakeys'}) eq 'HASH') {
$currpub = $settings->{'recaptchakeys'}{'public'};
@@ -4500,7 +4624,11 @@ sub captcha_choice {
$currpub.'" size="40" /> '."\n".
''.$privtext.' '."\n".
'
'.
&mt('Name displayed:').
@@ -5293,7 +5418,7 @@ sub serverstatus_pages {
return ('userstatus','lonstatus','loncron','server-status','codeversions',
'checksums','clusterstatus','metadata_keywords','metadata_harvest',
'takeoffline','takeonline','showenv','toggledebug','ping','domconf',
- 'uniquecodes','diskusage');
+ 'uniquecodes','diskusage','coursecatalog');
}
sub defaults_javascript {
@@ -5383,7 +5508,10 @@ sub coursecategories_javascript {
}
my $instcode_reserved = &mt('The name: [_1] is a reserved category.','"instcode"');
my $communities_reserved = &mt('The name: [_1] is a reserved category.','"communities"');
- my $choose_again = '\\n'.&mt('Please use a different name for the new top level category.');
+ my $choose_again = "\n".&mt('Please use a different name for the new top level category.');
+ &js_escape(\$instcode_reserved);
+ &js_escape(\$communities_reserved);
+ &js_escape(\$choose_again);
$output = <<"ENDSCRIPT";