version 1.80, 2004/05/05 21:04:14
|
version 1.82, 2004/05/07 12:03:53
|
Line 37 use Apache::lontexconvert();
|
Line 37 use Apache::lontexconvert();
|
use Apache::lonlocal; |
use Apache::lonlocal; |
|
|
sub list_discussion { |
sub list_discussion { |
my ($mode,$status,$symb,$previous)=@_; |
my ($mode,$status,$symb)=@_; |
# &Apache::lonnet::logthis("status is $status"); |
# &Apache::lonnet::logthis("status is $status"); |
if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' |
|| $status eq 'OPEN')) { |
|| $status eq 'OPEN')) { |
Line 71 sub list_discussion {
|
Line 71 sub list_discussion {
|
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my $showonlyunread = 0; |
my $showonlyunread = 0; |
my $prevread = 0; |
my $prevread = 0; |
|
my $previous = 0; |
my $visit = 0; |
my $visit = 0; |
my $newpostsflag = 0; |
my $newpostsflag = 0; |
|
|
|
# Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts. |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous']); |
|
$previous = $ENV{'form.previous'}; |
if ($previous > 0) { |
if ($previous > 0) { |
$prevread = $previous; |
$prevread = $previous; |
} elsif (defined($dischash{$lastkey})) { |
} elsif (defined($dischash{$lastkey})) { |
Line 155 sub list_discussion {
|
Line 159 sub list_discussion {
|
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
} |
} |
if ($contrib{$idx.':attachmenturl'}) { |
if ($contrib{$idx.':attachmenturl'}) { |
my ($fname,$ft) |
my ($fname) |
=($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/); |
=($contrib{$idx.':attachmenturl'}=~m|/([^/]+)$|); |
$message.='<p>'.&mt('Attachment').': <a href="'. |
&Apache::lonnet::allowuploaded('/adm/feedback', |
&Apache::lonnet::tokenwrapper( |
$contrib{$idx.':attachmenturl'}); |
$contrib{$idx.':attachmenturl'}). |
$message.='<p>'.&mt('Attachment'). |
'"><tt>'.$fname.'.'.$ft.'</tt></a></p>'; |
': <a href="'.$contrib{$idx.':attachmenturl'}.'"><tt>'. |
|
$fname.'</tt></a></p>'; |
} |
} |
if ($message) { |
if ($message) { |
if ($hidden) { |
if ($hidden) { |
Line 972 sub handler {
|
Line 977 sub handler {
|
my $attachmenturl=''; |
my $attachmenturl=''; |
if ($ENV{'form.attachment.filename'}) { |
if ($ENV{'form.attachment.filename'}) { |
unless (length($ENV{'form.attachment'})>131072) { |
unless (length($ENV{'form.attachment'})>131072) { |
$attachmenturl=&Apache::lonnet::userfileupload('attachment'); |
$attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback'); |
} |
} |
} |
} |
# Filter HTML out of message (could be nasty) |
# Filter HTML out of message (could be nasty) |