[LON-CAPA-cvs] cvs: loncom /interface loncommunicate.pm lonmsg.pm
www
lon-capa-cvs@mail.lon-capa.org
Thu, 11 Nov 2004 20:41:54 -0000
www Thu Nov 11 15:41:54 2004 EDT
Modified files:
/loncom/interface loncommunicate.pm lonmsg.pm
Log:
Further work on cleaning up menus
Index: loncom/interface/loncommunicate.pm
diff -u loncom/interface/loncommunicate.pm:1.24 loncom/interface/loncommunicate.pm:1.25
--- loncom/interface/loncommunicate.pm:1.24 Tue Nov 9 11:29:32 2004
+++ loncom/interface/loncommunicate.pm Thu Nov 11 15:41:53 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Communicate
#
-# $Id: loncommunicate.pm,v 1.24 2004/11/09 16:29:32 www Exp $
+# $Id: loncommunicate.pm,v 1.25 2004/11/11 20:41:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,10 +54,8 @@
'Course_Broadcast_Message') {
$help{$_}=&Apache::loncommon::help_open_topic($_);
}
- my $folderlist=&Apache::lonmsg::folderlist();
# ------------------------------------------------------------------------ Menu
$r->print(<<END);
-$folderlist
<form method="post" action="/adm/email">
<input type="submit" value="$lt{'mnf'}" />
<input type="text" size="15" name="newfolder" value="" />
@@ -112,7 +110,7 @@
# ---------------------------------------------------------------------- Header
&Apache::lonmsg::header($r);
&menu($r);
- &Apache::lonmsg::disnew($r);
+ &Apache::lonmsg::disall($r,'new');
return OK;
}
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.113 loncom/interface/lonmsg.pm:1.114
--- loncom/interface/lonmsg.pm:1.113 Thu Nov 11 13:24:44 2004
+++ loncom/interface/lonmsg.pm Thu Nov 11 15:41:53 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.113 2004/11/11 18:24:44 www Exp $
+# $Id: lonmsg.pm,v 1.114 2004/11/11 20:41:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -523,6 +523,7 @@
&mt('Folder').': '.
&Apache::loncommon::select_form($folder,'folder',
('' => &mt('INBOX'),'trash' => &mt('TRASH'),
+ 'new' => &mt('New Messages Only'),
'critical' => &mt('Critical'),
'sent' => &mt('Sent Messages'),
map { $_ => $_ } @allfolders)).
@@ -530,13 +531,12 @@
&Apache::loncommon::select_form($interdis,'interdis',
(' 10' => '10', ' 20' => '20', ' 50' => '50', '100' => '100', '200' => '200')).
'<input type="submit" value="'.&mt('View Folder').'" /><br />'.
+ ($folder!~/^(new|critical)/?
'<input type="submit" name="firstview" value="'.&mt('First').'" />'.
'<input type="submit" name="prevview" value="'.&mt('Previous').'" />'.
'<input type="text" size="5" name="startdis" value="'.$startdis.'" />'.
'<input type="submit" name="nextview" value="'.&mt('Next').'" />'.
- '<input type="submit" name="lastview" value="'.&mt('Last').'" />'.
- '<a href="/adm/email?critical=display'.$sqs.'">'.
- &mt('View Critical Messages').'</a>'.
+ '<input type="submit" name="lastview" value="'.&mt('Last').'" />':'').
'</form>';
}
@@ -571,7 +571,8 @@
my ($newfolder)=@_;
if (($newfolder eq 'sent')
|| ($newfolder eq 'critical')
- || ($newfolder eq 'trash')) { return; }
+ || ($newfolder eq 'trash')
+ || ($newfolder eq 'new')) { return; }
&Apache::lonnet::put('email_folders',{$newfolder => time});
}
@@ -863,13 +864,19 @@
sub disall {
my ($r,$folder)=@_;
$r->print(&folderlist($folder));
- unless ($folder) {
- &disnew();
- return;
- }
- if ($folder eq 'critical') {
- &discrit();
+ if ($folder eq 'new') {
+ &disnew($r);
+ } elsif ($folder eq 'critical') {
+ &discrit($r);
+ } else {
+ &disfolder($r,$folder);
}
+}
+
+# ============================================================ Display a folder
+
+sub disfolder {
+ my ($r,$folder)=@_;
my %blocked = ();
my %setters = ();
my $startblock;