--- loncom/interface/lonhtmlcommon.pm 2002/08/30 15:35:08 1.9 +++ loncom/interface/lonhtmlcommon.pm 2003/05/12 22:04:41 1.21 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.9 2002/08/30 15:35:08 stredwic Exp $ +# $Id: lonhtmlcommon.pm,v 1.21 2003/05/12 22:04:41 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,179 +25,321 @@ # # http://www.lon-capa.org/ # +###################################################################### +###################################################################### + +=pod + +=head1 NAME + +Apache::lonhtmlcommon - routines to do common html things + +=head1 SYNOPSIS + +Referenced by other mod_perl Apache modules. + +=head1 INTRODUCTION + +lonhtmlcommon is a collection of subroutines used to present information +in a consistent html format, or provide other functionality related to +html. + +=head2 General Subroutines + +=over 4 + +=cut + +###################################################################### +###################################################################### package Apache::lonhtmlcommon; +use Time::Local; use strict; -sub AscendOrderOptions { - my ($order, $page, $formName)=@_; +############################################## +############################################## - my $OpSel1 = ''; - my $OpSel2 = ''; +=pod - if($order eq 'Ascending') { - $OpSel1 = ' selected'; - } else { - $OpSel2 = ' selected'; - } +=item &date_setter - my $Str = ''; - $Str .= ''."\n"; +Inputs - return $Str; -} +=over 4 -sub MapOptions { - my ($data, $page, $formName)=@_; - my $Str = ''; - $Str .= '\n"; + my @Months = qw/January February March April May June + July August September October November December/; + # Pad @Months with a bogus value to make indexing easier + unshift(@Months,'If you can read this an error occurred'); + for(my $m = 1;$m <=$#Months;$m++) { + $result .= "