'.
'';
my $escsymb=&escape($ressymb);
- if ($visible) {
+ if ($visible>2) {
$discussion .= '
@@ -881,7 +855,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '\n";
- $postingform .= &generate_attachments_button('',$attachnum,$ressymb,
- $now,$currnewattach,
- $currdelold,'',$mode,
- $blockblog);
- if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
- $newattachmsg = ' '.$lt{'newa'}.' ';
- if (@{$currnewattach} > 1) {
- $newattachmsg .= '';
- foreach my $item (@{$currnewattach}) {
- $item =~ m#.*/([^/]+)$#;
- $newattachmsg .= '- '.$1.'
'."\n";
+ if ($outputtarget ne 'tex') {
+ $postingform .= &generate_attachments_button('',$attachnum,$ressymb,
+ $now,$currnewattach,
+ $currdelold,'',$mode,
+ $blockblog);
+ if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
+ $newattachmsg = ' '.$lt{'newa'}.' ';
+ if (@{$currnewattach} > 1) {
+ $newattachmsg .= '';
+ foreach my $item (@{$currnewattach}) {
+ $item =~ m#.*/([^/]+)$#;
+ $newattachmsg .= '- '.$1.'
'."\n";
+ }
+ $newattachmsg .= ' '."\n";
+ } else {
+ $$currnewattach[0] =~ m#.*/([^/]+)$#;
+ $newattachmsg .= ''.$1.' '."\n";
}
- $newattachmsg .= ' '."\n";
- } else {
- $$currnewattach[0] =~ m#.*/([^/]+)$#;
- $newattachmsg .= ''.$1.' '."\n";
}
+ $postingform .= $newattachmsg;
+ $postingform .= &generate_preview_button();
}
- $postingform .= $newattachmsg;
- $postingform .= &generate_preview_button();
return $postingform;
}
@@ -943,19 +919,6 @@ sub build_posting_display {
if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) {
$skip_group_check = 1;
}
- my (%deletions,%hiddens);
- if ($contrib{'deleted'}) {
- my $deleted = $contrib{'deleted'};
- $deleted =~ s/^\.//;
- $deleted =~ s/\.$//;
- %deletions = map { $_ => 1 } (split(/\.\./,$deleted));
- }
- if ($contrib{'hidden'}) {
- my $hidden = $contrib{'hidden'};
- $hidden =~ s/^\.//;
- $hidden =~ s/\.$//;
- %hiddens = map { $_ => 1 } (split(/\.\./,$hidden));
- }
if ($contrib{'version'}) {
my $oldest = $contrib{'1:timestamp'};
if ($prevread eq '0') {
@@ -969,13 +932,13 @@ sub build_posting_display {
}
for (my $id=1;$id<=$contrib{'version'};$id++) {
my $idx=$id;
- next if ($contrib{$idx.':deleted'});
- next if ($contrib{$idx.':hidden'});
my $posttime = $contrib{$idx.':timestamp'};
if ($prevread <= $posttime) {
$$newpostsflag = 1;
}
+ my $hidden=($contrib{'hidden'}=~/\.$idx\./);
my $studenthidden=($contrib{'studenthidden'}=~/\.$idx\./);
+ my $deleted=($contrib{'deleted'}=~/\.$idx\./);
my $origindex='0.';
my $numoldver=0;
if ($contrib{$idx.':replyto'}) {
@@ -999,7 +962,7 @@ sub build_posting_display {
} else {
$$replies[$$depth[$idx]]=1;
}
- unless ((($hiddens{$idx}) && (!$seeid)) || ($deletions{$idx})) {
+ unless ((($hidden) && (!$seeid)) || ($deleted)) {
$$visible++;
if ($contrib{$idx.':history'}) {
if ($contrib{$idx.':history'} =~ /:/) {
@@ -1014,7 +977,7 @@ sub build_posting_display {
my %subjects = ();
my %attachtxt = ();
my %allattachments = ();
- my ($screenname,$plainname,$showaboutme);
+ my ($screenname,$plainname);
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.
@@ -1024,7 +987,7 @@ sub build_posting_display {
$$anonhash{$key}=&mt('Anonymous').' '.$anoncnt;
}
my ($message,$subject,$vgrlink,$ctlink);
- &get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,\$showaboutme,$numoldver);
+ &get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,$numoldver);
# Set up for sorting by subject
@@ -1033,7 +996,7 @@ sub build_posting_display {
$message.=$attachtxt{$numoldver};
$subject=$subjects{$numoldver};
if ($message) {
- if ($hiddens{$idx}) {
+ if ($hidden) {
$message=''.$message.'';
if ($studenthidden) {
$message .='
Deleted by poster (student).';
@@ -1054,18 +1017,12 @@ sub build_posting_display {
}
}
if (!$contrib{$idx.':anonymous'} || $see_anonymous) {
- if ($showaboutme) {
- $sender = &Apache::loncommon::aboutmewrapper(
- $plainname,
- $contrib{$idx.':sendername'},
- $contrib{$idx.':senderdomain'});
- } else {
- $sender = $plainname;
- }
- if ($see_anonymous) {
- $sender .= ' ('.$contrib{$idx.':sendername'}.':'.
- $contrib{$idx.':senderdomain'}.')';
- }
+ $sender=&Apache::loncommon::aboutmewrapper(
+ $plainname,
+ $contrib{$idx.':sendername'},
+ $contrib{$idx.':senderdomain'}).' ('.
+ $contrib{$idx.':sendername'}.':'.
+ $contrib{$idx.':senderdomain'}.')';
$sender = ''.$sender.'';
if ($contrib{$idx.':anonymous'}) {
$sender.=' ['.$$anonhash{$key}.'] '.
@@ -1103,48 +1060,46 @@ sub build_posting_display {
} else {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
- if ($outputtarget ne 'tex') {
- if (&editing_allowed($escsymb.':::'.$idx,$group)) {
- if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
- $sender.=' '.&mt('Edit').'';
+ if (&editing_allowed($escsymb.':::'.$idx,$group)) {
+ if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
+ $sender.=' '.&mt('Edit').'';
- unless ($seeid) {
- my $grpargs = &group_args($group);
- $sender.=" ';
- }
+ unless ($seeid) {
+ my $grpargs = &group_args($group);
+ $sender.=" ';
}
}
- if ($seeid) {
- if ($hiddens{$idx}) {
- unless ($studenthidden) {
- $sender.=' '.&mt('Make Visible').'';
- }
- } else {
- $sender.=' ';
- }
- my $grpargs = &group_args($group);
- $sender.=
- " ";
- $sender .= &mt('Delete').'';
- }
+ $sender .= '">'.&mt('Make Visible').'';
+ }
+ } else {
+ $sender.=' '.&mt('Hide').'';
+ }
+ my $grpargs = &group_args($group);
+ $sender.=
+ " ";
+ $sender .= &mt('Delete').'';
}
} else {
if ($screenname) {
@@ -1172,38 +1127,36 @@ sub build_posting_display {
@{$$namesort{'__anon'}{'__anon'}} = ("$idx");
}
}
- if ($outputtarget ne 'tex') {
- if (&discussion_open($status)) {
- if (($group ne '') &&
- (&check_group_priv($group,'pgd') eq 'ok')) {
- $sender.=' '.&mt('Reply').'';
- } elsif (&Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.
- $env{'request.course.sec'}:''))) {
- $sender.=' '.&mt('Reply').'';
+ if (&discussion_open($status)) {
+ if (($group ne '') &&
+ (&check_group_priv($group,'pgd') eq 'ok')) {
+ $sender.=' '.&mt('Reply').'';
+ } elsif (&Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.
+ $env{'request.course.sec'}:''))) {
+ $sender.=' '.&mt('Reply').'';
}
- if ($viewgrades) {
+ }
+ if ($viewgrades) {
$vgrlink=&Apache::loncommon::submlink(&mt('Submissions'),
- $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
- }
- if ($$dischash{$readkey}=~/\.$idx\./) {
- $ctlink = '';
- } else {
- $ctlink = '';
- }
+ $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
+ }
+ if ($$dischash{$readkey}=~/\.$idx\./) {
+ $ctlink = '';
+ } else {
+ $ctlink = '';
}
}
#figure out at what position this needs to print
@@ -1220,7 +1173,7 @@ sub build_posting_display {
if ($outputtarget eq 'export') {
%{$$imsitems{$idx}} = ();
$$imsitems{$idx}{'isvisible'}='true';
- if ($hiddens{$idx}) {
+ if ($hidden) {
$$imsitems{$idx}{'isvisible'}='false';
}
$$imsitems{$idx}{'title'}=$subjects{$numoldver};
@@ -1302,7 +1255,7 @@ sub build_posting_display {
$$newitem{$idx} = 1;
$$discussionitems[$idx] .= '
- '.&mt('NEW').' | ';
+ '.&mt('NEW').' | ';
} else {
$$newitem{$idx} = 0;
$$discussionitems[$idx] .= '
@@ -1402,7 +1355,7 @@ 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,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$numver) = @_;
my $discussion = '';
my $start=$numver;
my $end=$numver + 1;
@@ -1420,20 +1373,13 @@ sub get_post_contents {
$$contrib{$idx.':sendername'},
$$contrib{$idx.':senderdomain'});
$$screenname=$$contrib{$idx.':screenname'};
- $$showaboutme = &Apache::lonnet::usertools_access($$contrib{$idx.':sendername'},
- $$contrib{$idx.':senderdomain'},
- 'aboutme');
- my $sender = $$plainname;
- if ($$showaboutme) {
- $sender = &Apache::loncommon::aboutmewrapper(
- $$plainname,
- $$contrib{$idx.':sendername'},
- $$contrib{$idx.':senderdomain'});
- }
- if ($seeid) {
- $sender .= ' ('. $$contrib{$idx.':sendername'}.':'.
- $$contrib{$idx.':senderdomain'}.')';
- }
+
+ my $sender=&Apache::loncommon::aboutmewrapper(
+ $$plainname,
+ $$contrib{$idx.':sendername'},
+ $$contrib{$idx.':senderdomain'}).' ('.
+ $$contrib{$idx.':sendername'}.':'.
+ $$contrib{$idx.':senderdomain'}.')';
my $attachmenturls = $$contrib{$idx.':attachmenturl'};
my @postversions = ();
if ($type eq 'allversions' || $type eq 'export') {
@@ -1730,17 +1676,6 @@ END
END
- my ($textareaheader,$textareaclass);
- if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- $textareaheader = &Apache::lonhtmlcommon::htmlareaselectactive();
- $textareaclass = 'class="LC_richDefaultOff"';
- if ($env{'request.course.id'}) {
- unless (($env{'course.'.$env{'request.course.id'}.'.allow_limited_html_in_feedback'} =~ /^\s*yes\s*$/i) || ($env{'form.sendmessageonly'})) {
- undef($textareaclass);
- }
- }
- }
-
# Breadcrumbs
my $brcrum = [{'href' => '',
'text' => 'Resource Feedback and Discussion'}];
@@ -1780,16 +1715,14 @@ END
$r->print(<
$quote
-$lt{'myqu'}
-$textareaheader
-
+$lt{'myqu'}
$latexHelp
$lt{'title'}:
-
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
@@ -1867,6 +1800,7 @@ END
}
}
$r->print(&generate_preview_button().
+ &Apache::lonhtmlcommon::htmlareaselectactive('comment').
&Apache::loncommon::end_page());
}
@@ -2315,7 +2249,7 @@ sub print_showposters {
my $group = $env{'form.group'};
my $ressymb = &wrap_symb($symb);
if (($group ne '') &&
- ($ressymb =~ m|^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) {
+ ($ressymb =~ m|^bulletin___ \d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) {
if (&check_group_priv($group,'dgp') eq 'ok') {
$seeid = 1;
}
@@ -2589,10 +2523,6 @@ sub redirect_back {
&Apache::lonenc::check_encrypt(\$feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
my %onload;
- if ($env{'environment.remote'} ne 'off') {
- $onload{'onload'} =
- "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
- }
my $start_page=
&Apache::loncommon::start_page('Feedback sent',undef,
{'redirect' => [0,$feedurl],
@@ -2626,10 +2556,6 @@ sub no_redirect_back {
my $nofeed=&mt('Sorry, no feedback possible on this resource ...');
my %onload;
- if ($env{'environment.remote'} ne 'off') {
- $onload{'onload'} =
- "if (window.name!='loncapaclient') { self.window.close(); }";
- }
my %body_options = ('only_body' => 1,
'bgcolor' => '#FFFFFF',
@@ -2656,7 +2582,7 @@ ENDNOREDIRTWO
}
sub screen_header {
- my ($feedurl,$symb,$group) = @_;
+ my ($feedurl,$symb) = @_;
my $crscontent = &mt('Question/Comment/Feedback about course content');
my $crspolicy = &mt('Question/Comment/Feedback about course policy');
my $contribdisc = &mt('Contribution to course discussion of resource');
@@ -2705,19 +2631,10 @@ sub screen_header {
}
if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) {
my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('boards');
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
- my $realsymb = $symb;
- if ($symb=~/^bulletin___/) {
- my $filename=(&Apache::lonnet::decode_symb($symb))[2];
- $filename=~s|^adm/wrapper/||;
- $realsymb=&Apache::lonnet::symbread($filename);
- }
- if (!$blocked && &discussion_open(undef,$realsymb) &&
- (&Apache::lonnet::allowed('pch',
+ if (!$blocked && &discussion_open(undef,$symb) &&
+ &Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||
- (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) {
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$discussoptions='
|