version 1.374, 2017/11/03 21:36:27
|
version 1.378, 2017/12/18 23:20:48
|
Line 44 use HTML::LCParser();
|
Line 44 use HTML::LCParser();
|
#use HTML::Tidy::libXML; |
#use HTML::Tidy::libXML; |
use Apache::lonspeller(); |
use Apache::lonspeller(); |
use Apache::longroup; |
use Apache::longroup; |
use Cwd; |
use Archive::Zip qw( :ERROR_CODES ); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub discussion_open { |
sub discussion_open { |
Line 674 END
|
Line 674 END
|
$newpostsflag,$group, |
$newpostsflag,$group, |
$prevread,$markondisp,$seehidden); |
$prevread,$markondisp,$seehidden); |
$discussion .= "</table></form>\n"; |
$discussion .= "</table></form>\n"; |
} |
} |
if ($outputtarget eq 'export') { |
if ($outputtarget eq 'export') { |
if ($manifestok) { |
if ($manifestok) { |
while ($currdepth > 0) { |
while ($currdepth > 0) { |
Line 698 END
|
Line 698 END
|
|
|
if (($env{'user.name'} =~ /^$match_username$/) |
if (($env{'user.name'} =~ /^$match_username$/) |
&& ($env{'user.domain'} =~ /^$match_domain$/)) { |
&& ($env{'user.domain'} =~ /^$match_domain$/)) { |
my $now = time(); |
my $now = time(); |
my $imszipfile = '/prtspool/'. |
my $imszipfile = '/prtspool/'. |
join('_',$env{'user.name'},$env{'user.domain'},$now). |
join('_',$env{'user.name'},$env{'user.domain'},$now). |
'_'.rand(1000000000).'.zip'; |
'_'.rand(1000000000).'.zip'; |
my $cwd = &getcwd(); |
my $zip = Archive::Zip->new(); |
|
$zip->addTree($tempexport); |
my $imszip = '/home/httpd/'.$imszipfile; |
my $imszip = '/home/httpd/'.$imszipfile; |
chdir $tempexport; |
if ($zip->writeToFileNamed($imszip) == AZ_OK) { |
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', |
close(OUTPUT); |
|
chdir $cwd; |
|
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', |
|
'<a href="'.$imszipfile.'">','</a>').'<br />'; |
'<a href="'.$imszipfile.'">','</a>').'<br />'; |
|
} else { |
|
$discussion .= &mt('Failed to create zip file').'<br />'; |
|
} |
if ($copyresult) { |
if ($copyresult) { |
$discussion .= '<span class="LC_error">'. |
$discussion .= '<span class="LC_error">'. |
&mt('The following errors occurred during export:'). |
&mt('The following errors occurred during export:'). |
Line 854 sub send_feedback_link {
|
Line 855 sub send_feedback_link {
|
&discussion_link($ressymb, |
&discussion_link($ressymb, |
'<img alt="" class="LC_noBorder" src="'. |
'<img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>', |
'" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>', |
'replydisc'). |
'replydisc'). |
'</span>'; |
'</span>'; |
} |
} |
Line 865 sub send_message_link {
|
Line 866 sub send_message_link {
|
&discussion_link($ressymb, |
&discussion_link($ressymb, |
'<img alt="" class="LC_noBorder" src="'. |
'<img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/feedback.png'). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/feedback.png'). |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span>', |
'" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span>', |
'sendmessageonly'). |
'sendmessageonly'). |
'</span>'; |
'</span>'; |
return $output; |
return $output; |
Line 4551 ENDREDIR
|
Line 4552 ENDREDIR
|
($env{'request.course.id'} && ($feedurl!~m:^/adm:)) |
($env{'request.course.id'} && ($feedurl!~m:^/adm:)) |
|| |
|| |
($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/)) |
($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/)) |
|
|| |
|
(($env{'request.course.id'} && ($feedurl =~ /ext\.tool$/))) |
) { |
) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |