version 1.208, 2006/07/17 23:02:33
|
version 1.211, 2006/07/18 17:42:15
|
Line 138 sub list_discussion {
|
Line 138 sub list_discussion {
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous','sortposts','rolefilter','statusfilter','sectionpick','grouppick','totposters']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous','sortposts','rolefilter','statusfilter','sectionpick','grouppick','totposters']); |
my $sortposts = $env{'form.sortposts'}; |
my $sortposts = $env{'form.sortposts'}; |
my $statusfilter = $env{'form.statusfilter'}; |
my $statusfilter = $env{'form.statusfilter'}; |
my @sectionpick = (); |
my @sectionpick = split(/,/,$env{'form.sectionpick'}); |
if ($env{'form.sectionpick'} =~ /,/) { |
my @grouppick = split(/,/,$env{'form.grouppick'}); |
@sectionpick = split/,/,$env{'form.sectionpick'}; |
my @rolefilter = split(/,/,$env{'form.rolefilter'}); |
} else { |
|
$sectionpick[0] = $env{'form.sectionpick'}; |
|
} |
|
my @grouppick = (); |
|
if ($env{'form.grouppick'} =~ /,/) { |
|
@grouppick = split/,/,$env{'form.grouppick'}; |
|
} else { |
|
$grouppick[0] = $env{'form.grouppick'}; |
|
} |
|
|
|
my @rolefilter = (); |
|
if ($env{'form.rolefilter'} =~ /,/) { |
|
@rolefilter = split/,/,$env{'form.rolefilter'}; |
|
} else { |
|
$rolefilter[0] = $env{'form.rolefilter'}; |
|
} |
|
my $totposters = $env{'form.totposters'}; |
my $totposters = $env{'form.totposters'}; |
$previous = $env{'form.previous'}; |
$previous = $env{'form.previous'}; |
if ($previous > 0) { |
if ($previous > 0) { |
Line 286 sub list_discussion {
|
Line 271 sub list_discussion {
|
my $imsresources; |
my $imsresources; |
my $copyresult; |
my $copyresult; |
|
|
my $grp_arg; |
|
if ($group ne '') { |
|
$grp_arg = &grp_args($group); |
|
} |
|
|
|
my $function = &Apache::loncommon::get_users_function(); |
my $function = &Apache::loncommon::get_users_function(); |
my $color = &Apache::loncommon::designparm($function.'.tabbg', |
my $color = &Apache::loncommon::designparm($function.'.tabbg', |
$env{'user.domain'}); |
$env{'user.domain'}); |
Line 355 sub list_discussion {
|
Line 335 sub list_discussion {
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$chglink .= '&previous='.$prevread; |
$chglink .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$chglink.=&group_args($group); |
$chglink.='&'.$grp_arg; |
|
} |
|
|
|
if ($visible) { |
if ($visible) { |
# Print the discusssion |
# Print the discusssion |
Line 436 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 414 imscp_v1p1.xsd http://www.imsglobal.org/
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$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; |
} |
} |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$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; |
} |
} |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$discussion .='">'.&mt('Sorting/Filtering options').'</a>  '; |
$discussion .='">'.&mt('Sorting/Filtering options').'</a>  '; |
} else { |
} else { |
$discussion .= '<td align="left">'; |
$discussion .= '<td align="left">'; |
Line 463 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 435 imscp_v1p1.xsd http://www.imsglobal.org/
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$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/preferences?action=changediscussions'; |
$discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions'; |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$discussion .= '">'. |
$discussion .= '">'. |
&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; |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>'; |
$discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>'; |
} else { |
} else { |
$discussion .= '<td> </td>'; |
$discussion .= '<td> </td>'; |
Line 496 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 462 imscp_v1p1.xsd http://www.imsglobal.org/
|
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$discussion .= &group_args($group); |
$discussion .= '&'.$grp_arg; |
|
} |
|
$discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '. |
$discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '. |
$numhidden.' '; |
$numhidden.' '; |
if ($showunmark) { |
if ($showunmark) { |
Line 767 END
|
Line 731 END
|
if (($group ne '') && ($mode eq 'board')) { |
if (($group ne '') && ($mode eq 'board')) { |
if (&check_group_priv($group,'pgd') eq 'ok') { |
if (&check_group_priv($group,'pgd') eq 'ok') { |
$discussion .= |
$discussion .= |
&postingform_display($mode,$ressymb,$now,$subject,$comment, |
&postingform_display($mode,$ressymb,$now,$subject, |
$outputtarget,$attachnum,$currnewattach, |
$comment,$outputtarget,$attachnum, |
$currdelold,$group); |
$currnewattach,$currdelold, |
|
$group); |
} |
} |
} else { |
} else { |
$discussion.= |
$discussion.= |
&postingform_display($mode,$ressymb,$now,$subject,$comment, |
&postingform_display($mode,$ressymb,$now,$subject, |
$outputtarget,$attachnum,$currnewattach, |
$comment,$outputtarget,$attachnum, |
$currdelold); |
$currnewattach,$currdelold); |
} |
} |
} |
} |
} else { |
} else { |
Line 858 sub build_posting_display {
|
Line 823 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,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_; |
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,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_; |
my @original=(); |
my @original=(); |
my @index=(); |
my @index=(); |
my $skipgrpcheck = 0; |
my $skip_group_check = 0; |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $escsymb=&escape($ressymb); |
my $escsymb=&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'}); |
|
|
if ((@{$grouppick} == 0) || (grep/^all$/,@{$grouppick})) { |
if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) { |
$skipgrpcheck = 1; |
$skip_group_check = 1; |
} |
} |
if ($contrib{'version'}) { |
if ($contrib{'version'}) { |
my $oldest = $contrib{'1:timestamp'}; |
my $oldest = $contrib{'1:timestamp'}; |
Line 1013 sub build_posting_display {
|
Line 978 sub build_posting_display {
|
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$sender .= &group_args($group); |
$sender.='&'.&grp_args($group); |
|
} |
|
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Edit').'</a>'; |
|
|
unless ($seeid) { |
unless ($seeid) { |
Line 1040 sub build_posting_display {
|
Line 1003 sub build_posting_display {
|
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$sender .= &group_args($group); |
$sender.='&'.&grp_args($group); |
|
} |
|
$sender .= '">'.&mt('Hide').'</a>'; |
$sender .= '">'.&mt('Hide').'</a>'; |
} |
} |
$sender.=' <a href="/adm/feedback?deldisc='. |
$sender.=' <a href="/adm/feedback?deldisc='. |
Line 1050 sub build_posting_display {
|
Line 1011 sub build_posting_display {
|
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
if ($group ne '') { |
$sender .= &group_args($group); |
$sender .= '&'.&grp_args($group); |
|
} |
|
$sender .= '">'.&mt('Delete').'</a>'; |
$sender .= '">'.&mt('Delete').'</a>'; |
} |
} |
} else { |
} else { |
Line 1088 sub build_posting_display {
|
Line 1047 sub build_posting_display {
|
if ($$newpostsflag) { |
if ($$newpostsflag) { |
$sender .= '&previous='.$prevread; |
$sender .= '&previous='.$prevread; |
} |
} |
$sender .= '&'.&grp_args($group); |
$sender .= &group_args($group); |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
$sender .= '" '.$target.'>'.&mt('Reply').'</a>'; |
} elsif (&Apache::lonnet::allowed('pch', |
} elsif (&Apache::lonnet::allowed('pch', |
$env{'request.course.id'}. |
$env{'request.course.id'}. |
Line 1182 sub build_posting_display {
|
Line 1141 sub build_posting_display {
|
} |
} |
} |
} |
} |
} |
if ($$shown{$idx} && !$skipgrpcheck) { |
if ($$shown{$idx} && !$skip_group_check) { |
my $showflag = 0; |
my $showflag = 0; |
if (ref($$classgroups{$poster}{active}) eq 'HASH') { |
if (ref($$classgroups{$poster}{active}) eq 'HASH') { |
foreach my $grp (@{$grouppick}) { |
foreach my $grp (@{$grouppick}) { |
Line 1230 sub build_posting_display {
|
Line 1189 sub build_posting_display {
|
$$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='.$escsymb.':::'.$idx; |
$$discussionitems[$idx] .= ' <a href="/adm/feedback?allversions='.$escsymb.':::'.$idx; |
if ($group ne '') { |
$$discussionitems[$idx] .= &group_args($group); |
$$discussionitems[$idx] .= '&'.&grp_args($group); |
|
} |
|
$$discussionitems[$idx] .= '">'.&mt('Display all versions').'</a>'; |
$$discussionitems[$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: '); |
Line 3808 sub check_group_priv {
|
Line 3765 sub check_group_priv {
|
return ''; |
return ''; |
} |
} |
|
|
sub grp_args { |
sub group_args { |
my ($group) = @_; |
my ($group) = @_; |
my $extra_args = 'group='.$group; |
if ($group eq '') { return ''; } |
|
my $extra_args = '&group='.$group; |
if (exists($env{'form.ref'})) { |
if (exists($env{'form.ref'})) { |
$extra_args .= '&ref='.$env{'form.ref'}; |
$extra_args .= '&ref='.$env{'form.ref'}; |
} |
} |
return $extra_args; |
return $extra_args; |
} |
} |