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