version 1.94, 2004/06/12 01:07:10
|
version 1.95, 2004/06/23 17:42:58
|
Line 65 sub discussion_visible {
|
Line 65 sub discussion_visible {
|
sub list_discussion { |
sub list_discussion { |
my ($mode,$status,$symb)=@_; |
my ($mode,$status,$symb)=@_; |
|
|
|
my $outputtarget=$ENV{'form.grade_target'}; |
if (not &discussion_visible($status)) { return ''; } |
if (not &discussion_visible($status)) { return ''; } |
my @bgcols = ("#cccccc","#eeeeee"); |
my @bgcols = ("#cccccc","#eeeeee"); |
my $discussiononly=0; |
my $discussiononly=0; |
Line 362 sub list_discussion {
|
Line 363 sub list_discussion {
|
|
|
if ($visible) { |
if ($visible) { |
# Print the discusssion |
# Print the discusssion |
$discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
if ($outputtarget ne 'tex') { |
my $colspan=$maxdepth+1; |
$discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion .= '<tr bgcolor="#FFFFFF"><td colspan="'.$colspan.'" valign="top">'. |
my $colspan=$maxdepth+1; |
'<table border="0" bgcolor="#FFFFFF" width="100%" cellspacing="2" cellpadding="2">'. |
$discussion .= '<tr bgcolor="#FFFFFF"><td colspan="'.$colspan.'" valign="top">'. |
'<tr><td align="left"><b>'.$lt{'cuse'}.'</b></td><td> </td><td align="right"><b>'.$lt{'chgt'}.'</b></td></tr>'. |
'<table border="0" bgcolor="#FFFFFF" width="100%" cellspacing="2" cellpadding="2">'. |
'<tr><td>'.$lt{'disa'}.': <i>'.$currdisp.'</i></td><td> </td><td align="right"><a href="'.$displink.'">'.$dispchange.'</a></td></tr>'. |
'<tr><td align="left"><b>'.$lt{'cuse'}.'</b></td><td> </td><td align="right"><b>'.$lt{'chgt'}.'</b></td></tr>'. |
'<tr><td>'.$lt{'npce'}.': <i>'.$currmark.'</i></td><td> </td><td align="right"><a href="'.$marklink.'">'.$markchange.'</a></td></tr>'. |
'<tr><td>'.$lt{'disa'}.': <i>'.$currdisp.'</i></td><td> </td><td align="right"><a href="'.$displink.'">'.$dispchange.'</a></td></tr>'. |
'</table></td></tr>'. |
'<tr><td>'.$lt{'npce'}.': <i>'.$currmark.'</i></td><td> </td><td align="right"><a href="'.$marklink.'">'.$markchange.'</a></td></tr>'. |
'<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'. |
'</table></td></tr>'. |
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>'; |
'<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'. |
if ($visible>2) { |
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>'; |
$discussion.='<td align="left">'. |
if ($visible>2) { |
'<a href="/adm/feedback?threadedon='.$ressymb; |
$discussion.='<td align="left">'. |
if ($newpostsflag) { |
'<a href="/adm/feedback?threadedon='.$ressymb; |
$discussion .= '&previous='.$prevread; |
if ($newpostsflag) { |
} |
$discussion .= '&previous='.$prevread; |
$discussion .='">'.&mt('Threaded View').'</a> '. |
} |
'<a href="/adm/feedback?threadedoff='.$ressymb; |
$discussion .='">'.&mt('Threaded View').'</a> '. |
if ($newpostsflag) { |
'<a href="/adm/feedback?threadedoff='.$ressymb; |
$discussion .= '&previous='.$prevread; |
if ($newpostsflag) { |
} |
$discussion .= '&previous='.$prevread; |
$discussion .='">'.&mt('Chronological View').'</a> </td>'; |
} |
} |
$discussion .='">'.&mt('Chronological View').'</a> </td>'; |
if ($newpostsflag) { |
} |
if (!$markondisp) { |
if ($newpostsflag) { |
$discussion .='<td align="right"><a href="/adm/feedback?markread='.$ressymb.'">'.&mt('Mark new posts as read').'</a> '; |
if (!$markondisp) { |
} else { |
$discussion .='<td align="right"><a href="/adm/feedback?markread='.$ressymb.'">'.&mt('Mark new posts as read').'</a> '; |
$discussion .= '<td> </td>'; |
} else { |
} |
$discussion .= '<td> </td>'; |
} else { |
} |
$discussion .= '<td> </td>'; |
} else { |
} |
$discussion .= '<td> </td>'; |
$discussion .= '</tr></table></td></tr>'; |
} |
|
$discussion .= '</tr></table></td></tr>'; |
|
} else { |
|
$discussion.='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}'. |
|
'\textbf{DISCUSSIONS}\makebox[2 cm][b]{\hrulefill}'. |
|
'\vskip 0 mm\noindent\textbf{'.$lt{'cuse'}.'}:\vskip 0 mm'. |
|
'\noindent\textbf{'.$lt{'disa'}.'}: \textit{'.$currdisp.'}\vskip 0 mm'. |
|
'\noindent\textbf{'.$lt{'npce'}.'}: \textit{'.$currmark.'}'; |
|
} |
my $numhidden = keys %notshown; |
my $numhidden = keys %notshown; |
if ($numhidden > 0) { |
if ($numhidden > 0) { |
my $colspan = $maxdepth+1; |
my $colspan = $maxdepth+1; |
Line 410 sub list_discussion {
|
Line 418 sub list_discussion {
|
} |
} |
foreach (sort { $a <=> $b } keys %alldiscussion) { |
foreach (sort { $a <=> $b } keys %alldiscussion) { |
unless ($notshown{$alldiscussion{$_}} eq '1') { |
unless ($notshown{$alldiscussion{$_}} eq '1') { |
$discussion.="\n<tr>"; |
if ($outputtarget ne 'tex') { |
|
$discussion.="\n<tr>"; |
|
} else { |
|
$discussion.='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}'; |
|
} |
my $thisdepth=$depth[$alldiscussion{$_}]; |
my $thisdepth=$depth[$alldiscussion{$_}]; |
for (1..$thisdepth) { |
if ($outputtarget ne 'tex') { |
$discussion.='<td> </td>'; |
for (1..$thisdepth) { |
} |
$discussion.='<td> </td>'; |
|
} |
|
} |
my $colspan=$maxdepth-$thisdepth+1; |
my $colspan=$maxdepth-$thisdepth+1; |
$discussion.='<td bgcolor="'.$bgcols[$newitem{$alldiscussion{$_}}].'" colspan="'.$colspan.'">'. |
if ($outputtarget ne 'tex') { |
|
$discussion.='<td bgcolor="'.$bgcols[$newitem{$alldiscussion{$_}}].'" colspan="'.$colspan.'">'. |
$discussionitems[$alldiscussion{$_}]. |
$discussionitems[$alldiscussion{$_}]. |
'</td></tr>'; |
'</td></tr>'; |
|
} else { |
|
#cleanup block |
|
$discussionitems[$alldiscussion{$_}]=~s/<table([^>]*)>/<table TeXwidth="90 mm">/; |
|
$discussionitems[$alldiscussion{$_}]=~s/<tr([^>]*)><td([^>]*)>/<tr><td TeXwidth="20 mm" align="left">/; |
|
my $threadinsert=''; |
|
if ($thisdepth > 0) { |
|
$threadinsert='<br /><strong>Reply: '.$thisdepth.'</strong>'; |
|
} |
|
$discussionitems[$alldiscussion{$_}]=~s/<\/td><td([^>]*)>/$threadinsert<\/td><td TeXwidth="65 mm" align="left">/; |
|
$discussionitems[$alldiscussion{$_}]=~s/<a([^>]+)>(Hide|Delete|Reply|Submissions)<\/a>//g; |
|
$discussionitems[$alldiscussion{$_}]=~s/(<b>|<\/b>|<\/a>|<a([^>]+)>)//g; |
|
$discussion.=&Apache::lonxml::xmlparse('','tex',$discussionitems[$alldiscussion{$_}]); |
|
} |
} |
} |
} |
} |
$discussion.='</table><br /><br />'; |
if ($outputtarget ne 'tex') { |
|
$discussion.='</table><br /><br />'; |
|
} |
} |
} |
if ($discussiononly) { |
if ($discussiononly) { |
$discussion.=(<<ENDDISCUSS); |
$discussion.=(<<ENDDISCUSS); |
Line 440 Attachment (128 KB max size): <input typ
|
Line 470 Attachment (128 KB max size): <input typ
|
</p> |
</p> |
</form> |
</form> |
ENDDISCUSS |
ENDDISCUSS |
$discussion.=&generate_preview_button(); |
if ($outputtarget ne 'tex') { |
|
$discussion.=&generate_preview_button(); |
|
} |
} else { |
} else { |
if (&discussion_open($status) && |
if (&discussion_open($status) && |
&Apache::lonnet::allowed('pch', |
&Apache::lonnet::allowed('pch', |
$ENV{'request.course.id'}. |
$ENV{'request.course.id'}. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
if ($outputtarget ne 'tex') { |
$symb.':::" '.$target.'>'. |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
'<img src="/adm/lonMisc/chat.gif" border="0" />'. |
$symb.':::" '.$target.'>'. |
&mt('Post Discussion').'</a></td></tr></table>'; |
'<img src="/adm/lonMisc/chat.gif" border="0" />'. |
|
&mt('Post Discussion').'</a></td></tr></table>'; |
|
} |
} |
} |
} |
} |
return $discussion; |
return $discussion; |