Annotation of loncom/interface/loncommunicate.pm, revision 1.4
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.4 ! www 12: # 3/1,2/6,7/27,8/3 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.
! 46: '<a href="/adm/email?compose=group">Broadcast message to course</a>'.$en);
! 47: }
! 48: $r->print(<<ENDTABLE);
1.2 www 49: <h3>New Messages</h3>
50: <table border=2><tr><th> </th>
51: <th>Date</th><th>Username</th><th>Domain</th><th>Subject</th></tr>
1.4 ! www 52: ENDTABLE
1.2 www 53: map {
54: my ($sendtime,$shortsubj,$fromname,$fromdomain,$status)=
55: &Apache::lonmsg::unpackmsgid($_);
56: if ($status eq 'new') {
57: $r->print(
58: '<tr bgcolor="#FFBB77"><td><a href="/adm/email?display='.$_.
59: '">Open</a></td><td>'.localtime($sendtime).'</td><td>'.
60: $fromname.'</td><td>'.$fromdomain.'</td><td>'.
61: &Apache::lonnet::unescape($shortsubj).'</td></tr>');
62: }
63: } sort split(/\&/,&Apache::lonnet::reply('keys:'.
64: $ENV{'user.domain'}.':'.
65: $ENV{'user.name'}.':nohist_email',
66: $ENV{'user.home'}));
1.4 ! www 67: $r->print('</table></body></html>');
1.1 www 68: return OK;
1.2 www 69: }
1.1 www 70:
71: 1;
72: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>