[LON-CAPA-cvs] cvs: loncom /interface loncommunicate.pm lonmsg.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 01 Mar 2004 02:21:57 -0000
www Sun Feb 29 21:21:57 2004 EDT
Modified files:
/loncom/interface loncommunicate.pm lonmsg.pm
Log:
Saving my work (some headers lost):
* trying to slowly clean up
* use breadcrumbs
* internationalize
Index: loncom/interface/loncommunicate.pm
diff -u loncom/interface/loncommunicate.pm:1.19 loncom/interface/loncommunicate.pm:1.20
--- loncom/interface/loncommunicate.pm:1.19 Wed Jan 14 22:53:12 2004
+++ loncom/interface/loncommunicate.pm Sun Feb 29 21:21:57 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Communicate
#
-# $Id: loncommunicate.pm,v 1.19 2004/01/15 03:53:12 www Exp $
+# $Id: loncommunicate.pm,v 1.20 2004/03/01 02:21:57 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,17 +25,8 @@
#
# http://www.lon-capa.org/
#
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1,2/6,7/27,8/3,8/15,
-# 11/5/01 Gerd Kortemeyer
-#
+###
+
package Apache::loncommunicate;
use strict;
@@ -79,9 +70,17 @@
$help{$_}=&Apache::loncommon::help_open_topic($_);
}
- $r->print(&Apache::loncommon::bodytag("Communication and Messages").
- &Apache::loncommon::help_open_faq(12).
- &Apache::loncommon::help_open_bug('Communication Tools'));
+# ----------------------------------------------------------------- Breadcrumbs
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/communicate",
+ text=>"Communication/Messages",
+ faq=>12,bug=>'Communication Tools',});
+
+# ---------------------------------------------------------------------- Header
+ &Apache::lonmsg::header($r);
+
+# ------------------------------------------------------------------------ Menu
$r->print(<<END);
<table cellspacing="10" cellpadding="2">
<tr><td bgcolor="#FFFFAA">
@@ -133,7 +132,7 @@
}
if ($#newmsgs >= 0) {
$r->print(<<TABLEHEAD);
-<h3>$lt{'nm'}</h3>
+<h2>$lt{'nm'}</h2>
<table border=2><tr><th> </th>
<th>$lt{'da'}</th><th>$lt{'us'}</th><th>$lt{'do'}</th><th>$lt{'su'}</th></tr>
TABLEHEAD
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.87 loncom/interface/lonmsg.pm:1.88
--- loncom/interface/lonmsg.pm:1.87 Sun Feb 29 20:19:51 2004
+++ loncom/interface/lonmsg.pm Sun Feb 29 21:21:57 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.87 2004/03/01 01:19:51 www Exp $
+# $Id: lonmsg.pm,v 1.88 2004/03/01 02:21:57 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -949,7 +949,13 @@
unless (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
return;
}
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/dropadd?recordftf=query',
+ text=>"User Notes, Face-to-Face, Critical Messages",
+ faq=>12,bug=>'Communication Tools'});
+ &header($r);
# from query string
+
if ($ENV{'form.recname'}) { $ENV{'form.recuname'}=$ENV{'form.recname'}; }
if ($ENV{'form.recdom'}) { $ENV{'form.recdomain'}=$ENV{'form.recdom'}; }
@@ -960,17 +966,23 @@
my $domform = &Apache::loncommon::select_dom_form($defdom,'recdomain');
my $stdbrws = &Apache::loncommon::selectstudent_link
('stdselect','recuname','recdomain');
+ my %lt=&Apache::lonlocal::texthash('user' => 'Username',
+ 'dom' => 'Domain',
+ 'head' => 'User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course',
+ 'subm' => 'Retrieve discussion and message records',
+ 'newr' => 'New Record (record is visible to course faculty and staff)',
+ 'post' => 'Post this Record');
$r->print(<<"ENDTREC");
-<h3>User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course</h3>
+<h3>$lt{'head'}</h3>
<form method="post" action="/adm/email" name="stdselect">
<input type="hidden" name="recordftf" value="retrieve" />
<table>
-<tr><td>Username:</td><td><input type=text size=12 name=recuname value="$ENV{'form.recuname'}"></td>
+<tr><td>$lt{'user'}:</td><td><input type="text" size="12" name="recuname" value="$ENV{'form.recuname'}" /></td>
<td rowspan="2">
$stdbrws
-<input type="submit" value="Retrieve discussion and message records"></td>
+<input type="submit" value="$lt{'subm'}" /></td>
</tr>
-<tr><td>Domain:</td>
+<tr><td>$lt{'dom'}:</td>
<td>$domform</td></tr>
</table>
</form>
@@ -982,7 +994,8 @@
&user_normal_msg_raw(
$ENV{'course.'.$ENV{'request.course.id'}.'.num'},
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- 'Record ['.$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}.']',
+ &mt('Record').
+ ' ['.$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}.']',
$ENV{'form.newrecord'});
}
$r->print('<h3>'.&Apache::loncommon::plainname($ENV{'form.recuname'},
@@ -994,16 +1007,31 @@
<input name="recuname" value="$ENV{'form.recuname'}" type="hidden" />
ENDRHEAD
$r->print(<<ENDBFORM);
-<hr />New Record (record is visible to course faculty and staff)<br />
+<hr />$lt{'newr'}<br />
<textarea name="newrecord" cols="80" rows="10" wrap="hard"></textarea>
<br />
<input type="hidden" name="recordftf" value="post" />
-<input type="submit" value="Post this record" />
+<input type="submit" value="$lt{'post'}" />
</form>
ENDBFORM
}
}
+# ================================================================== The Header
+
+sub header {
+ my ($r,$baseurl)=@_;
+ $r->print('<html><head><title>Communication and Messages</title>');
+ if ($baseurl) {
+ $r->print("<base href=\"http://$ENV{'SERVER_NAME'}/$baseurl\" />");
+ }
+ $r->print(&Apache::loncommon::studentbrowser_javascript().'</head>'.
+ &Apache::loncommon::bodytag('Communication and Messages'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs
+ (undef,'Communication and Messages'));
+
+}
+
# ===================================================================== Handler
sub handler {
@@ -1024,14 +1052,17 @@
$sqs='&sortedby='.$ENV{'form.sortedby'};
# ------------------------------------------------------ They checked for email
&Apache::lonnet::put('email_status',{'recnewemail'=>0});
+
+# ----------------------------------------------------------------- Breadcrumbs
+
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/communicate",
+ text=>"Communication/Messages",
+ faq=>12,bug=>'Communication Tools',});
+
# --------------------------------------------------------------- Render Output
- if (!$ENV{'form.display'}) {
- $r->print('<html><head><title>EMail and Messaging</title>'.
- &Apache::loncommon::studentbrowser_javascript().'</head>'.
- &Apache::loncommon::bodytag('EMail and Messages').
- &Apache::loncommon::help_open_faq(12).
- &Apache::loncommon::help_open_bug('Communication Tools'));
- }
+
if ($ENV{'form.display'}) {
my $msgid=$ENV{'form.display'};
&statuschange($msgid,'read');
@@ -1052,9 +1083,6 @@
my $number_of_messages = scalar(@messages); #subtract 1 for last index
# start output
$r->print('<html><head><title>EMail and Messaging</title>');
- if (defined($content{'baseurl'})) {
- $r->print("<base href=\"http://$ENV{'SERVER_NAME'}/$content{'baseurl'}\" />");
- }
$r->print(&Apache::loncommon::studentbrowser_javascript().
'</head>'.
&Apache::loncommon::bodytag('EMail and Messages').