version 1.126, 2003/10/05 00:44:44
|
version 1.128, 2003/10/13 22:35:05
|
Line 362 sub selectstudent_link {
|
Line 362 sub selectstudent_link {
|
} |
} |
|
|
sub coursebrowser_javascript { |
sub coursebrowser_javascript { |
return (<<'ENDSTDBRW'); |
my ($domainfilter)=@_; |
|
return (<<ENDSTDBRW); |
<script type="text/javascript" language="Javascript" > |
<script type="text/javascript" language="Javascript" > |
var stdeditbrowser; |
var stdeditbrowser; |
function opencrsbrowser(formname,uname,udom) { |
function opencrsbrowser(formname,uname,udom) { |
Line 373 sub coursebrowser_javascript {
|
Line 374 sub coursebrowser_javascript {
|
url += 'filter='+filter+'&'; |
url += 'filter='+filter+'&'; |
} |
} |
} |
} |
|
var domainfilter='$domainfilter'; |
|
if (domainfilter != null) { |
|
if (domainfilter != '') { |
|
url += 'domainfilter='+domainfilter+'&'; |
|
} |
|
} |
url += 'form=' + formname + '&cnumelement='+uname+ |
url += 'form=' + formname + '&cnumelement='+uname+ |
'&cdomelement='+udom; |
'&cdomelement='+udom; |
var title = 'Course_Browser'; |
var title = 'Course_Browser'; |
Line 768 See lonrights.pm for an example invocati
|
Line 775 See lonrights.pm for an example invocati
|
sub select_form { |
sub select_form { |
my ($def,$name,%hash) = @_; |
my ($def,$name,%hash) = @_; |
my $selectform = "<select name=\"$name\" size=\"1\">\n"; |
my $selectform = "<select name=\"$name\" size=\"1\">\n"; |
foreach (sort keys %hash) { |
my @keys; |
|
if (exists($hash{'select_form_order'})) { |
|
@keys=@{$hash{'select_form_order'}}; |
|
} else { |
|
@keys=sort(keys(%hash)); |
|
} |
|
foreach (@keys) { |
$selectform.="<option value=\"$_\" ". |
$selectform.="<option value=\"$_\" ". |
($_ eq $def ? 'selected' : ''). |
($_ eq $def ? 'selected' : ''). |
">".&mt($hash{$_})."</option>\n"; |
">".&mt($hash{$_})."</option>\n"; |
Line 2659 sub check_if_partid_hidden {
|
Line 2672 sub check_if_partid_hidden {
|
return undef; |
return undef; |
} |
} |
|
|
|
############################################################ |
|
############################################################ |
|
|
|
=pod |
|
|
|
=item DrawGraph |
|
|
|
Returns a link to cgi-bin/graph |
|
|
|
=cut |
|
|
|
############################################################ |
|
############################################################ |
|
sub DrawGraph { |
|
my ($Title,$xlabel,$ylabel,$Max,$values1,$values2)=@_; |
|
# |
|
my $identifier = time.'_'.int(rand(1000)); |
|
if (! defined($values1) || ref($values1) ne 'ARRAY') { |
|
return ''; |
|
} |
|
# |
|
$Title = '' if (! defined($Title)); |
|
$xlabel = '' if (! defined($xlabel)); |
|
$ylabel = '' if (! defined($ylabel)); |
|
$Title = &Apache::lonnet::escape($Title); |
|
$xlabel = &Apache::lonnet::escape($xlabel); |
|
$ylabel = &Apache::lonnet::escape($ylabel); |
|
# |
|
my $data1 = join(',', @$values1); |
|
my $data2; |
|
if (defined($values2)) { |
|
$data2 = join(',', @$values2); |
|
} |
|
# |
|
my $NumBars = scalar(@$values1); |
|
$Max = 1 if ($Max < 1); |
|
if ( int($Max) < $Max ) { |
|
$Max++; |
|
$Max = int($Max); |
|
} |
|
# |
|
&Apache::lonnet::appenv($identifier.'.title' => $Title, |
|
$identifier.'.xlabel' => $xlabel, |
|
$identifier.'.ylabel' => $ylabel, |
|
$identifier.'.Max' => $Max, |
|
$identifier.'.NumBars' => $NumBars, |
|
$identifier.'.data1' => $data1, |
|
$identifier.'.data2' => $data2); |
|
return '<IMG src="/cgi-bin/graph.png?'.$identifier.'" border="1" />'; |
|
} |
|
|
|
############################################################ |
|
############################################################ |
|
|
=pod |
=pod |
|
|
=back |
=back |