+
');
- if ($custommenu) {
- $r->print("\n");
- }
}
#-------------------------------
@@ -701,16 +766,21 @@ sub display_threshold_config {
foreach my $type (@thresholditems) {
my $parameter = $env{'request.course.id'}.':threshold_'.$type;
# onchange is javascript to automatically check the 'Set' button.
- my $onchange = 'onFocus="javascript:window.document.forms'.
+ my $onchange = 'onfocus="javascript:window.document.forms'.
"['thresholdform'].elements['".$parameter."_setparmval']".
'.checked=true;"';
+ my $aria_textbox = ' aria-label="'.&mt('Threshold value for [_1]',
+ $threshold_titles{$type}).'"';
+ my $aria_checkbox = ' aria-label="'.&mt('Change threshold value for [_1]',
+ $threshold_titles{$type}).'"';
$r->print(&Apache::loncommon::start_data_table_row()."\n".
'
'."\n".
&Apache::loncommon::end_data_table_row());
}
@@ -735,6 +805,8 @@ sub display_interval_config {
$setting = 'oldroleinterval';
} elsif ($context eq 'newroles') {
$setting = 'newroleinterval';
+ } elsif ($context eq 'sessions') {
+ $setting = 'sessionactivity';
}
my $lctype = lc(&Apache::loncommon::course_type());
my $current = &get_current($env{'user.name'},$env{'user.domain'},
@@ -745,6 +817,8 @@ sub display_interval_config {
$r->print(' '.&mt('Choose the time window to use to display roles for which access to the '.$lctype.' became available.').' ');
} elsif ($context eq 'crslogin') {
$r->print(' '.&mt('Choose the time window to use to display the last login by a user in the '.$lctype).' ');
+ } elsif ($context eq 'sessions') {
+ $r->print(' '.&mt('Choose the time limit to use to display active user sessions in the '.$lctype.'.').' ');
} else {
$r->print(' '.&mt('Choose the time window to use to display resources in the '.$lctype.' with version changes.').' ');
}
@@ -760,12 +834,19 @@ sub display_interval_config {
'.
&mt('Display:').'
-
'.$table);
}
} else {
$r->print('
'.
&mt('There are no '.$interval).
- '
');
}
return;
}
-
+
sub display_coursediscussion {
my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_;
my $lctype = lc(&Apache::loncommon::course_type());
@@ -1978,7 +2182,7 @@ sub display_coursediscussion {
my $forum_title = $$unread{$ressymb}{'title'};
my $type = 'Resource';
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);
- my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb};
+ my $disclink = $feedurl.'?symb='. &escape($$unread{$ressymb}{symb});
if ($feedurl =~ /bulletinboard/) {
$type = 'Discussion Board';
}
@@ -2111,6 +2315,8 @@ sub store_interval_setting {
$interval_settings{$cid.':newroleinterval'} = $env{'form.interval'};
} elsif ($context eq 'crslogin') {
$interval_settings{$cid.':crslogininterval'} = $env{'form.interval'};
+ } elsif ($context eq 'sessions') {
+ $interval_settings{$cid.':sessionactivity'} = $env{'form.interval'};
} else {
$interval_settings{$cid.':interval'} = $env{'form.interval'};
}
@@ -2118,19 +2324,19 @@ sub store_interval_setting {
\%interval_settings,$udom,$uname);
if ($outcome eq 'ok') {
if (ref($interval_titles->{$context}) eq 'HASH') {
- $result = &mt('New filter setting: [_1].',''.
- $interval_titles->{$context}->{$env{'form.interval'}}.'').' ';
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('New filter setting: [_1].',''.
+ $interval_titles->{$context}->{$env{'form.interval'}}.'').' ');
}
} else {
my $lctype = lc(&Apache::loncommon::course_type());
&Apache::lonnet::logthis('Error saving whatsnew '.$context.' interval setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
- $result = &mt('Unable to set interval to [_1] due to [_2].',
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set interval to [_1] due to [_2].',
''.$interval_titles->{$context}->{$env{'form.interval'}}.'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub store_discussion_setting {
@@ -2142,20 +2348,20 @@ sub store_discussion_setting {
my $outcome = &Apache::lonnet::put('nohist_whatsnew',
\%discussion_settings,$udom,$uname);
if ($outcome eq 'ok') {
- $result = &mt('Count unread posts in discussions display set to [_1]',
- ''.&mt($env{'form.countunread'}).'').' ';
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Count unread posts in discussions display set to [_1]',
+ ''.&mt($env{'form.countunread'}).'').' ');
} else {
my $lctype = lc(&Apache::loncommon::course_type());
&Apache::lonnet::logthis('Error saving whatsnew countunread setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
- $result = &mt('Unable to set "number unread posts display" to [_1]'.
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set "number unread posts display" to [_1]'.
' due to [_2].',
''.&mt($env{'form.countunread'}).'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub store_courseinit_setting {
@@ -2180,34 +2386,33 @@ sub store_courseinit_setting {
\%courseinit_settings,$udom,$uname);
if ($outcome eq 'ok') {
if ($page_control eq 'global preferences') {
- $result = &mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'','');
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'',''));
} else {
- $result = &mt('Page displayed after role selection in this '.$lctype.' set to [_1].'
- ,''.$$initpage{$env{'form.courseinit_page'}}.'');
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].'
+ ,''.$$initpage{$env{'form.courseinit_page'}}.''));
}
} else {
&Apache::lonnet::logthis('Error saving whatsnew courseinit '.
'setting: '.$outcome.' for '.$uname.
':'.$udom.' in '.$lctype.' '.$cid);
if ($page_control eq 'global preferences') {
- $result = &mt('Unable to set control of page display to [_1]'.
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set control of page display to [_1]'.
' due to [_2].',
''.$page_control.'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
} else {
- $result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'
,''.$$initpage{$env{'form.courseinit_page'}}.''
- ,''.$outcome.'')
- .' ';
+ ,''.$outcome.''),1);
}
}
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub start_box {
- my ($r,$show,$heading,$caller,$refpage,$action,$custommenu) = @_;
+ my ($r,$show,$heading,$caller,$refpage) = @_;
my %lt = &Apache::lonlocal::texthash(
chth => 'Change thresholds?',
chin => 'Change interval?',
@@ -2232,7 +2437,7 @@ sub start_box {
'.$showhide.'
');
if (($caller eq 'abovethreshold') && ($$show{$caller})) {
- if ($$show{$caller} && !$custommenu) {
+ if ($$show{$caller}) {
$r->print('