--- loncom/interface/lonmsgdisplay.pm 2008/08/25 11:20:19 1.90
+++ loncom/interface/lonmsgdisplay.pm 2008/10/23 10:15:37 1.94
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.90 2008/08/25 11:20:19 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.94 2008/10/23 10:15:37 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1239,7 +1239,11 @@ sub compout {
my $dismsg='';
my $disbase='';
my $attachrow;
- my $func=&mt('Send New');
+ my $func1='Send'; # do not translate here!
+ my %func2=( # do not translate here!
+ 'ma' => 'Message',
+ 'msg' => 'Messages',
+ );
my %lt=&Apache::lonlocal::texthash('us' => 'Username',
'do' => 'Domain',
'ad' => 'Additional Recipients',
@@ -1247,8 +1251,6 @@ sub compout {
'ar' => 'Allow replies',
'sb' => 'Subject',
'ca' => 'Cancel',
- 'ma' => 'Mail',
- 'msg' => 'Messages',
'gen' => 'Generate messages from a file',
'gmt' => 'General message text',
'tff' => 'The file format for the uploaded portion of the message is',
@@ -1256,7 +1258,7 @@ sub compout {
'atta' => 'Attachment',
);
my %attachmax = (
- text => '(128 KB max size)',
+ text => &mt('(128 KB max size)'),
num => 131072,
);
if (!$forwarding && !$multiforward) {
@@ -1296,7 +1298,7 @@ sub compout {
%content=&Apache::lonmsg::unpackagemsg($message{$forwarding},$folder);
$dispcrit.='';
- $func=&mt('Forward');
+ $func1='Forward'; # do not translate here!
$dissub=&mt('Forwarding').': '.$content{'subject'};
$dismsg=&mt('Forwarded message from').' '.
@@ -1310,7 +1312,7 @@ sub compout {
%content=&Apache::lonmsg::unpackagemsg($message{$replying},$folder);
$dispcrit.='';
- $func=&mt('Send Reply to');
+ $func1='Send Reply to'; # do not translate here!
$dissub=&mt('Reply').': '.$content{'subject'};
$dismsg='> '.$content{'message'};
@@ -1421,7 +1423,7 @@ ENDREPSCRIPT
&mt('Unless you choose otherwise:').'
- '.
&mt("The subject in each forwarded message will be 'Forwarding:' followed by the original subject.").'
- '.
&mt("The message itself will begin with a first line: 'Forwarded message from' followed by the original sender's name.").'
');
- $func=&mt('Forward');
+ $func1='Forward'; # do not translate here!
$dissub = &mt('Forwarding').': ';
$subj_size = '10';
my $extra = '<'.&mt('original subject').'> '.
@@ -1440,7 +1442,7 @@ $latexHelp.
foreach my $msg (@to_forward) {
$r->print('');
}
- $r->print(&submit_button_row($folder,$dismode,$func.' '.$lt{'msg'},
+ $r->print(&submit_button_row($folder,$dismode,&mt($func1.' '.$func2{'msg'}),
\%lt));
} elsif ($broadcast ne 'upload') {
$subj_size = '50';
@@ -1462,7 +1464,7 @@ $attachrow
$dispcrit
$disbase
ENDCOMP
- $r->print(&submit_button_row($folder,$dismode,$func.' '.$lt{'ma'},
+ $r->print(&submit_button_row($folder,$dismode,&mt($func1.' '.$func2{'ma'}),
\%lt));
$r->print($citation);
if (exists($env{'form.ref'})) {
@@ -2096,7 +2098,6 @@ sub displaymessage {
my %message=&Apache::lonnet::get('nohist_email'.$suffix,[$msgid]);
my %content=&Apache::lonmsg::unpackagemsg($message{$msgid});
my $counter=0;
- $r->print('');
my $escmsgid=&escape($msgid);
foreach (@messages) {
if ($_->[5] eq $escmsgid){
@@ -2104,7 +2105,6 @@ sub displaymessage {
}
$counter++;
}
- $r->print('
');
my $see_anonymous;
my $from_student = 0;
@@ -2214,46 +2214,83 @@ sub displaymessage {
$r->print(&Apache::loncommon::student_image_tag($content{'senderdomain'},$content{'sendername'}));
}
- $r->print('
'.&mt('Subject').': '.$content{'subject'});
+ # Display LON-CAPA Message (Start)
+ # Subject
+ $r->print('
'
+ .&Apache::lonhtmlcommon::start_pick_box()
+ .&Apache::lonhtmlcommon::row_title(&mt('Subject'))
+ .$content{'subject'}
+ .&Apache::lonhtmlcommon::row_closure()
+ );
if ($folder eq 'sent') {
- $r->print('
'.&mt('To').': '.$tolist);
+ # To
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('To'))
+ .$tolist
+ .&Apache::lonhtmlcommon::row_closure()
+ );
if ($content{'replytoaddr'}) {
my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'});
if ($replytoname ne '' && $replytodom ne '') {
- $r->print('
'.&mt('Reply To').': '.
- $replytoname.' '.&mt('at').' '.$replytodom);
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Reply To'))
+ .&mt('[_1] at [_2]',$replytoname,$replytodom)
+ .&Apache::lonhtmlcommon::row_closure()
+ );
}
}
} else {
- $r->print('
'.&mt('From').': '.
- &Apache::loncommon::aboutmewrapper(
- &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),
- $content{'sendername'},$content{'senderdomain'}));
+ # From, Reply
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('From'))
+ .&Apache::loncommon::aboutmewrapper(
+ &Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),
+ $content{'sendername'},$content{'senderdomain'})
+ );
if ($content{'noreplies'}) {
- $r->print(' ('.&mt('No replies to sender').')');
+ $r->print(' ('.&mt('No replies to sender').')'
+ .&Apache::lonhtmlcommon::row_closure()
+ );
} else {
if ($content{'replytoaddr'}) {
my ($replytoname,$replytodom) = split(/:/,$content{'replytoaddr'});
if ($replytoname ne '' && $replytodom ne '') {
- $r->print('
'.&mt('Reply To').': '.
- $replytoname.' '.&mt('at').' '.$replytodom);
+ $r->print(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Reply To'))
+ .&mt('[_1] at [_2]',$replytoname,$replytodom)
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+ } else {
+ $r->print(&Apache::lonhtmlcommon::row_closure());
}
} else {
- $r->print(' ('.$content{'sendername'}.' '.&mt('at').' '.
- $content{'senderdomain'}.') ');
+ $r->print(' ('.&mt('[_1] at [_2]',$content{'sendername'},$content{'senderdomain'}).') '
+ .&Apache::lonhtmlcommon::row_closure()
+ );
}
if ($cclist) {
- $r->print('
'.&mt('Cc').': '.$cclist);
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Cc'))
+ .$cclist
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+
}
- }
+ }
}
+
+ # Course
if ($content{'courseid'}) {
- $r->print('
'.&mt($crstype).': '.$courseinfo{'description'});
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt($crstype))
+ .$courseinfo{'description'}
+ );
if ($content{'coursesec'}) {
$r->print(' ('.&mt('Section').': '.$content{'coursesec'}.')');
}
+ $r->print(&Apache::lonhtmlcommon::row_closure());
}
- $r->print('
'.&mt('Time').': '.$content{'time'});
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Time'))
+ .$content{'time'}
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+
+ # Refers to
if ($baseurl) {
if (defined($content{'courseid'}) && defined($env{'request.course.id'})) {
if ($content{'courseid'} eq $env{'request.course.id'}) {
@@ -2271,7 +2308,10 @@ sub displaymessage {
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) {
$showurl = $baseurl;
}
- $r->print('
'.&mt('Refers to').': '.$restitle.'');
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to'))
+ .''.$restitle.''
+ .&Apache::lonhtmlcommon::row_closure()
+ );
$refers_to = 1;
}
}
@@ -2284,25 +2324,41 @@ sub displaymessage {
$content{'courseid'});
if ($unencurl ne '') {
if (&Apache::lonnet::allowed('bre',$unencurl)) {
- $r->print('
'.&mt('Refers to').
- ': '.
- $restitle.'');
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to'))
+ .''.$restitle.''
+ .&Apache::lonhtmlcommon::row_closure()
+ );
}
}
}
}
} else {
if (&Apache::lonnet::allowed('bre',$baseurl)) {
- $r->print('
'.&mt('Refers to').
- ': '.$restitle.'');
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to'))
+ .''.$restitle.''
+ .&Apache::lonhtmlcommon::row_closure()
+ );
+
}
}
}
}
- $r->print(''.
- &Apache::lontexconvert::msgtexconverted($content{'message'},1).
- '
'.&displayresource(%content).'');
+
+ # Message
+ $r->print(&Apache::lonhtmlcommon::row_title(&mt('Message'))
+ .''
+ .&Apache::lontexconvert::msgtexconverted($content{'message'},1)
+ .'
'
+ );
+ if (&displayresource(%content)) {
+ $r->print(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Resource Details'))
+ .&displayresource(%content)
+ );
+ }
+ $r->print(&Apache::lonhtmlcommon::row_closure(1).
+ &Apache::lonhtmlcommon::end_pick_box());
+ # Display LON-CAPA Message (End)
return;
}