".
+ "
".
$message.
'
';
if ($canvote) {
+ my $ownpost;
+ if (($uname eq $env{'user.name'}) &&
+ ($udom eq $env{'user.domain'})) {
+ $ownpost = 1;
+ }
# Put in the like and unlike buttons
- if (($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) {
- my $novote = &mt('No voting for your own posts');
+ if ($ownpost || (($hiddens{$idx}) && ($seehidden))) {
+ my $novote;
+ if ($ownpost) {
+ $novote = &mt('No voting for your own posts.');
+ } else {
+ $novote = &mt('No voting for hidden posts.');
+ }
$$discussionitems[$idx].=
'
'.
' '.
'';
+
} else {
if ($userlikes{$idx}) {
$$discussionitems[$idx].='
';
@@ -1456,7 +1526,7 @@ sub build_posting_display {
if ($contrib{$idx.':history'}) {
my @postversions = ();
$$discussionitems[$idx] .= ' '.&mt('This post has been edited by the author.');
- if ($seeid) {
+ if ($seehidden) {
$$discussionitems[$idx] .= ' '.
&discussion_link($symb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group));
}
@@ -1542,13 +1612,13 @@ sub filter_regexp {
sub get_post_contents {
- my ($contrib,$idx,$seeid,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$showaboutme,$numver) = @_;
+ my ($contrib,$idx,$seeid,$seehidden,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$showaboutme,$numver) = @_;
my $discussion = '';
my $start=$numver;
my $end=$numver + 1;
%{$$imsfiles{$idx}}=();
if ($type eq 'allversions') {
- unless($seeid) {
+ unless($seehidden) {
$discussion=&mt('You do not have privileges to view all versions of posts.').' '.&mt('Please select a different role.');
return $discussion;
}
@@ -1763,6 +1833,7 @@ END
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
unless (($contrib{'hidden'}=~/\.$idx\./) || ($contrib{'deleted'}=~/\.$idx\./)) {
+ my $numoldver = 0;
if ($contrib{$idx.':history'}) {
if ($contrib{$idx.':history'} =~ /:/) {
my @oldversions = split(/:/,$contrib{$idx.':history'});
@@ -1771,36 +1842,25 @@ END
$numoldver = 1;
}
}
- if ($env{'form.replydisc'}) {
- if ($contrib{$idx.':history'}) {
- if ($contrib{$idx.':history'} =~ /:/) {
- my @oldversions = split(/:/,$contrib{$idx.':history'});
- $numoldver = @oldversions;
- } else {
- $numoldver = 1;
- }
+ if ($idx > 0) {
+ my (%msgversions,%subversions,$htmldecode);
+ $htmldecode = 0;
+ if ($env{'form.replydisc'}) {
+ $htmldecode = 1;
}
- if ($idx > 0) {
- my %msgversions = ();
- &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
+ &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
+ &get_post_versions(\%subversions,$contrib{$idx.':subject'},$htmldecode,
+ $numoldver);
+ $subject = $subversions{$numoldver};
+ if ($env{'form.replydisc'}) {
$quote = $msgversions{$numoldver};
- }
- if ($idx > 0) {
- my %subversions = ();
- &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver);
- $subject = &mt('Re: ').$subversions{$numoldver};
- }
- $subject = &HTML::Entities::encode($subject,'<>&"');
- } else {
- $attachmenturls = $contrib{$idx.':attachmenturl'};
- if ($idx > 0) {
- my %msgversions = ();
- &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
+ $subject = &HTML::Entities::encode(&mt('Re: ').$subject,'<>&"');
+ } else {
$comment = $msgversions{$numoldver};
- my %subversions = ();
- &get_post_versions(\%subversions,$contrib{$idx.':subject'},0,$numoldver);
- $subject = $subversions{$numoldver};
}
+ }
+ if ($env{'form.editdisc'}) {
+ $attachmenturls = $contrib{$idx.':attachmenturl'};
if (defined($contrib{$idx.':replyto'})) {
$parentmsg = $contrib{$idx.':replyto'};
}
@@ -1892,7 +1952,7 @@ END
my %onload = ('onload' => 'window.focus();setposttype();');
my %parms=('add_entries' => \%onload);
- if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum }
+ if ($env{'form.modal'} ne 'yes') { $parms{'bread_crumbs'} = $brcrum; }
my $start_page=
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js,\%parms);
@@ -1901,7 +1961,11 @@ END
unless (&contains_block_html($quote)) {
&newline_to_br(\$quote);
}
- $quote='
'.&Apache::lontexconvert::msgtexconverted($quote).'
';
+ $quote=&Apache::lonhtmlcommon::start_pick_box().
+ &Apache::lonhtmlcommon::row_title(&mt('Quote')).
+ &Apache::lontexconvert::msgtexconverted($quote).
+ &Apache::lonhtmlcommon::row_closure(1).
+ &Apache::lonhtmlcommon::end_pick_box();
}
my $header='';
unless ($env{'form.modal'}) {
@@ -1929,24 +1993,27 @@ END
}
$r->print(<
+END
+$r->print(&Apache::lonhtmlcommon::start_pick_box());
+$r->print(<
$textareaheader
-
$latexHelp
END
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Subject')));
$r->print('
');
$r->print(&Apache::lonhtmlcommon::row_closure());
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Message')));
- $r->print('