version 1.116, 2003/09/11 22:37:54
|
version 1.119, 2003/09/17 16:50:58
|
Line 68 use POSIX qw(strftime mktime);
|
Line 68 use POSIX qw(strftime mktime);
|
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods); |
use Apache::lonmsg(); |
use Apache::lonmsg(); |
use Apache::lonmenu(); |
use Apache::lonmenu(); |
|
use Apache::lonlocal; |
|
|
my $readit; |
my $readit; |
|
|
=pod |
=pod |
Line 346 sub selectstudent_link {
|
Line 348 sub selectstudent_link {
|
return ''; |
return ''; |
} |
} |
return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele. |
return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele. |
'","'.$udomele.'");'."'>Select User</a>"; |
'","'.$udomele.'");'."'>".&mt('Select User')."</a>"; |
} |
} |
if ($ENV{'request.role'}=~/^(au|dc|su)/) { |
if ($ENV{'request.role'}=~/^(au|dc|su)/) { |
return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele. |
return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele. |
'","'.$udomele.'",1);'."'>Select User</a>"; |
'","'.$udomele.'",1);'."'>".&mt('Select User')."</a>"; |
} |
} |
return ''; |
return ''; |
} |
} |
Line 382 ENDSTDBRW
|
Line 384 ENDSTDBRW
|
sub selectcourse_link { |
sub selectcourse_link { |
my ($form,$unameele,$udomele)=@_; |
my ($form,$unameele,$udomele)=@_; |
return "<a href='".'javascript:opencrsbrowser("'.$form.'","'.$unameele. |
return "<a href='".'javascript:opencrsbrowser("'.$form.'","'.$unameele. |
'","'.$udomele.'");'."'>Select Course</a>"; |
'","'.$udomele.'");'."'>".&mt('Select Course')."</a>"; |
} |
} |
|
|
=pod |
=pod |
Line 514 END
|
Line 516 END
|
foreach my $value (sort(keys(%$hashref))) { |
foreach my $value (sort(keys(%$hashref))) { |
$result.=" <option value=\"$value\" "; |
$result.=" <option value=\"$value\" "; |
$result.=" selected=\"true\" " if ($value eq $firstdefault); |
$result.=" selected=\"true\" " if ($value eq $firstdefault); |
$result.=">$hashref->{$value}->{'text'}</option>\n"; |
$result.=">".&mt($hashref->{$value}->{'text'})."</option>\n"; |
} |
} |
$result .= "</select>\n"; |
$result .= "</select>\n"; |
my %select2 = %{$hashref->{$firstdefault}->{'select2'}}; |
my %select2 = %{$hashref->{$firstdefault}->{'select2'}}; |
Line 524 END
|
Line 526 END
|
foreach my $value (sort(keys(%select2))) { |
foreach my $value (sort(keys(%select2))) { |
$result.=" <option value=\"$value\" "; |
$result.=" <option value=\"$value\" "; |
$result.=" selected=\"true\" " if ($value eq $seconddefault); |
$result.=" selected=\"true\" " if ($value eq $seconddefault); |
$result.=">$select2{$value}</option>\n"; |
$result.=">".&mt($select2{$value})."</option>\n"; |
} |
} |
$result .= "</select>\n"; |
$result .= "</select>\n"; |
# return $debug; |
# return $debug; |
Line 765 sub select_form {
|
Line 767 sub select_form {
|
foreach (sort keys %hash) { |
foreach (sort keys %hash) { |
$selectform.="<option value=\"$_\" ". |
$selectform.="<option value=\"$_\" ". |
($_ eq $def ? 'selected' : ''). |
($_ eq $def ? 'selected' : ''). |
">".$hash{$_}."</option>\n"; |
">".&mt($hash{$_})."</option>\n"; |
} |
} |
$selectform.="</select>"; |
$selectform.="</select>"; |
return $selectform; |
return $selectform; |
Line 1611 sub fileextensions {
|
Line 1613 sub fileextensions {
|
|
|
sub display_languages { |
sub display_languages { |
my %languages=(); |
my %languages=(); |
if ($ENV{'environment.languages'}) { |
foreach (&preferred_languages()) { |
foreach (split(/\s*(\,|\;|\:)\s*/,$ENV{'environment.languages'})) { |
$languages{$_}=1; |
$languages{$_}=1; |
|
} |
|
} |
|
if ($ENV{'course.'.$ENV{'request.course.id'}.'.languages'}) { |
|
foreach (split(/\s*(\,|\;|\:)\s*/, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.languages'})) { |
|
$languages{$_}=1; |
|
} |
|
} |
} |
&get_unprocessed_cgi($ENV{'QUERY_STRING'},['displaylanguage']); |
&get_unprocessed_cgi($ENV{'QUERY_STRING'},['displaylanguage']); |
if ($ENV{'form.displaylanguage'}) { |
if ($ENV{'form.displaylanguage'}) { |
Line 1631 sub display_languages {
|
Line 1625 sub display_languages {
|
return %languages; |
return %languages; |
} |
} |
|
|
|
sub preferred_languages { |
|
my @languages=(); |
|
if ($ENV{'environment.languages'}) { |
|
@languages=split(/\s*(\,|\;|\:)\s*/,$ENV{'environment.languages'}); |
|
} |
|
if ($ENV{'course.'.$ENV{'request.course.id'}.'.languages'}) { |
|
@languages=(@languages,split(/\s*(\,|\;|\:)\s*/, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.languages'})); |
|
} |
|
my $browser=(split(/\;/,$ENV{'HTTP_ACCEPT_LANGUAGE'}))[0]; |
|
if ($browser) { |
|
@languages=(@languages,split(/\s*(\,|\;|\:)\s*/,$browser)); |
|
} |
|
if ($Apache::lonnet::domain_lang_def{$ENV{'user.domain'}}) { |
|
@languages=(@languages, |
|
$Apache::lonnet::domain_lang_def{$ENV{'user.domain'}}); |
|
} |
|
if ($Apache::lonnet::domain_lang_def{$ENV{'request.role.domain'}}) { |
|
@languages=(@languages, |
|
$Apache::lonnet::domain_lang_def{$ENV{'request.role.domain'}}); |
|
} |
|
if ($Apache::lonnet::domain_lang_def{ |
|
$Apache::lonnet::perlvar{'lonDefDomain'}}) { |
|
@languages=(@languages, |
|
$Apache::lonnet::domain_lang_def{ |
|
$Apache::lonnet::perlvar{'lonDefDomain'}}); |
|
} |
|
# turn "en-ca" into "en-ca,en" |
|
my @genlanguages; |
|
foreach (@languages) { |
|
unless ($_=~/\w/) { next; } |
|
push (@genlanguages,$_); |
|
if ($_=~/(\-|\_)/) { |
|
push (@genlanguages,(split(/(\-|\_)/,$_))[0]); |
|
} |
|
} |
|
&Apache::lonnet::logthis('Lang: '.join(',',@genlanguages)); |
|
return @genlanguages; |
|
} |
|
|
############################################################### |
############################################################### |
## Student Answer Attempts ## |
## Student Answer Attempts ## |
############################################################### |
############################################################### |
Line 2059 other decorations will be returned.
|
Line 2093 other decorations will be returned.
|
|
|
sub bodytag { |
sub bodytag { |
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg)=@_; |
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg)=@_; |
|
$title=&mt($title); |
unless ($function) { |
unless ($function) { |
$function='student'; |
$function='student'; |
if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { |
if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { |