'.
'';
}
@@ -769,7 +771,7 @@ sub build_posting_display {
my @original=();
my @index=();
my $symb=&Apache::lonenc::check_decrypt($ressymb);
- my $escsymb=&Apache::lonnet::escape($ressymb);
+ my $escsymb=&escape($ressymb);
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
@@ -1328,12 +1330,15 @@ sub mail_screen {
my $attachnum = 0;
my $anonchk = (<print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver));
if ($attachnum > 0) {
if (@currnewattach > 0) {
- $newattachmsg .= 'New attachments ';
+ $newattachmsg .= ' New attachments ';
if (@currnewattach > 1) {
$newattachmsg .= '';
foreach my $item (@currnewattach) {
@@ -1817,23 +1804,21 @@ sub print_sortfilter_options {
$r->send_http_header;
&Apache::lonenc::check_encrypt(\$symb);
- my @sections = ();
+ my @sections;
my $section_sel = '';
- my $numsections = 0;
my $numvisible = 5;
- my %sectioncount = ();
-
- $numsections = &Apache::loncommon::get_sections($env{'course.'.$env{'request.course.id'}.'.domain'},$env{'course.'.$env{'request.course.id'}.'.num'},\%sectioncount);
+ my %sectioncount = &Apache::loncommon::get_sections();
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section
@sections = ('all',$env{'request.course.sec'});
$numvisible = 2;
} else {
@sections = sort {$a cmp $b} keys(%sectioncount);
- unshift(@sections,'all'); # Put 'all' at the front of the list
- if ($numsections < 4) {
- $numvisible = $numsections + 1;
+ if (scalar(@sections) < 4) {
+ $numvisible = scalar(@sections) + 1;
}
+ unshift(@sections,'all'); # Put 'all' at the front of the list
+
}
foreach (@sections) {
$section_sel .= " $_\n";
@@ -2206,7 +2191,11 @@ sub redirect_back {
}
$feedurl=&Apache::lonenc::check_encrypt($feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
- my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }");
+ my %onload;
+ if ($env{'environment.remote'} ne 'off') {
+ $onload{'onload'} =
+ "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
+ }
my $start_page=
&Apache::loncommon::start_page('New posts marked as read',undef,
{'redirect' => [2,$feedurl],
@@ -2237,9 +2226,15 @@ sub no_redirect_back {
my ($r,$feedurl) = @_;
my $nofeed=&mt('Sorry, no feedback possible on this resource ...');
+ my %onload;
+ if ($env{'environment.remote'} ne 'off') {
+ $onload{'onload'} =
+ "if (window.name!='loncapaclient') { self.window.close(); }";
+ }
+
my %body_options = ('only_body' => 1,
'bgcolor' => '#FFFFFF',
- 'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"});
+ 'add_entries' => \%onload,);
if ($feedurl !~ m{^/adm/feedback}) {
$body_options{'rediect'} = [2,$feedurl];
@@ -2268,23 +2263,23 @@ sub screen_header {
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {
$msgoptions=
- ' |