version 1.273.4.4, 2010/01/24 23:20:16
|
version 1.292, 2010/04/14 13:58:11
|
Line 41 use Apache::lonnavmaps;
|
Line 41 use Apache::lonnavmaps;
|
use Apache::lonenc(); |
use Apache::lonenc(); |
use Apache::lonrss(); |
use Apache::lonrss(); |
use HTML::LCParser(); |
use HTML::LCParser(); |
|
#use HTML::Tidy::libXML; |
use Apache::lonspeller(); |
use Apache::lonspeller(); |
use Apache::longroup; |
use Apache::longroup; |
use Cwd; |
use Cwd; |
Line 91 sub list_discussion {
|
Line 92 sub list_discussion {
|
if (not &discussion_visible($status)) { |
if (not &discussion_visible($status)) { |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
&Apache::lonenc::check_encrypt(\$ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
return '<br />'.&send_message_link($ressymb); |
return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>"; |
} |
} |
} |
} |
if ($group ne '' && $mode eq 'board') { |
if ($group ne '' && $mode eq 'board') { |
Line 103 sub list_discussion {
|
Line 104 sub list_discussion {
|
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('boards'); |
&Apache::loncommon::blocking_status('boards'); |
if ($blocked) { |
if ($blocked) { |
|
$blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>"; |
&Apache::lonenc::check_encrypt(\$ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
$blocktext.='<br />'.&send_message_link($ressymb); |
$blocktext.=&send_message_link($ressymb).'</div>'; |
|
}else{ |
|
$blocktext.="</div>"; |
} |
} |
return $blocktext; |
return $blocktext; |
} |
} |
Line 171 sub list_discussion {
|
Line 175 sub list_discussion {
|
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
|
|
|
|
# Get information about students and non-students in course for filtering display of posts |
# Get information about students and non-students in course for filtering display of posts |
my %roleshash = (); |
my %roleshash = (); |
my %roleinfo = (); |
my %roleinfo = (); |
Line 270 sub list_discussion {
|
Line 273 sub list_discussion {
|
my %anonhash=(); |
my %anonhash=(); |
my $anoncnt=0; |
my $anoncnt=0; |
my $target=''; |
my $target=''; |
unless ($env{'browser.interface'} eq 'textual' || |
|
$env{'environment.remote'} eq 'off' ) { |
|
$target='target="LONcom"'; |
|
} |
|
|
|
my $now = time; |
my $now = time; |
$discinfo{$visitkey} = $visit; |
$discinfo{$visitkey} = $visit; |
Line 354 sub list_discussion {
|
Line 353 sub list_discussion {
|
$togglink = 'toggoff'; |
$togglink = 'toggoff'; |
} |
} |
|
|
$chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; |
$chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; |
|
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$chglink .= '&previous='.$prevread; |
$chglink .= '&previous='.$prevread; |
} |
} |
$chglink.=&group_args($group); |
$chglink.=&group_args($group); |
|
|
Line 400 sub list_discussion {
|
Line 399 sub list_discussion {
|
my $manifestfilename = $tempexport.$manifest; |
my $manifestfilename = $tempexport.$manifest; |
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) { |
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) { |
$manifestok=1; |
$manifestok=1; |
print $manifestfile qq| |
print $manifestfile qq|<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
|
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" |
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
identifier="MANIFEST-$ressymb" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 |
identifier="MANIFEST-$ressymb" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 |
Line 414 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 412 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
} else { |
} else { |
my $colspan=$maxdepth+1; |
my $colspan=$maxdepth+1; |
$discussion.= qq| |
$discussion.= &Apache::lonhtmlcommon::scripttag(qq| |
<script> |
|
function verifydelete (caller,symb,idx,newflag,previous,groupparm) { |
function verifydelete (caller,symb,idx,newflag,previous,groupparm) { |
var symbparm = symb+':::'+idx |
var symbparm = symb+':::'+idx |
var prevparm = "" |
var prevparm = "" |
if (newflag == 1) { |
if (newflag == 1) { |
prevparm = "&previous="+previous |
prevparm = "&previous="+previous |
} |
} |
if (caller == 'studentdelete') { |
if (caller == 'studentdelete') { |
if (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) { |
if (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) { |
Line 434 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 431 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
} |
} |
} |
} |
</script> |
|); |
|; |
|
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" >'. |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" >'. |
"\n".'<table class="LC_discussion">'; |
"\n".'<table class="LC_discussion">'; |
$discussion .= &action_links_bar($colspan,$ressymb,$visible, |
$discussion .= &action_links_bar($colspan,$ressymb,$visible, |
Line 448 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 444 imscp_v1p1.xsd http://www.imsglobal.org/
|
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'. |
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'. |
'<a href="/adm/feedback?allposts=1&symb='.$escsymb; |
'<a href="/adm/feedback?allposts=1&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '. |
$discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '. |
Line 528 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 524 imscp_v1p1.xsd http://www.imsglobal.org/
|
print $manifestfile "\n". |
print $manifestfile "\n". |
'<item identifier="ITEM-'.$ressymb.'-'.$alldiscussion{$post}.'" isvisible="'. |
'<item identifier="ITEM-'.$ressymb.'-'.$alldiscussion{$post}.'" isvisible="'. |
$imsitems{$alldiscussion{$post}}{'isvisible'}.'" identifieref="RES-'.$ressymb.'-'.$alldiscussion{$post}.'">'. |
$imsitems{$alldiscussion{$post}}{'isvisible'}.'" identifieref="RES-'.$ressymb.'-'.$alldiscussion{$post}.'">'. |
'<title>'.$imsitems{$alldiscussion{$post}}{'title'}.'</title>'; |
'<title>'.$imsitems{$alldiscussion{$post}}{'title'}.'</title></item>'; |
$imsresources .= "\n". |
$imsresources .= "\n". |
'<resource identifier="RES-'.$ressymb.'-'.$alldiscussion{$post}.'" type="webcontent" href="'.$postfilename.'">'."\n". |
'<resource identifier="RES-'.$ressymb.'-'.$alldiscussion{$post}.'" type="webcontent" href="'.$postfilename.'">'."\n". |
'<file href="'.$postfilename.'">'."\n". |
'<file href="'.$postfilename.'">'."\n". |
$imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n". |
$imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}.'</file>'."\n". |
'</resource>'; |
'</resource>'; |
} |
} |
my $postingfile; |
my $postingfile; |
Line 567 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 563 imscp_v1p1.xsd http://www.imsglobal.org/
|
<table border="0" cellpadding="0" cellspacing="4"> |
<table border="0" cellpadding="0" cellspacing="4"> |
<tr> |
<tr> |
<td> |
<td> |
<font size="-1"><b>$lt{'cuse'}</b>:</td> |
<font size="-1"><b>$lt{'cuse'}</b>:</font></td> |
<td> </td> |
<td> </td> |
<td><font size="-1"> |
<td><font size="-1"> |
END |
END |
Line 589 END
|
Line 585 END
|
</font></td> |
</font></td> |
<td> </td> |
<td> </td> |
<td align="left"> |
<td align="left"> |
<font size="-1"><b><a href="$chglink">$lt{'chgt'}</a>?</font></b> |
<font size="-1"><b><a href="$chglink">$lt{'chgt'}</a>?</b></font> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 644 END
|
Line 640 END
|
$discussion.='<td align="right">'. |
$discussion.='<td align="right">'. |
'<input type="hidden" name="discsymb" value="'.$ressymb.'" />'."\n". |
'<input type="hidden" name="discsymb" value="'.$ressymb.'" />'."\n". |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
' onClick="this.form.submit();" />'."\n". |
' onclick="this.form.submit();" />'."\n". |
'</td>'; |
'</td>'; |
} |
} |
$discussion .= (<<END); |
$discussion .= (<<END); |
Line 757 sub send_feedback_link {
|
Line 753 sub send_feedback_link {
|
my $output = '<span class="LC_feedback_link">'. |
my $output = '<span class="LC_feedback_link">'. |
' <a href="/adm/feedback?replydisc='. |
' <a href="/adm/feedback?replydisc='. |
&escape($ressymb).':::" '.$target.'>'. |
&escape($ressymb).':::" '.$target.'>'. |
'<img alt="" src="'. |
'<img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif'). |
'" border="0" />'.&mt('Post Discussion').'</a></span>'; |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span></a></span>'; |
return $output; |
return $output; |
} |
} |
|
|
Line 767 sub send_message_link {
|
Line 763 sub send_message_link {
|
my ($ressymb) = @_; |
my ($ressymb) = @_; |
my $output = '<span class="LC_message_link">'. |
my $output = '<span class="LC_message_link">'. |
' <a href="/adm/feedback?sendmessageonly=1&symb='. |
' <a href="/adm/feedback?sendmessageonly=1&symb='. |
&escape($ressymb).'"><img alt="" src="'. |
&escape($ressymb).'"><img alt="" class="LC_noBorder" src="'. |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/com.png'). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/feedback.png'). |
'" border="0" />'.&mt('Send Feedback').'</a></span>'; |
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Send Feedback').'</span></a></span>'; |
return $output; |
return $output; |
} |
} |
|
|
Line 782 sub action_links_bar {
|
Line 778 sub action_links_bar {
|
if ($visible>2) { |
if ($visible>2) { |
$discussion .= '<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
$discussion .= '<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .='">'.&mt('Threaded View').'</a> '. |
$discussion .='">'.&mt('Threaded View').'</a> '. |
'<a href="/adm/feedback?cmd=threadedoff&symb='.$escsymb; |
'<a href="/adm/feedback?cmd=threadedoff&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .='">'.&mt('Chronological View').'</a> |
$discussion .='">'.&mt('Chronological View').'</a> |
<a href="/adm/feedback?cmd=sortfilter&symb='.$escsymb; |
<a href="/adm/feedback?cmd=sortfilter&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .='">'.&mt('Sorting/Filtering options').'</a>'.(' ' x2); |
$discussion .='">'.&mt('Sorting/Filtering options').'</a>'.(' ' x2); |
} |
} |
$discussion .='<a href="/adm/feedback?export='.$escsymb; |
$discussion .='<a href="/adm/feedback?export='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
Line 813 sub action_links_bar {
|
Line 809 sub action_links_bar {
|
&mt('Preferences on what is marked as NEW'). |
&mt('Preferences on what is marked as NEW'). |
'</a><br /><a href="/adm/feedback?markread=1&symb='.$escsymb; |
'</a><br /><a href="/adm/feedback?markread=1&symb='.$escsymb; |
$discussion .= &group_args($group); |
$discussion .= &group_args($group); |
$discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>'; |
$discussion .= '">'.&mt('Mark NEW posts no longer new').'</a></td>'; |
} else { |
} else { |
$discussion .= '<td> </td>'; |
$discussion .= '<td> </td>'; |
} |
} |
Line 846 sub postingform_display {
|
Line 842 sub postingform_display {
|
<br /><a name="newpost"></a> |
<br /><a name="newpost"></a> |
<font size="1">$lt{'note'}</font><br /> |
<font size="1">$lt{'note'}</font><br /> |
<b>$lt{'title'}:</b> <input type="text" name="subject" value="$subject" size="30" /><br /><br /> |
<b>$lt{'title'}:</b> <input type="text" name="subject" value="$subject" size="30" /><br /><br /> |
<textarea name="comment" cols="80" rows="14" wrap="hard">$comment</textarea> |
<textarea name="comment" cols="80" rows="14" >$comment</textarea> |
ENDDISCUSS |
ENDDISCUSS |
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
$postingform .= '<input type="hidden" name="origpage" value="'. |
$postingform .= '<input type="hidden" name="origpage" value="'. |
Line 1014 sub build_posting_display {
|
Line 1010 sub build_posting_display {
|
$contrib{$idx.':senderdomain'}).' ('. |
$contrib{$idx.':senderdomain'}).' ('. |
$contrib{$idx.':sendername'}.':'. |
$contrib{$idx.':sendername'}.':'. |
$contrib{$idx.':senderdomain'}.')'; |
$contrib{$idx.':senderdomain'}.')'; |
|
$sender = '<b>'.$sender.'</b>'; |
if ($contrib{$idx.':anonymous'}) { |
if ($contrib{$idx.':anonymous'}) { |
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$screenname; |
$screenname; |
Line 1055 sub build_posting_display {
|
Line 1052 sub build_posting_display {
|
$sender.=' <a href="/adm/feedback?editdisc='. |
$sender.=' <a href="/adm/feedback?editdisc='. |
$escsymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= &group_args($group); |
$sender .= &group_args($group); |
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
Line 1073 sub build_posting_display {
|
Line 1070 sub build_posting_display {
|
$sender.=' <a href="/adm/feedback?unhide='. |
$sender.=' <a href="/adm/feedback?unhide='. |
$escsymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= '">'.&mt('Make Visible').'</a>'; |
$sender .= '">'.&mt('Make Visible').'</a>'; |
} |
} |
Line 1081 sub build_posting_display {
|
Line 1078 sub build_posting_display {
|
$sender.=' <a href="/adm/feedback?hide='. |
$sender.=' <a href="/adm/feedback?hide='. |
$escsymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= &group_args($group); |
$sender .= &group_args($group); |
$sender .= '">'.&mt('Hide').'</a>'; |
$sender .= '">'.&mt('Hide').'</a>'; |
Line 1097 sub build_posting_display {
|
Line 1094 sub build_posting_display {
|
} else { |
} else { |
$sender='<i>'.$$anonhash{$key}.'</i>'; |
$sender='<i>'.$$anonhash{$key}.'</i>'; |
} |
} |
|
$sender = '<b>'.$sender.'</b>'; |
# Set up for sorting by domain, then username for anonymous |
# Set up for sorting by domain, then username for anonymous |
unless (defined($$usernamesort{'__anon'})) { |
unless (defined($$usernamesort{'__anon'})) { |
%{$$usernamesort{'__anon'}} = (); |
%{$$usernamesort{'__anon'}} = (); |
Line 1122 sub build_posting_display {
|
Line 1120 sub build_posting_display {
|
$sender.=' <a href="/adm/feedback?replydisc='. |
$sender.=' <a href="/adm/feedback?replydisc='. |
$escsymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= &group_args($group); |
$sender .= &group_args($group); |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
Line 1133 sub build_posting_display {
|
Line 1131 sub build_posting_display {
|
$sender.=' <a href="/adm/feedback?replydisc='. |
$sender.=' <a href="/adm/feedback?replydisc='. |
$escsymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
} |
} |
} |
} |
if ($viewgrades) { |
if ($viewgrades) { |
$vgrlink=&Apache::loncommon::submlink('Submissions', |
$vgrlink=&Apache::loncommon::submlink(&mt('Submissions'), |
$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb); |
$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb); |
} |
} |
if ($$dischash{$readkey}=~/\.$idx\./) { |
if ($$dischash{$readkey}=~/\.$idx\./) { |
Line 1170 sub build_posting_display {
|
Line 1168 sub build_posting_display {
|
$$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; |
$$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; |
$$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; |
$$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; |
$$imsitems{$idx}{'sender'}=$plainname.' ('. |
$$imsitems{$idx}{'sender'}=$plainname.' ('. |
$contrib{$idx.':sendername'}.' at '. |
$contrib{$idx.':sendername'}.':'. |
$contrib{$idx.':senderdomain'}.')'; |
$contrib{$idx.':senderdomain'}.')'; |
$$imsitems{$idx}{'isanonymous'}='false'; |
$$imsitems{$idx}{'isanonymous'}='false'; |
if ($contrib{$idx.':anonymous'}) { |
if ($contrib{$idx.':anonymous'}) { |
Line 1243 sub build_posting_display {
|
Line 1241 sub build_posting_display {
|
if ($prevread > 0 && $prevread <= $posttime) { |
if ($prevread > 0 && $prevread <= $posttime) { |
$$newitem{$idx} = 1; |
$$newitem{$idx} = 1; |
$$discussionitems[$idx] .= ' |
$$discussionitems[$idx] .= ' |
<p><table border="0" width="100%"> |
<table border="0" width="100%"> |
<tr><td align="left"><font color="#FF0000"><b>'.&mt('NEW').'</b></font></td>'; |
<tr><td align="left"><font color="#FF0000"><b>'.&mt('NEW').'</b></font></td>'; |
} else { |
} else { |
$$newitem{$idx} = 0; |
$$newitem{$idx} = 0; |
$$discussionitems[$idx] .= ' |
$$discussionitems[$idx] .= ' |
<p><table border="0" width="100%"> |
<table border="0" width="100%"> |
<tr><td align="left"> </td>'; |
<tr><td align="left"> </td>'; |
} |
} |
$$discussionitems[$idx] .= '<td align="left"> '. |
$$discussionitems[$idx] .= '<td align="left"> '. |
'<b>'.$subject.'</b> '. |
'<b>'.$subject.'</b> '. |
$sender.'</b> '.$vgrlink.' ('. |
$sender.' '.$vgrlink.' ('. |
&Apache::lonlocal::locallocaltime($posttime).')</td>'; |
&Apache::lonlocal::locallocaltime($posttime).')</td>'; |
if ($$dischash{$toggkey}) { |
if ($$dischash{$toggkey}) { |
$$discussionitems[$idx].='<td align="right"> '. |
$$discussionitems[$idx].='<td align="right"> '. |
$ctlink.'</td>'; |
$ctlink.'</td>'; |
} |
} |
$$discussionitems[$idx].= '</tr></table><blockquote>'. |
$$discussionitems[$idx].= '</tr></table><blockquote>'. |
$message.'</blockquote></p>'; |
$message.'</blockquote>'; |
if ($contrib{$idx.':history'}) { |
if ($contrib{$idx.':history'}) { |
my @postversions = (); |
my @postversions = (); |
$$discussionitems[$idx] .= &mt('This post has been edited by the author.'); |
$$discussionitems[$idx] .= &mt('This post has been edited by the author.'); |
Line 1367 sub get_post_contents {
|
Line 1365 sub get_post_contents {
|
$$plainname, |
$$plainname, |
$$contrib{$idx.':sendername'}, |
$$contrib{$idx.':sendername'}, |
$$contrib{$idx.':senderdomain'}).' ('. |
$$contrib{$idx.':senderdomain'}).' ('. |
$$contrib{$idx.':sendername'}.' at '. |
$$contrib{$idx.':sendername'}.':'. |
$$contrib{$idx.':senderdomain'}.')'; |
$$contrib{$idx.':senderdomain'}.')'; |
my $attachmenturls = $$contrib{$idx.':attachmenturl'}; |
my $attachmenturls = $$contrib{$idx.':attachmenturl'}; |
my @postversions = (); |
my @postversions = (); |
Line 1395 sub get_post_contents {
|
Line 1393 sub get_post_contents {
|
my ($timesent,$attachmsg); |
my ($timesent,$attachmsg); |
my %currattach = (); |
my %currattach = (); |
$timesent = &Apache::lonlocal::locallocaltime($postversions[$i]); |
$timesent = &Apache::lonlocal::locallocaltime($postversions[$i]); |
&newline_to_br(\$messages->{$i}); |
unless (&contains_block_html($messages->{$i})) { |
|
&newline_to_br(\$messages->{$i}); |
|
} |
$$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i}); |
$$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i}); |
$$subjects{$i}=~s/\n/\<br \/\>/g; |
$$subjects{$i}=~s/\n/\<br \/\>/g; |
$$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i}); |
$$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i}); |
Line 1409 sub get_post_contents {
|
Line 1409 sub get_post_contents {
|
foreach my $key (sort(keys(%currattach))) { |
foreach my $key (sort(keys(%currattach))) { |
if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { |
if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { |
my $fname = $1.$3.'/'.$4; |
my $fname = $1.$3.'/'.$4; |
$$imsfiles{$idx}{$i} .= '<file href="'.$fname.'">'."\n"; |
$$imsfiles{$idx}{$i} .= '<file href="'.$fname.'" />'."\n"; |
$$attachtxt{$i}.= '<a href="'.$fname.'">'.$4.'</a><br />'; |
$$attachtxt{$i}.= '<a href="'.$fname.'">'.$4.'</a><br />'; |
} |
} |
} |
} |
Line 1663 END
|
Line 1663 END
|
</script> |
</script> |
END |
END |
|
|
|
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Resource Feedback and Discussion'}]; |
|
|
my %onload = ('onload' => 'window.focus();setposttype();'); |
my %onload = ('onload' => 'window.focus();setposttype();'); |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js, |
{'add_entries' => \%onload}); |
{'add_entries' => \%onload, |
|
'bread_crumbs' => $brcrum,}); |
|
|
if ($quote ne '') { |
if ($quote ne '') { |
&newline_to_br(\$quote); |
$quote = &HTML::Entities::decode($quote); |
|
unless (&contains_block_html($quote)) { |
|
&newline_to_br(\$quote); |
|
} |
$quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>'; |
$quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>'; |
} |
} |
|
|
Line 1701 $latexHelp
|
Line 1709 $latexHelp
|
<p> |
<p> |
$lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p> |
$lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p> |
<p> |
<p> |
<textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">$comment |
<textarea name="comment" id="comment" cols="60" rows="10">$comment |
</textarea></p> |
</textarea></p> |
<p> |
|
END |
END |
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) { |
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) { |
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
Line 1725 END
|
Line 1732 END
|
} |
} |
} else { |
} else { |
$r->print(<<END); |
$r->print(<<END); |
|
<p> |
$lt{'atta'} $attachmaxtext: <input type="file" name="attachment" /> |
$lt{'atta'} $attachmaxtext: <input type="file" name="attachment" /> |
</p> |
</p> |
END |
END |
Line 1738 END
|
Line 1746 END
|
$r->print(<<END); |
$r->print(<<END); |
<p> |
<p> |
<input type="hidden" name="sendit" value="1" /> |
<input type="hidden" name="sendit" value="1" /> |
<input type="button" value="$send" onClick='gosubmit();' /> |
<input type="button" value="$send" onclick='gosubmit();' /> |
</p> |
</p> |
</form> |
</form> |
END |
END |
Line 1945 END
|
Line 1953 END
|
$r->print(<<END); |
$r->print(<<END); |
<td>$lt{'disa'}</td> |
<td>$lt{'disa'}</td> |
<td>$lt{$discdisp}</td> |
<td>$lt{$discdisp}</td> |
<td><label><input type="checkbox" name="discdisp" onClick="discdispChk('0')" /> $lt{'chgt'} "$dispchangeA"</label> |
<td><label><input type="checkbox" name="discdisp" onclick="discdispChk('0')" /> $lt{'chgt'} "$dispchangeA"</label> |
<br /> |
<br /> |
<label><input type="checkbox" name="discdisp" onClick="discdispChk('1')" /> $lt{'chgt'} "$dispchangeB"</label> |
<label><input type="checkbox" name="discdisp" onclick="discdispChk('1')" /> $lt{'chgt'} "$dispchangeB"</label> |
</td> |
</td> |
END |
END |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
Line 1962 END
|
Line 1970 END
|
$r->print(<<END); |
$r->print(<<END); |
<td>$lt{'dotm'}</td> |
<td>$lt{'dotm'}</td> |
<td>$lt{$disctogg}</td> |
<td>$lt{$disctogg}</td> |
<td><label><input type="checkbox" name="disctogg" onClick="discdispChk('2')" />$lt{'chgt'} "$toggchange"</label></td> |
<td><label><input type="checkbox" name="disctogg" onclick="discdispChk('2')" />$lt{'chgt'} "$toggchange"</label></td> |
END |
END |
my $save = &mt('Save'); |
my $save = &mt('Save'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
Line 1976 END
|
Line 1984 END
|
<input type="hidden" name="$dispchgB" value="" /> |
<input type="hidden" name="$dispchgB" value="" /> |
<input type="hidden" name="$markchg" value="" /> |
<input type="hidden" name="$markchg" value="" /> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="button" name="sub" value="$save" onClick="javascript:setDisp()" /> |
<input type="button" name="sub" value="$save" onclick="javascript:setDisp()" /> |
END |
END |
if (exists($env{'form.group'})) { |
if (exists($env{'form.group'})) { |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
Line 2014 sub print_sortfilter_options {
|
Line 2022 sub print_sortfilter_options {
|
$ccrole = 'co'; |
$ccrole = 'co'; |
} |
} |
push(@courseroles,$ccrole); |
push(@courseroles,$ccrole); |
|
|
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section |
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section |
@sections = ('all',$env{'request.course.sec'}); |
@sections = ('all',$env{'request.course.sec'}); |
$numvisible = 2; |
$numvisible = 2; |
Line 2129 $start_page
|
Line 2137 $start_page
|
<br /><br /> |
<br /><br /> |
<table border="0"> |
<table border="0"> |
<tr> |
<tr> |
<td><b>$lt{'soor'}</b></td> |
<th>$lt{'soor'}</th> |
<td> </td> |
<th> </th> |
<td><b>$lt{'sprs'}</b></td> |
<th>$lt{'sprs'}</th> |
<td> </td> |
<th> </th> |
<td><b>$lt{'spur'}</b></td> |
<th>$lt{'spur'}</th> |
<td> </td> |
<th> </th> |
<td><b>$lt{'spse'}</b></td> |
<th>$lt{'spse'}</th> |
<td> </td> |
<th> </th> |
<td><b>$lt{'spgr'}</b></td> |
<th>$lt{'spgr'}</th> |
<td> </td> |
<th> </th> |
<td><b>$lt{'psub'}</b></td> |
<th>$lt{'psub'}</th> |
</tr> |
</tr> |
<tr> |
<tr> |
<td align="center" valign="top"> |
<td align="center" valign="top"> |
Line 2194 $start_page
|
Line 2202 $start_page
|
<br /> |
<br /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="applysort" value="$symb" /> |
<input type="hidden" name="applysort" value="$symb" /> |
<input type="button" name="sub" value="$lt{'stor'}" onClick="verifyFilter()" /> |
<input type="button" name="sub" value="$lt{'stor'}" onclick="verifyFilter()" /> |
END |
END |
if (exists($env{'form.group'})) { |
if (exists($env{'form.group'})) { |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
Line 2317 END
|
Line 2325 END
|
<br /> |
<br /> |
<input type="hidden" name="sortposts" value="$sortposts" /> |
<input type="hidden" name="sortposts" value="$sortposts" /> |
<input type="hidden" name="userpick" value="$symb" /> |
<input type="hidden" name="userpick" value="$symb" /> |
<input type="button" name="store" value="Display posts" onClick="javascript:document.pickpostersform.submit()" /> |
<input type="button" name="store" value="Display posts" onclick="javascript:document.pickpostersform.submit()" /> |
</form> |
</form> |
$end_page |
$end_page |
END |
END |
Line 2389 sub fail_redirect {
|
Line 2397 sub fail_redirect {
|
my ($r,$feedurl) = @_; |
my ($r,$feedurl) = @_; |
if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; |
if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'sorr' => 'Sorry, no recipients ...', |
'sorr' => 'Sorry, no recipients ...', |
); |
); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
$r->print(&Apache::loncommon::start_page('Feedback not sent',undef, |
$r->print(&Apache::loncommon::start_page('Feedback not sent',undef, |
Line 2420 sub redirect_back {
|
Line 2428 sub redirect_back {
|
if ($previous > 0) { |
if ($previous > 0) { |
$qrystr = 'previous='.$previous; |
$qrystr = 'previous='.$previous; |
if ($feedurl =~ /\?register=1/) { |
if ($feedurl =~ /\?register=1/) { |
$feedurl .= '&'.$qrystr; |
$feedurl .= '&'.$qrystr; |
} else { |
} else { |
$feedurl .= '?'.$qrystr; |
$feedurl .= '?'.$qrystr; |
} |
} |
Line 2429 sub redirect_back {
|
Line 2437 sub redirect_back {
|
if (defined($sort)) { |
if (defined($sort)) { |
my $sortqry = 'sortposts='.$sort; |
my $sortqry = 'sortposts='.$sort; |
if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) { |
if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) { |
$feedurl .= '&'.$sortqry; |
$feedurl .= '&'.$sortqry; |
} else { |
} else { |
$feedurl .= '?'.$sortqry; |
$feedurl .= '?'.$sortqry; |
} |
} |
$sorttag = '<input type="hidden" name="sortposts" value="'.$sort.'" />'; |
$sorttag = '<input type="hidden" name="sortposts" value="'.$sort.'" />'; |
if (defined($numpicks)) { |
if (defined($numpicks)) { |
my $userpickqry = 'totposters='.$numpicks; |
my $userpickqry = 'totposters='.$numpicks; |
$feedurl .= '&'.$userpickqry; |
$feedurl .= '&'.$userpickqry; |
$userpicktag = '<input type="hidden" name="totposters" value="'.$numpicks.'" />'; |
$userpicktag = '<input type="hidden" name="totposters" value="'.$numpicks.'" />'; |
} else { |
} else { |
if (ref($sectionpick) eq 'ARRAY') { |
if (ref($sectionpick) eq 'ARRAY') { |
$feedurl .= '§ionpick='; |
$feedurl .= '&sectionpick='; |
$sectag .= '<input type="hidden" name="sectionpick" value="'; |
$sectag .= '<input type="hidden" name="sectionpick" value="'; |
foreach my $sec (@{$sectionpick}) { |
foreach my $sec (@{$sectionpick}) { |
$feedurl .= $sec.','; |
$feedurl .= $sec.','; |
Line 2450 sub redirect_back {
|
Line 2458 sub redirect_back {
|
$sectag =~ s/,$//; |
$sectag =~ s/,$//; |
$sectag .= '" />'; |
$sectag .= '" />'; |
} else { |
} else { |
$feedurl .= '§ionpick='.$sectionpick; |
$feedurl .= '&sectionpick='.$sectionpick; |
$sectag = '<input type="hidden" name="sectionpick" value="'.$sectionpick.'" />'; |
$sectag = '<input type="hidden" name="sectionpick" value="'.$sectionpick.'" />'; |
} |
} |
if (ref($grouppick) eq 'ARRAY') { |
if (ref($grouppick) eq 'ARRAY') { |
$feedurl .= '&grouppick='; |
$feedurl .= '&grouppick='; |
$sectag .= '<input type="hidden" name="grouppick" value="'; |
$sectag .= '<input type="hidden" name="grouppick" value="'; |
foreach my $grp (@{$grouppick}) { |
foreach my $grp (@{$grouppick}) { |
$feedurl .= $grp.','; |
$feedurl .= $grp.','; |
Line 2464 sub redirect_back {
|
Line 2472 sub redirect_back {
|
$grptag =~ s/,$//; |
$grptag =~ s/,$//; |
$grptag .= '" />'; |
$grptag .= '" />'; |
} else { |
} else { |
$feedurl .= '&grouppick='.$grouppick; |
$feedurl .= '&grouppick='.$grouppick; |
$grptag = '<input type="hidden" name="grouppick" value="'.$grouppick.'" />'; |
$grptag = '<input type="hidden" name="grouppick" value="'.$grouppick.'" />'; |
} |
} |
if (ref($rolefilter) eq 'ARRAY') { |
if (ref($rolefilter) eq 'ARRAY') { |
$feedurl .= '&rolefilter='; |
$feedurl .= '&rolefilter='; |
$roletag .= '<input type="hidden" name="rolefilter" value="'; |
$roletag .= '<input type="hidden" name="rolefilter" value="'; |
foreach my $role (@{$rolefilter}) { |
foreach my $role (@{$rolefilter}) { |
$feedurl .= $role.','; |
$feedurl .= $role.','; |
Line 2478 sub redirect_back {
|
Line 2486 sub redirect_back {
|
$roletag =~ s/,$//; |
$roletag =~ s/,$//; |
$roletag .= '" />'; |
$roletag .= '" />'; |
} else { |
} else { |
$feedurl .= '&rolefilter='.$rolefilter; |
$feedurl .= '&rolefilter='.$rolefilter; |
$roletag = '<input type="hidden" name="rolefilter" value="'.$rolefilter.'" />'; |
$roletag = '<input type="hidden" name="rolefilter" value="'.$rolefilter.'" />'; |
} |
} |
$feedurl .= '&statusfilter='.$statusfilter; |
$feedurl .= '&statusfilter='.$statusfilter; |
$statustag ='<input type="hidden" name="statusfilter" value="'.$statusfilter.'" />'; |
$statustag ='<input type="hidden" name="statusfilter" value="'.$statusfilter.'" />'; |
} |
} |
} |
} |
Line 2502 sub redirect_back {
|
Line 2510 sub redirect_back {
|
&Apache::lonenc::check_encrypt(\$feedurl); |
&Apache::lonenc::check_encrypt(\$feedurl); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my %onload; |
my %onload; |
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; |
|
} |
|
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('Feedback sent',undef, |
&Apache::loncommon::start_page('Feedback sent',undef, |
{'redirect' => [0,$feedurl], |
{'redirect' => [0,$feedurl], |
Line 2536 ENDREDIR
|
Line 2540 ENDREDIR
|
|
|
sub no_redirect_back { |
sub no_redirect_back { |
my ($r,$feedurl) = @_; |
my ($r,$feedurl) = @_; |
my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); |
my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); |
|
|
my %onload; |
my %onload; |
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { self.window.close(); }"; |
|
} |
|
|
|
my %body_options = ('only_body' => 1, |
my %body_options = ('only_body' => 1, |
'bgcolor' => '#FFFFFF', |
'bgcolor' => '#FFFFFF', |
Line 2623 sub screen_header {
|
Line 2623 sub screen_header {
|
$env{'request.course.id'}. |
$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
$contribdisc. |
$contribdisc. |
'</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
'</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
$anoncontrib. |
$anoncontrib. |
' <i>('.$namevis.')</i></label> '. |
' <i>('.$namevis.')</i></label> '. |
|
|
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
if (!$blockblog) { |
if (!$blockblog) { |
Line 2641 sub screen_header {
|
Line 2640 sub screen_header {
|
.$msgoptions; |
.$msgoptions; |
} |
} |
if ($discussoptions) { |
if ($discussoptions) { |
$discussoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" />' |
$discussoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" alt="" />' |
.' '.&mt('Discussion Contributions').'</h2><p>'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'</p>' |
.' '.&mt('Discussion Contributions').'</h2><p>'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'</p>' |
.$discussoptions; |
.$discussoptions; |
} |
} |
Line 2673 sub clear_out_html {
|
Line 2672 sub clear_out_html {
|
($override)) { |
($override)) { |
# allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> |
# allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> |
# <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB> |
# <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB> |
# <SUP> |
# <SUP> <TABLE> <TR> <TD> <TH> <TBODY> |
%html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, |
%html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, |
BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1, |
BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1, |
M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, |
M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, |
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); |
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1, |
|
TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1); |
} |
} |
# Do the substitution of everything that is not explicitly allowed |
# Do the substitution of everything that is not explicitly allowed |
$message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ |
$message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ |
Line 2694 sub assemble_email {
|
Line 2694 sub assemble_email {
|
'orig' => 'Original screen output (if applicable)', |
'orig' => 'Original screen output (if applicable)', |
'corr' => 'Correct Answer(s) (if applicable)', |
'corr' => 'Correct Answer(s) (if applicable)', |
); |
); |
|
if (&Apache::loncommon::course_type() eq 'Community') { |
|
$lt{'prev'} = &mt('Previous attempts of member (if applicable)'); |
|
} |
my $email=<<"ENDEMAIL"; |
my $email=<<"ENDEMAIL"; |
$message |
$message |
ENDEMAIL |
ENDEMAIL |
Line 2943 sub show_preview {
|
Line 2946 sub show_preview {
|
sub contains_block_html { |
sub contains_block_html { |
my ($message)=@_; |
my ($message)=@_; |
return ($message =~ m{ |
return ($message =~ m{ |
<(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) |
<(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) |
\s* |
\s* |
(\w+\=['"]\w+['"])* |
(\w+\=['"]\w+['"])* |
\s* |
\s* |
( |
( |
\s*/>| |
\s*/>| |
>.*</\1\s*> |
>.*</\1\s*> |
)}xs |
)}xs |
); |
); |
} |
} |
|
|
|
sub tidy_html { |
|
my ($message)=@_; |
|
# my $tidy = HTML::Tidy::libXML->new(); |
|
# my $xhtml = $tidy->clean($message, 'utf-8', 1); |
|
# $xhtml =~ m/<body>(.*)<\/body>/is; |
|
# my $clean = $1; |
|
# # remove any empty block-level tags |
|
# $clean =~ s/<(table|p|div|tbody|blockquote|m|pre|algebra|center|ol|ul|span|h1|h2|h3|h4|h5|h6)\s*\/>//i; |
|
# $message=$clean; |
|
return $message; |
|
} |
|
|
sub newline_to_br { |
sub newline_to_br { |
my ($message)=@_; |
my ($message)=@_; |
my $newmessage; |
my $newmessage; |
Line 2986 sub generate_preview_button {
|
Line 3001 sub generate_preview_button {
|
<input type="hidden" name="subject" /> |
<input type="hidden" name="subject" /> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="comment" /> |
<input type="button" value="$pre" |
<input type="button" value="$pre" |
onClick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> |
onclick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> |
</form> |
</form> |
ENDPREVIEW |
ENDPREVIEW |
} |
} |
Line 3012 sub modify_attachments {
|
Line 3027 sub modify_attachments {
|
</script> |
</script> |
END |
END |
|
|
|
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Discussion Post Attachments'}]; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Discussion Post Attachments',$js); |
&Apache::loncommon::start_page('Discussion Post Attachments',$js, |
|
{'bread_crumbs' => $brcrum,}); |
|
|
my $orig_subject = &unescape($env{'form.subject'}); |
my $orig_subject = &unescape($env{'form.subject'}); |
my $subject=&clear_out_html($orig_subject,undef,1); |
my $subject=&clear_out_html($orig_subject,undef,1); |
Line 3041 $toolarge
|
Line 3060 $toolarge
|
<table class="LC_data_table"> |
<table class="LC_data_table"> |
<tr> |
<tr> |
<td colspan="2"> |
<td colspan="2"> |
<b>Subject:</b> $subject</b><br /><br /> |
<b>Subject:</b> <b>$subject</b><br /><br /> |
END |
END |
if ($idx) { |
if ($idx) { |
if ($attachmenturls) { |
if ($attachmenturls) { |
Line 3069 END
|
Line 3088 END
|
</td></tr> |
</td></tr> |
<tr> |
<tr> |
<td> |
<td> |
$lt{'adda'}</td><td><input type="file" name="addnewattach" /><input type="button" name="upload" value="Upload" onClick="this.form.submit()" /> |
$lt{'adda'}</td><td><input type="file" name="addnewattach" /><input type="button" name="upload" value="Upload" onclick="this.form.submit()" /> |
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
Line 3092 END
|
Line 3111 END
|
$r->print('<input type="hidden" name="deloldattach" value="'.$item.'" />'."\n"); |
$r->print('<input type="hidden" name="deloldattach" value="'.$item.'" />'."\n"); |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<input type="button" name="rtntoedit" value="$lt{'stch'}" onClick="setAction()" /> |
<input type="button" name="rtntoedit" value="$lt{'stch'}" onclick="setAction()" /> |
</form> |
</form> |
$end_page |
$end_page |
END |
END |
Line 3139 sub generate_attachments_button {
|
Line 3158 sub generate_attachments_button {
|
<br /> |
<br /> |
<form name="attachment" action="/adm/feedback?attach=$ressymb" method="post"> |
<form name="attachment" action="/adm/feedback?attach=$ressymb" method="post"> |
$lt{'clic'}: <input type="button" value="$att" |
$lt{'clic'}: <input type="button" value="$att" |
onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value); |
onclick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value); |
END |
END |
if (!$blockblog) { |
if (!$blockblog) { |
$response .= 'setblogvalue();'; |
$response .= 'setblogvalue();'; |
Line 3355 sub sort_filter_names {
|
Line 3374 sub sort_filter_names {
|
} |
} |
if (ref($status_types) eq 'HASH') { |
if (ref($status_types) eq 'HASH') { |
%{$status_types} = ( |
%{$status_types} = ( |
all => 'Roles of any status', |
all => 'Roles of any status', |
Active => 'Only active roles', |
Active => 'Only active roles', |
Expired => 'Only past roles', |
Expired => 'Only past roles', |
Future => 'Only future roles', |
Future => 'Only future roles', |
); |
); |
} |
} |
} |
} |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
if ($r->header_only) { |
if ($r->header_only) { |
Line 3422 sub handler {
|
Line 3441 sub handler {
|
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
|
$r->print(&Apache::loncommon::start_page('Discussion Post Versions')); |
# Breadcrumbs |
|
my $brcrum = [{'href' => '', |
|
'text' => 'Discussion Post Versions'}]; |
|
|
|
$r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef, |
|
{'bread_crumbs' => $brcrum,}) |
|
); |
|
|
my $crs='/'.$env{'request.course.id'}; |
my $crs='/'.$env{'request.course.id'}; |
if ($env{'request.course.sec'}) { |
if ($env{'request.course.sec'}) { |
Line 3526 sub handler {
|
Line 3551 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my %onload; |
my %onload; |
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; |
|
} |
|
|
|
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('New posts marked as read',undef, |
&Apache::loncommon::start_page('New posts marked as read',undef, |
Line 4128 None
|
Line 4149 None
|
|
|
=item newline_to_br() |
=item newline_to_br() |
|
|
|
=item tidy_html() |
|
|
=item generate_preview_button() |
=item generate_preview_button() |
|
|
=item modify_attachments() |
=item modify_attachments() |