version 1.4, 2002/07/25 21:23:51
|
version 1.6, 2002/08/01 20:49:06
|
Line 30 package Apache::lonhtmlcommon;
|
Line 30 package Apache::lonhtmlcommon;
|
|
|
use strict; |
use strict; |
|
|
|
sub AscendOrderOptions { |
|
my ($order, $page, $formName)=@_; |
|
|
|
my $OpSel1 = ''; |
|
my $OpSel2 = ''; |
|
|
|
if($order eq 'Ascending') { |
|
$OpSel1 = ' selected'; |
|
} else { |
|
$OpSel2 = ' selected'; |
|
} |
|
|
|
my $Str = ''; |
|
$Str .= '<select name="'.(($page)?$page:'').'Ascend"'; |
|
if($formName) { |
|
$Str .= ' onchange="document.'.$formName.'.submit()"'; |
|
} |
|
$Str .= '>'."\n"; |
|
$Str .= '<option'.$OpSel1.'>Ascending</option>'."\n". |
|
'<option'.$OpSel2.'>Descending</option>'."\n"; |
|
$Str .= '</select>'."\n"; |
|
|
|
return $Str; |
|
} |
|
|
sub MapOptions { |
sub MapOptions { |
my ($data, $page)=@_; |
my ($data, $page, $formName)=@_; |
my $Str = ''; |
my $Str = ''; |
$Str .= '<select name="'; |
$Str .= '<select name="'; |
$Str .= (($page)?$page:'').'Map">'."\n"; |
$Str .= (($page)?$page:'').'Maps"'; |
|
if($formName) { |
|
$Str .= ' onchange="document.'.$formName.'.submit()"'; |
|
} |
|
$Str .= '>'."\n"; |
|
|
my $selected = 0; |
my $selected = 0; |
foreach my $sequence (split(':',$data->{'orderedSequences'})) { |
foreach my $sequence (split(':',$data->{'orderedSequences'})) { |
Line 120 sub StatusOptions {
|
Line 149 sub StatusOptions {
|
$Str .= '</select>'."\n"; |
$Str .= '</select>'."\n"; |
} |
} |
|
|
|
sub MultipleSectionSelect { |
|
my ($sections,$selectedSections)=@_; |
|
|
|
my $Str = ''; |
|
$Str .= '<select name="Section" multiple="" size="4">'."\n"; |
|
|
|
foreach (@$sections) { |
|
$Str .= '<option'; |
|
foreach my $selected (@$selectedSections) { |
|
if($_ eq $selected) { |
|
$Str .= ' selected=""'; |
|
} |
|
} |
|
$Str .= '>'.$_.'</option>'."\n"; |
|
} |
|
$Str .= '</select>'."\n"; |
|
|
|
return $Str; |
|
} |
|
|
sub Title { |
sub Title { |
my ($pageName)=@_; |
my ($pageName)=@_; |
|
|
Line 135 sub Title {
|
Line 184 sub Title {
|
$Str .= '</h1></td><td align="right">'."\n"; |
$Str .= '</h1></td><td align="right">'."\n"; |
$Str .= '<img align="right" src=/adm/lonIcons/lonlogos.gif>'; |
$Str .= '<img align="right" src=/adm/lonIcons/lonlogos.gif>'; |
$Str .= '</td></tr></table>'."\n"; |
$Str .= '</td></tr></table>'."\n"; |
# $Str .= '<h3>Current Time: '.localtime(time).'</h3><br><br><br>'."\n"; |
|
|
|
return $Str; |
|
} |
|
|
|
sub CreateStatisticsMainMenu { |
|
my ($status, $reports)=@_; |
|
|
|
my $Str = ''; |
|
|
|
$Str .= '<table border="0"><tbody><tr>'."\n"; |
|
$Str .= '<td></td><td></td>'."\n"; |
|
$Str .= '<td align="center"><b>Analysis Reports:</b></td>'."\n"; |
|
$Str .= '<td align="center"><b>Student Status:</b></td></tr>'."\n"; |
|
$Str .= '<tr>'."\n"; |
|
$Str .= '<td align="center"><input type="submit" name="Refresh" '; |
|
$Str .= 'value="Refresh" /></td>'."\n"; |
|
$Str .= '<td align="center"><input type="submit" name="DownloadAll" '; |
|
$Str .= 'value="Update All Student Data" /></td>'."\n"; |
|
$Str .= '<td align="center">'; |
|
$Str .= '<select name="reportSelected" onchange="document.'; |
|
$Str .= 'Statistics.submit()">'."\n"; |
|
|
|
foreach (sort(keys(%$reports))) { |
|
next if($_ eq 'reportSelected'); |
|
$Str .= '<option name="'.$_.'"'; |
|
if($reports->{'reportSelected'} eq $reports->{$_}) { |
|
$Str .= ' selected=""'; |
|
} |
|
$Str .= '>'.$reports->{$_}.'</option>'."\n"; |
|
} |
|
$Str .= '</select></td>'."\n"; |
|
|
|
$Str .= '<td align="center">'; |
|
$Str .= &StatusOptions($status, 'Statistics'); |
|
$Str .= '</td>'."\n"; |
|
|
|
$Str .= '</tr></tbody></table>'."\n"; |
|
$Str .= '<hr>'."\n"; |
|
|
|
return $Str; |
return $Str; |
} |
} |