[LON-CAPA-cvs] cvs: loncom(loncapaMITrelate_1) /interface lonfeedback.pm
raeburn
raeburn at source.lon-capa.org
Tue Mar 6 16:24:02 EST 2012
raeburn Tue Mar 6 21:24:02 2012 EDT
Modified files: (Branch: loncapaMITrelate_1)
/loncom/interface lonfeedback.pm
Log:
- Customization for MITrelate.
- Backport 1.336.
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.290.2.7 loncom/interface/lonfeedback.pm:1.290.2.7.2.1
--- loncom/interface/lonfeedback.pm:1.290.2.7 Fri Dec 24 23:18:57 2010
+++ loncom/interface/lonfeedback.pm Tue Mar 6 21:24:01 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.290.2.7 2010/12/24 23:18:57 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.290.2.7.2.1 2012/03/06 21:24:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1014,7 +1014,7 @@
my %subjects = ();
my %attachtxt = ();
my %allattachments = ();
- my ($screenname,$plainname);
+ my ($screenname,$plainname,$showaboutme);
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 +1024,7 @@
$$anonhash{$key}=&mt('Anonymous').' '.$anoncnt;
}
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,\$showaboutme,$numoldver);
# Set up for sorting by subject
@@ -1054,12 +1054,18 @@
}
}
if (!$contrib{$idx.':anonymous'} || $see_anonymous) {
- $sender=&Apache::loncommon::aboutmewrapper(
- $plainname,
- $contrib{$idx.':sendername'},
- $contrib{$idx.':senderdomain'}).' ('.
- $contrib{$idx.':sendername'}.':'.
- $contrib{$idx.':senderdomain'}.')';
+ 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 = '<b>'.$sender.'</b>';
if ($contrib{$idx.':anonymous'}) {
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '.
@@ -1396,7 +1402,7 @@
sub get_post_contents {
- my ($contrib,$idx,$seeid,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$numver) = @_;
+ my ($contrib,$idx,$seeid,$type,$messages,$subjects,$allattachments,$attachtxt,$imsfiles,$screenname,$plainname,$showaboutme,$numver) = @_;
my $discussion = '';
my $start=$numver;
my $end=$numver + 1;
@@ -1414,13 +1420,20 @@
$$contrib{$idx.':sendername'},
$$contrib{$idx.':senderdomain'});
$$screenname=$$contrib{$idx.':screenname'};
-
- my $sender=&Apache::loncommon::aboutmewrapper(
- $$plainname,
- $$contrib{$idx.':sendername'},
- $$contrib{$idx.':senderdomain'}).' ('.
- $$contrib{$idx.':sendername'}.':'.
- $$contrib{$idx.':senderdomain'}.')';
+ $$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 $attachmenturls = $$contrib{$idx.':attachmenturl'};
my @postversions = ();
if ($type eq 'allversions' || $type eq 'export') {
@@ -3562,11 +3575,11 @@
my %attachmsgs = ();
my %allattachments = ();
my %imsfiles = ();
- my ($screenname,$plainname);
+ my ($screenname,$plainname,$showaboutme);
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
- $r->print(&get_post_contents(\%contrib,$idx,$seeid,'allversions',\%messages,\%subjects,\%allattachments,\%attachmsgs,\%imsfiles,\$screenname,\$plainname));
+ $r->print(&get_post_contents(\%contrib,$idx,$seeid,'allversions',\%messages,\%subjects,\%allattachments,\%attachmsgs,\%imsfiles,\$screenname,\$plainname,\$showaboutme));
}
$r->print(&Apache::loncommon::end_page());
return OK;
More information about the LON-CAPA-cvs
mailing list