Annotation of loncom/interface/loncommunicate.pm, revision 1.5
1.1 www 1: # The LearningOnline Network
2: # Communicate
3: #
4: # (Internal Server Error Handler
5: #
6: # (Login Screen
7: # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
8: # 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
9: #
10: # 3/1/1 Gerd Kortemeyer)
11: #
1.5 ! www 12: # 3/1,2/6,7/27,8/3,8/15 Gerd Kortemeyer
1.1 www 13: #
14: package Apache::loncommunicate;
15:
16: use strict;
17: use Apache::Constants qw(:common);
1.2 www 18: use Apache::lonmsg();
1.1 www 19:
20: sub handler {
21: my $r = shift;
22: $r->content_type('text/html');
23: $r->send_http_header;
24: return OK if $r->header_only;
1.2 www 25: #
26: # Start document
27: #
1.1 www 28: $r->print(<<ENDDOCUMENT);
29: <html>
30: <head>
31: <title>The LearningOnline Network with CAPA</title>
32: </head>
33: <body bgcolor="#FFFFFF">
1.2 www 34: <img align=right src=/adm/lonIcons/lonlogos.gif>
1.1 www 35: <h1>Communicate</h1>
1.4 www 36: ENDDOCUMENT
37: my $st='<table><tr><td bgcolor="#FFFFAA"><b>';
38: my $en='</b></td><tr></table>';
39: $r->print('<p>'.$st.'<a href="/adm/email/">All Messages</a>'.$en.'<p>'.$st.
40: '<a href="/adm/email?compose=individual">Send message to user(s)</a>'.
41: $en);
42: if (($ENV{'request.course.id'}) &&
43: (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
44: $r->print(
45: '<p>'.$st.
1.5 ! www 46: '<a href="/adm/email?compose=group">Broadcast message to course</a>'.$en.
! 47: '<p>'.$st.
! 48: '<a href="/adm/email?compose=upload">Upload messages to course</a>'.$en);
1.4 www 49: }
50: $r->print(<<ENDTABLE);
1.2 www 51: <h3>New Messages</h3>
52: <table border=2><tr><th> </th>
53: <th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr>
1.4 www 54: ENDTABLE
1.2 www 55: map {
56: my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
57: &Apache::lonmsg::unpackmsgid($_);
58: if ($status eq 'new') {
59: $r->print(
60: '<tr bgcolor="#FFBB77"><td><a href="/adm/email?display='.$_.
61: '">Open</a></td><td>'.localtime($sendtime).'</td><td>'.
62: $fromname.'</td><td>'.$fromdomain.'</td><td>'.
63: &Apache::lonnet::unescape($shortsubj).'</td></tr>');
64: }
65: } sort split(/\&/,&Apache::lonnet::reply('keys:'.
66: $ENV{'user.domain'}.':'.
67: $ENV{'user.name'}.':nohist_email',
68: $ENV{'user.home'}));
1.4 www 69: $r->print('</table></body></html>');
1.1 www 70: return OK;
1.2 www 71: }
1.1 www 72:
73: 1;
74: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>