# # $Id: lonwhatsnew.pm,v 1.9 2005/04/11 15:52:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ # package Apache::lonwhatsnew; use strict; use lib qw(/home/httpd/lib/perl); use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; use Apache::loncoursedata(); use Apache::lonnavmaps(); use Apache::Constants qw(:common :http); use Time::Local; #---------------------------- # handler # #---------------------------- sub handler { my $r = shift; if ($r->header_only) { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK; } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['command']); my $command = $env{'form.command'}; if ($command eq '') { $command = "info"; } &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; $r->print(&display_header()); if (! (($env{'request.course.fn'}) && (&Apache::lonnet::allowed('vsa',$env{'request.course.id'})))) { # Not in a course, or not allowed to modify parms $env{'user.error.msg'}="/adm/whatsnew:vsa:0:0:Cannot display student activity"; return HTTP_NOT_ACCEPTABLE; } &Apache::lonhtmlcommon::clear_breadcrumbs(); if ($command eq 'config') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=config', text=>"Configure display"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs (undef,'Course Action Items','Course_Action_Items_Config')); } else { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=info', text=>"Display Action Items"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs (undef,'Course Action Items','Course_Action_Items_Display')); } &display_main_box($r,$command); } #------------------------------ # display_main_box # # Display all the elements within the main box #------------------------------ sub display_main_box { my ($r,$command) = @_; my $domain=&Apache::loncommon::determinedomain(); my $tabbg=&Apache::loncommon::designparm('coordinator.tabbg',$domain); my $selconfig; my $selinfo; if ($command eq 'config') { $selinfo = 'selected="selected"'; } else { $selconfig = 'selected="selected"'; } my $picker = ('
'); $r->print('');
if ($command eq 'config') {
&display_config_box($r,$picker);
} else {
&display_actions_box($r,$picker);
}
$r->print(< |