--- loncom/interface/lonmsgdisplay.pm 2009/03/18 13:46:14 1.118
+++ loncom/interface/lonmsgdisplay.pm 2009/03/31 21:04:12 1.120
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.118 2009/03/18 13:46:14 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.120 2009/03/31 21:04:12 kaisler Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -136,6 +136,9 @@ sub folderlist {
);
+ # set se lastvisit for the new mail check in the toplevel menu
+ &Apache::lonnet::appenv({'user.mailcheck.lastvisit'=>time});
+
my %actions = &Apache::lonlocal::texthash(
view => 'View Folder',
rename => 'Rename Folder',
@@ -2280,61 +2283,46 @@ sub displaymessage {
&printheader($r,'/adm/email?display='.&escape($msgid),'Display a Message','',$content{'baseurl'});
my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'});
-# Functions and Actions
- my $li_start='• ';
- my $li_end=' ';
-
# Prepare available functions
- my $functionlist='';
+ my @functionlist;
if (!$content{'noreplies'}) {
- $functionlist.=$li_start
- .''
+ push(@functionlist,''
.&mt('Reply')
- .''
- .$li_end;
+ .'');
}
- $functionlist.=$li_start
- .''
+ push(@functionlist,''
.&mt('Forward')
- .''
- .$li_end;
- $functionlist.=$li_start
- .''
+ .'');
+ push(@functionlist,''
.&mt('Mark Unread')
- .''
- .$li_end;
- $functionlist.=$li_start
- .''
+ .'');
+ push(@functionlist,''
.&mt('Delete')
- .''
- .$li_end;
- $functionlist.=$li_start
- .''
+ .'');
+ push(@functionlist,''
.&mt('Back to Folder Display')
- .''
- .$li_end;
+ .'');
if ($counter > 0){
- $functionlist.=$li_start
- .''
- .&mt('Previous')
- .''
- .$li_end;
+ push(@functionlist,''
+ .&mt('Previous')
+ .'');
}
if ($counter < $number_of_messages - 1){
- $functionlist.=$li_start
- .''
- .&mt('Next')
- .''
- .$li_end;
+ push(@functionlist,''
+ .&mt('Next')
+ .'');
}
# Print functions
+ my $legendtext=''
+ .&mt('Functions')
+ .'';
$r->print('
'
- .'
'
+ .&Apache::lontemplate::start_functionslist($legendtext)
+ );
+ foreach my $item (@functionlist) {
+ $r->print(&Apache::lontemplate::item_functionslist($item));
+ }
+ $r->print(&Apache::lontemplate::end_functionslist()
.''
);
@@ -2346,36 +2334,43 @@ sub displaymessage {
$symb=&Apache::lonnet::symbread($content{'baseurl'});
}
if ($env{'user.adv'}) {
- my $actionlist='';
+ my @actionlist;
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
- $actionlist.=$li_start
- .&Apache::loncommon::track_student_link(
- &mt('View recent activity'),$content{'sendername'},$content{'senderdomain'},'check')
- .$li_end;
+ push(@actionlist,&Apache::loncommon::track_student_link(
+ &mt('View recent activity')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,'check'));
}
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) && $symb) {
- $actionlist.=$li_start
- .&Apache::loncommon::pprmlink(
- &mt('Set/Change parameters'),$content{'sendername'},$content{'senderdomain'},$symb,'check')
- .$li_end;
+ push(@actionlist,&Apache::loncommon::pprmlink(
+ &mt('Set/Change parameters')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,$symb
+ ,'check'));
}
if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}) && $symb) {
- $actionlist.=$li_start
- .&Apache::loncommon::pgrdlink(
- &mt('Set/Change grades'),$content{'sendername'},$content{'senderdomain'},$symb,'check')
- .$li_end;
+ push(@actionlist,&Apache::loncommon::pgrdlink(
+ &mt('Set/Change grades')
+ ,$content{'sendername'}
+ ,$content{'senderdomain'}
+ ,$symb
+ ,'check'));
}
# Print actions
- if ($actionlist) {
+ if (@actionlist) {
+ $legendtext=&mt('[_1]Currently available actions[_2] (will open extra window):'
+ ,'','');
$r->print(''
- .'
'
+ .&Apache::lontemplate::start_functionslist($legendtext)
+ );
+ foreach my $item (@actionlist) {
+ $r->print(&Apache::lontemplate::item_functionslist($item));
+ }
+ $r->print(&Apache::lontemplate::end_functionslist()
.''
);
}