');
}
} elsif ($itemserror) {
@@ -1685,7 +1649,7 @@ sub display_haserrors {
}
sub display_abovethreshold {
- my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror,$custommenu) = @_;
+ my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror) = @_;
my %lt = &Apache::lonlocal::texthash(
reso => 'Resource',
part => 'Part',
@@ -1699,35 +1663,16 @@ sub display_abovethreshold {
);
if (@{$warnings} > 0) {
@{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};
- if ($custommenu) {
- my (%bynum,@overthresh);
- foreach my $item (@{$warnings}) {
- my ($probnum) = ($res_title->{$item} =~ /^Problem\s+(\d+)$/);
- if ($probnum ne '') {
- $bynum{$probnum} = $item;
- }
- }
- foreach my $num (sort { $a <=> $b } keys(%bynum)) {
- push(@overthresh,$bynum{$num});
- }
- @{$warnings} = @overthresh;
- }
- if ($custommenu) {
- $r->print('
'.
- '
'.$lt{'reso'}.'
'.
- '
'.$lt{'part'}.'
'.$lt{'nust'}.'
');
- } else {
- $r->print('');
- }
+ $r->print('
');
} elsif ($itemserror) {
$r->print('
'.$itemserror.'
');
} else {
@@ -1872,7 +1815,7 @@ sub display_crslogins {
'number' => 'Total number of logins',
);
if ($logincount) {
-
+
my $hdr = '
'.
'
'.$lt{'user'}.'
'.
'
'.$lt{'role'}.'
'.
@@ -1914,18 +1857,18 @@ sub display_crslogins {
}
my $table;
foreach my $person (sort(keys(%bylastname))) {
- if (ref($bylastname{$person}) eq 'ARRAY') {
- foreach my $item (@{$bylastname{$person}}) {
+ if (ref($bylastname{$person}) eq 'ARRAY') {
+ foreach my $item (@{$bylastname{$person}}) {
$numlogin ++;
my $css_class = $numlogin%2?' class="LC_odd_row"':'';
- $table .= '
'.$item.'
';
+ $table .= '
'.$item.'
';
}
}
}
my $numrow = 0;
foreach my $role (sort(keys(%counts))) {
my $showrole = &Apache::lonnet::plaintext($role,$crstype);
- if (ref($counts{$role}) eq 'HASH') {
+ if (ref($counts{$role}) eq 'HASH') {
foreach my $sec (sort { $b <=> $a } (keys(%{$counts{$role}}))) {
$numrow ++;
my $css_class = $numrow%2?' class="LC_odd_row"':'';
@@ -2118,19 +2061,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 +2085,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 +2123,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 +2174,7 @@ sub start_box {
'.$showhide.'
');
if (($caller eq 'abovethreshold') && ($$show{$caller})) {
- if ($$show{$caller} && !$custommenu) {
+ if ($$show{$caller}) {
$r->print('