--- loncom/interface/lonnotify.pm 2006/03/16 20:27:26 1.14
+++ loncom/interface/lonnotify.pm 2008/12/03 21:16:21 1.31
@@ -1,3 +1,7 @@
+# The LearningOnline Network with CAPA
+# Sending messages
+#
+# $Id: lonnotify.pm,v 1.31 2008/12/03 21:16:21 schafran Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,13 +31,15 @@ package Apache::lonnotify;
use strict;
use Apache::lonnet;
use Apache::loncommon;
-use Apache::lonsupportreq;
+use Apache::courseclassifier;
use LONCAPA::Enrollment;
use Apache::Constants qw(:common :http);
use Apache::lonlocal;
use Mail::Send;
use HTML::TokeParser;
use HTML::Entities;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
sub handler {
my ($r) = @_;
@@ -57,24 +63,21 @@ sub handler {
&Apache::lonhtmlcommon::clear_breadcrumbs();
- my $function = &Apache::loncommon::get_users_function();
- my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
-
&Apache::lonhtmlcommon::add_breadcrumb
({href=>'/adm/notify',
text=>"Broadcast E-mail"});
if ($command eq 'process') {
- &print_request_receipt($r,$command,$cdom,$tablecolor);
+ &print_request_receipt($r,$command,$cdom);
} elsif ($command eq 'compose') {
- &print_composition_form($r,$command,$cdom,$tablecolor);
+ &print_composition_form($r,$command,$cdom);
} elsif ($command eq 'pick_target') {
- &print_selection_form($r,$command,$cdom,$tablecolor);
+ &print_selection_form($r,$command,$cdom);
} elsif ($command eq 'pick_display') {
- &print_display_option_form($r,$command,$cdom,$tablecolor);
+ &print_display_option_form($r,$command,$cdom);
} elsif ($command eq 'display') {
- &print_display($r,$command,$cdom,$tablecolor);
+ &print_display($r,$command,$cdom);
} else {
- &print_front_page($r,'front',$cdom,$tablecolor);
+ &print_front_page($r,'front',$cdom);
}
return OK;
}
@@ -87,10 +90,6 @@ sub add_script {
sub start_page {
my ($jscript,$bread_title,$formname) = @_;
- my $html = &Apache::lonxml::xmlbegin();
-
- my $head = &Apache::loncommon::head('Notification E-mail',$jscript);
-
my $loadcode;
if ((defined($env{'form.origin'}))
&& ($env{'form.command'} eq 'compose'
@@ -108,18 +107,15 @@ sub start_page {
}
}
- $loadcode = ' onLoad="'.$loadcode.'" ';
- my $bodytag =
- &Apache::loncommon::bodytag('Broadcast e-mail to users', undef,
- $loadcode);
-
+ my $start_page =
+ &Apache::loncommon::start_page('Broadcast e-mail to users', $jscript,
+ {'add_entries' =>
+ {'onload' => $loadcode,},});
my $breadcrumbs =
- &Apache::lonhtmlcommon::breadcrumbs(undef,$bread_title,
+ &Apache::lonhtmlcommon::breadcrumbs($bread_title,
'Broadcast_system_email');
my $output = <<"ENDONE";
-$html
-$head
-$bodytag
+$start_page
$breadcrumbs