version 1.172, 2005/11/09 11:41:02
|
version 1.173, 2005/11/10 11:31:04
|
Line 237 sub list_discussion {
|
Line 237 sub list_discussion {
|
my %notshown = (); |
my %notshown = (); |
my %newitem = (); |
my %newitem = (); |
my $maxdepth=0; |
my $maxdepth=0; |
|
my %anonhash=(); |
|
my $anoncnt=0; |
my $target=''; |
my $target=''; |
unless ($env{'browser.interface'} eq 'textual' || |
unless ($env{'browser.interface'} eq 'textual' || |
$env{'environment.remote'} eq 'off' ) { |
$env{'environment.remote'} eq 'off' ) { |
Line 248 sub list_discussion {
|
Line 249 sub list_discussion {
|
$discinfo{$visitkey} = $visit; |
$discinfo{$visitkey} = $visit; |
|
|
&Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'}); |
&Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'}); |
&build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget); |
&build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt); |
|
|
my $discussion=''; |
my $discussion=''; |
my $manifestfile; |
my $manifestfile; |
Line 392 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 393 imscp_v1p1.xsd http://www.imsglobal.org/
|
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'. |
$discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'. |
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>'; |
'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>'; |
|
my $escsymb=&Apache::lonnet::escape($ressymb); |
if ($visible>2) { |
if ($visible>2) { |
$discussion.='<td align="left">'. |
$discussion.='<td align="left">'. |
'<a href="/adm/feedback?cmd=threadedon&symb='.$ressymb; |
'<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .='">'.&mt('Threaded View').'</a> '. |
$discussion .='">'.&mt('Threaded View').'</a> '. |
'<a href="/adm/feedback?cmd=threadedoff&symb='.$ressymb; |
'<a href="/adm/feedback?cmd=threadedoff&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .='">'.&mt('Chronological View').'</a> |
$discussion .='">'.&mt('Chronological View').'</a> |
<a href= "/adm/feedback?cmd=sortfilter&symb='.$ressymb; |
<a href= "/adm/feedback?cmd=sortfilter&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
Line 412 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 414 imscp_v1p1.xsd http://www.imsglobal.org/
|
} else { |
} else { |
$discussion .= '<td align="left">'; |
$discussion .= '<td align="left">'; |
} |
} |
$discussion .='<a href= "/adm/feedback?export='.$ressymb; |
$discussion .='<a href= "/adm/feedback?export='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
if ($newpostsflag) { |
if ($newpostsflag) { |
if (!$markondisp) { |
if (!$markondisp) { |
$discussion .='<td align="right"><a href="/adm/feedback?markread=1&symb='.$ressymb.'">'.&mt('Mark NEW posts no longer new').'</a> '; |
$discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions">'. |
|
&mt('Preferences on what is marked as NEW'). |
|
'</a><br /><a href="/adm/feedback?markread=1&symb='.$escsymb.'">'.&mt('Mark NEW posts no longer new').'</a>'; |
} else { |
} else { |
$discussion .= '<td> </td>'; |
$discussion .= '<td> </td>'; |
} |
} |
Line 432 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 436 imscp_v1p1.xsd http://www.imsglobal.org/
|
if ($numhidden > 0) { |
if ($numhidden > 0) { |
my $colspan = $maxdepth+1; |
my $colspan = $maxdepth+1; |
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'. |
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'. |
'<a href="/adm/feedback?allposts=1&symb='.$ressymb; |
'<a href="/adm/feedback?allposts=1&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
Line 745 ENDDISCUSS
|
Line 749 ENDDISCUSS
|
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
if ($outputtarget ne 'tex') { |
if ($outputtarget ne 'tex') { |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
$ressymb.':::" '.$target.'>'. |
&Apache::lonnet::escape($ressymb).':::" '.$target.'>'. |
'<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'. |
'<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'. |
&mt('Post Discussion').'</a></td></tr></table>'; |
&mt('Post Discussion').'</a></td></tr></table>'; |
} |
} |
Line 755 ENDDISCUSS
|
Line 759 ENDDISCUSS
|
} |
} |
|
|
sub build_posting_display { |
sub build_posting_display { |
my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget) = @_; |
my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt) = @_; |
my @original=(); |
my @original=(); |
my @index=(); |
my @index=(); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
|
my $escsymb=&Apache::lonnet::escape($ressymb); |
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'}, |
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
Line 822 sub build_posting_display {
|
Line 827 sub build_posting_display {
|
my %allattachments = (); |
my %allattachments = (); |
my ($screenname,$plainname); |
my ($screenname,$plainname); |
my $sender = &mt('Anonymous'); |
my $sender = &mt('Anonymous'); |
|
# Anonymous users getting number within a discussion |
|
# Since idx is in static order, this should give the same sequence every time. |
|
my $key=$contrib{$idx.':sendername'}.'@'.$contrib{$idx.':senderdomain'}; |
|
unless ($$anonhash{$key}) { |
|
$anoncnt++; |
|
$$anonhash{$key}=&mt('Anonymous').' '.$anoncnt; |
|
} |
my ($message,$subject,$vgrlink,$ctlink); |
my ($message,$subject,$vgrlink,$ctlink); |
&get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,$numoldver); |
&get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,$numoldver); |
|
|
Line 860 sub build_posting_display {
|
Line 872 sub build_posting_display {
|
$contrib{$idx.':sendername'}.' at '. |
$contrib{$idx.':sendername'}.' at '. |
$contrib{$idx.':senderdomain'}.')'; |
$contrib{$idx.':senderdomain'}.')'; |
if ($contrib{$idx.':anonymous'}) { |
if ($contrib{$idx.':anonymous'}) { |
$sender.=' <font color="red"><b>['.&mt('anonymous').']</b></font> '. |
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$screenname; |
$screenname; |
} |
} |
|
|
Line 896 sub build_posting_display {
|
Line 908 sub build_posting_display {
|
if ($env{'course.'.$env{'request.course.id'}.'.allow_discussion_post_editing'} =~ m/yes/i) { |
if ($env{'course.'.$env{'request.course.id'}.'.allow_discussion_post_editing'} =~ m/yes/i) { |
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) { |
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) { |
$sender.=' <a href="/adm/feedback?editdisc='. |
$sender.=' <a href="/adm/feedback?editdisc='. |
$ressymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
unless ($seeid) { |
unless ($seeid) { |
$sender.=" <a href=\"javascript:studentdelete('$ressymb','$idx','$newpostsflag','$prevread')"; |
$sender.=" <a href=\"javascript:studentdelete('$escsymb','$idx','$newpostsflag','$prevread')"; |
$sender .= '">'.&mt('Delete').'</a>'; |
$sender .= '">'.&mt('Delete').'</a>'; |
} |
} |
} |
} |
Line 911 sub build_posting_display {
|
Line 923 sub build_posting_display {
|
if ($hidden) { |
if ($hidden) { |
unless ($studenthidden) { |
unless ($studenthidden) { |
$sender.=' <a href="/adm/feedback?unhide='. |
$sender.=' <a href="/adm/feedback?unhide='. |
$ressymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
Line 919 sub build_posting_display {
|
Line 931 sub build_posting_display {
|
} |
} |
} else { |
} else { |
$sender.=' <a href="/adm/feedback?hide='. |
$sender.=' <a href="/adm/feedback?hide='. |
$ressymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= '">'.&mt('Hide').'</a>'; |
$sender .= '">'.&mt('Hide').'</a>'; |
} |
} |
$sender.=' <a href="/adm/feedback?deldisc='. |
$sender.=' <a href="/adm/feedback?deldisc='. |
$ressymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
Line 935 sub build_posting_display {
|
Line 947 sub build_posting_display {
|
} else { |
} else { |
if ($screenname) { |
if ($screenname) { |
$sender='<i>'.$screenname.'</i>'; |
$sender='<i>'.$screenname.'</i>'; |
|
} else { |
|
$sender='<i>'.$$anonhash{$key}.'</i>'; |
} |
} |
# 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'})) { |
Line 960 sub build_posting_display {
|
Line 974 sub build_posting_display {
|
$env{'request.course.id'}. |
$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
$sender.=' <a href="/adm/feedback?replydisc='. |
$sender.=' <a href="/adm/feedback?replydisc='. |
$ressymb.':::'.$idx; |
$escsymb.':::'.$idx; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
Line 1076 sub build_posting_display {
|
Line 1090 sub build_posting_display {
|
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.'); |
if ($seeid) { |
if ($seeid) { |
$$discussionitems[$idx] .= ' <a href="/adm/feedback?allversions='.$ressymb.':::'.$idx.'">'.&mt('Display all versions').'</a>'; |
$$discussionitems[$idx] .= ' <a href="/adm/feedback?allversions='.$escsymb.':::'.$idx.'">'.&mt('Display all versions').'</a>'; |
} |
} |
$$discussionitems[$idx].='<br/>'.&mt('Earlier version(s) were posted on: '); |
$$discussionitems[$idx].='<br/>'.&mt('Earlier version(s) were posted on: '); |
if ($contrib{$idx.':history'} =~ m/:/) { |
if ($contrib{$idx.':history'} =~ m/:/) { |
Line 2294 sub screen_header {
|
Line 2308 sub screen_header {
|
&mt('Contribution to course discussion of resource'); |
&mt('Contribution to course discussion of resource'); |
$discussoptions.='</label><br /><label><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
$discussoptions.='</label><br /><label><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
&mt('Anonymous contribution to course discussion of resource'). |
&mt('Anonymous contribution to course discussion of resource'). |
' <i>('.&mt('name only visible to course faculty').')</i></label>'; |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
|
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
} |
} |
} |
} |
if ($msgoptions) { $msgoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" />'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($msgoptions) { $msgoptions='<h2><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" />'.&mt('Sending Messages').'</h2>'.$msgoptions; } |