';
- return $footer;
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
+ if ($blocked) {
+ $blocktext = '
'.$blocktext."";
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ if ($mode ne 'board') {
+ $blocktext.=&send_message_link($ressymb).'
';
+ }else{
+ $blocktext.="";
}
+ return $blocktext;
}
my @bgcols = ("LC_disc_old_item","LC_disc_new_item");
@@ -690,7 +674,7 @@ END
$newpostsflag,$group,
$prevread,$markondisp,$seehidden);
$discussion .= "\n";
- }
+ }
if ($outputtarget eq 'export') {
if ($manifestok) {
while ($currdepth > 0) {
@@ -712,29 +696,21 @@ END
#Create zip file in prtspool
- if (($env{'user.name'} =~ /^$match_username$/)
- && ($env{'user.domain'} =~ /^$match_domain$/)) {
- my $now = time();
- my $imszipfile = '/prtspool/'.
- join('_',$env{'user.name'},$env{'user.domain'},$now).
- '_'.rand(1000000000).'.zip';
- my $zip = Archive::Zip->new();
- $zip->addTree($tempexport);
- my $imszip = '/home/httpd/'.$imszipfile;
- if ($zip->writeToFileNamed($imszip) == AZ_OK) {
- $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',
+ my $imszipfile = '/prtspool/'.
+ $env{'user.name'}.'_'.$env{'user.domain'}.'_'.
+ time.'_'.rand(1000000000).'.zip';
+ my $cwd = &getcwd();
+ my $imszip = '/home/httpd/'.$imszipfile;
+ chdir $tempexport;
+ open(OUTPUT, "zip -r $imszip * 2> /dev/null |");
+ close(OUTPUT);
+ chdir $cwd;
+ $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]',
'','').' ';
- } else {
- $discussion .= &mt('Failed to create zip file').' ';
- }
- if ($copyresult) {
- $discussion .= ''.
- &mt('The following errors occurred during export:').
- ' '.$copyresult;
- }
- } else {
- $discussion .= '
'.
- &mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating the zip file.').'
';
+ if ($copyresult) {
+ $discussion .= ''.
+ &mt('The following errors occurred during export:').
+ ' '.$copyresult;
}
}
} else {
@@ -790,60 +766,33 @@ END
&mt('This discussion is closed.').'';
}
} elsif ($outputtarget ne 'tex') {
- unless ($nofooter) {
- $discussion.='
';
- unless ($nodisclink) {
- if (&discussion_open($status) &&
- &Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.= &send_feedback_link($ressymb);
- if ($env{'request.role.adv'}) {
- my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
- my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
- if (defined($close) && $close ne '' && $close < time) {
- if ($canvote eq 'notended') {
- $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
- } else {
- $discussion .= ' '.&mt('(Closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
- }
- }
+ $discussion.='
';
+ if (&discussion_open($status) &&
+ &Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $discussion.= &send_feedback_link($ressymb);
+ if ($env{'request.role.adv'}) {
+ my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
+ my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
+ if (defined($close) && $close ne '' && $close < time) {
+ if ($canvote eq 'notended') {
+ $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ } else {
+ $discussion .= ' '.&mt('(Closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
}
- } else {
- $discussion.= ''.&mt('This discussion is closed.').'';
}
}
- unless ($nofdbklink) {
- $discussion.= &send_message_link($ressymb);
- }
- $discussion.='