version 1.125, 2003/10/04 23:47:44
|
version 1.134, 2003/10/24 13:35:37
|
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 1512 sub languagedescription {
|
Line 1525 sub languagedescription {
|
my $code=shift; |
my $code=shift; |
return ($supported_language{$code}?'* ':''). |
return ($supported_language{$code}?'* ':''). |
$language{$code}. |
$language{$code}. |
($supported_language{$code}?' ['.&mt('interface available').']':''); |
($supported_language{$code}?' ('.&mt('interface available').')':''); |
} |
} |
|
|
=pod |
=pod |
Line 2650 $uname, optional the username of the use
|
Line 2663 $uname, optional the username of the use
|
|
|
sub check_if_partid_hidden { |
sub check_if_partid_hidden { |
my ($id,$symb,$udom,$uname) = @_; |
my ($id,$symb,$udom,$uname) = @_; |
my $hiddenparts=&Apache::lonnet::EXT('resource.0.parameter_hiddenparts', |
my $hiddenparts=&Apache::lonnet::EXT('resource.0.hiddenparts', |
$symb,$udom,$uname); |
$symb,$udom,$uname); |
my @hiddenlist=split(/,/,$hiddenparts); |
my @hiddenlist=split(/,/,$hiddenparts); |
foreach my $checkid (@hiddenlist) { |
foreach my $checkid (@hiddenlist) { |
Line 2659 sub check_if_partid_hidden {
|
Line 2672 sub check_if_partid_hidden {
|
return undef; |
return undef; |
} |
} |
|
|
|
############################################################ |
|
############################################################ |
|
|
|
=pod |
|
|
|
=item DrawBarGraph |
|
|
|
|
|
=cut |
|
|
|
############################################################ |
|
############################################################ |
|
sub DrawBarGraph { |
|
my ($Title,$xlabel,$ylabel,$Max,$colors,@Values)=@_; |
|
# |
|
if (! defined($colors)) { |
|
$colors = ['#33ff00', |
|
'#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933', |
|
'#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66', |
|
]; |
|
} |
|
# |
|
my $identifier = time.'_'.int(rand(1000)); |
|
if (! @Values || ref($Values[0]) ne 'ARRAY') { |
|
return ''; |
|
} |
|
my $NumBars = scalar(@{$Values[0]}); |
|
my %ValuesHash; |
|
my $NumSets=1; |
|
foreach my $array (@Values) { |
|
next if (! ref($array)); |
|
$ValuesHash{'cgi.'.$identifier.'.data.'.$NumSets++} = |
|
join(',',@$array); |
|
} |
|
# |
|
$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); |
|
# |
|
$Max = 1 if ($Max < 1); |
|
if ( int($Max) < $Max ) { |
|
$Max++; |
|
$Max = int($Max); |
|
} |
|
# |
|
&Apache::lonnet::appenv('cgi.'.$identifier.'.title' => $Title, |
|
'cgi.'.$identifier.'.xlabel' => $xlabel, |
|
'cgi.'.$identifier.'.ylabel' => $ylabel, |
|
'cgi.'.$identifier.'.Max' => $Max, |
|
'cgi.'.$identifier.'.NumBars' => $NumBars, |
|
'cgi.'.$identifier.'.NumSets' => $NumSets, |
|
'cgi.'.$identifier.'.Colors' => join(',',@{$colors}), |
|
%ValuesHash); |
|
return '<img src="/cgi-bin/graph.png?'.$identifier.'" border="1" />'; |
|
} |
|
|
|
############################################################ |
|
############################################################ |
|
|
=pod |
=pod |
|
|
=back |
=back |