version 1.688, 2008/09/29 22:53:20
|
version 1.695, 2008/11/28 14:36:50
|
Line 677 sub select_datelocale {
|
Line 677 sub select_datelocale {
|
if ($id ne '') { |
if ($id ne '') { |
my $en_terr = $locale->{'en_territory'}; |
my $en_terr = $locale->{'en_territory'}; |
my $native_terr = $locale->{'native_territory'}; |
my $native_terr = $locale->{'native_territory'}; |
my @languages = &preferred_languages(); |
my @languages = &Apache::lonlocal::preferred_languages(); |
if (grep(/^en$/,@languages) || !@languages) { |
if (grep(/^en$/,@languages) || !@languages) { |
if ($en_terr ne '') { |
if ($en_terr ne '') { |
$locale_names{$id} = '('.$en_terr.')'; |
$locale_names{$id} = '('.$en_terr.')'; |
Line 926 sub help_open_topic {
|
Line 926 sub help_open_topic {
|
if ($text ne "") { |
if ($text ne "") { |
$template .= |
$template .= |
"<table bgcolor='#3333AA' cellspacing='1' cellpadding='1' border='0'><tr>". |
"<table bgcolor='#3333AA' cellspacing='1' cellpadding='1' border='0'><tr>". |
"<td bgcolor='#5555FF'><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; |
"<td bgcolor='#5555FF'><span class=\"LC_nobreak\"><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; |
} |
} |
|
|
# Add the graphic |
# Add the graphic |
Line 935 sub help_open_topic {
|
Line 935 sub help_open_topic {
|
$template .= <<"ENDTEMPLATE"; |
$template .= <<"ENDTEMPLATE"; |
<a target="_top" href="$link" title="$title"><img src="$helpicon" border="0" alt="(Help: $topic)" /></a> |
<a target="_top" href="$link" title="$title"><img src="$helpicon" border="0" alt="(Help: $topic)" /></a> |
ENDTEMPLATE |
ENDTEMPLATE |
if ($text ne '') { $template.='</td></tr></table>' }; |
if ($text ne '') { $template.='</span></td></tr></table>' }; |
return $template; |
return $template; |
|
|
} |
} |
Line 2998 sub fileextensions {
|
Line 2998 sub fileextensions {
|
|
|
sub display_languages { |
sub display_languages { |
my %languages=(); |
my %languages=(); |
foreach my $lang (&preferred_languages()) { |
foreach my $lang (&Apache::lonlocal::preferred_languages()) { |
$languages{$lang}=1; |
$languages{$lang}=1; |
} |
} |
&get_unprocessed_cgi($ENV{'QUERY_STRING'},['displaylanguage']); |
&get_unprocessed_cgi($ENV{'QUERY_STRING'},['displaylanguage']); |
Line 3010 sub display_languages {
|
Line 3010 sub display_languages {
|
return %languages; |
return %languages; |
} |
} |
|
|
sub preferred_languages { |
|
my @languages=(); |
|
if (($env{'request.role.adv'}) && ($env{'form.languages'})) { |
|
@languages=(@languages,split(/\s*(\,|\;|\:)\s*/,$env{'form.languages'})); |
|
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.languages'}) { |
|
@languages=(@languages,split(/\s*(\,|\;|\:)\s*/, |
|
$env{'course.'.$env{'request.course.id'}.'.languages'})); |
|
} |
|
|
|
if ($env{'environment.languages'}) { |
|
@languages=(@languages, |
|
split(/\s*(\,|\;|\:)\s*/,$env{'environment.languages'})); |
|
} |
|
my $browser=$ENV{'HTTP_ACCEPT_LANGUAGE'}; |
|
if ($browser) { |
|
my @browser = |
|
map { (split(/\s*;\s*/,$_))[0] } (split(/\s*,\s*/,$browser)); |
|
push(@languages,@browser); |
|
} |
|
|
|
foreach my $domtype ($env{'user.domain'},$env{'request.role.domain'}, |
|
$Apache::lonnet::perlvar{'lonDefDomain'}) { |
|
if ($domtype ne '') { |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($domtype); |
|
if ($domdefs{'lang_def'} ne '') { |
|
push(@languages,$domdefs{'lang_def'}); |
|
} |
|
} |
|
} |
|
return &get_genlanguages(@languages); |
|
} |
|
|
|
sub get_genlanguages { |
|
my (@languages) = @_; |
|
# turn "en-ca" into "en-ca,en" |
|
my @genlanguages; |
|
foreach my $lang (@languages) { |
|
unless ($lang=~/\w/) { next; } |
|
push(@genlanguages,$lang); |
|
if ($lang=~/(\-|\_)/) { |
|
push(@genlanguages,(split(/(\-|\_)/,$lang))[0]); |
|
} |
|
} |
|
#uniqueify the languages list |
|
my %count; |
|
@genlanguages = map { $count{$_}++ == 0 ? $_ : () } @genlanguages; |
|
return @genlanguages; |
|
} |
|
|
|
sub languages { |
sub languages { |
my ($possible_langs) = @_; |
my ($possible_langs) = @_; |
my @preferred_langs = &preferred_languages(); |
my @preferred_langs = &Apache::lonlocal::preferred_languages(); |
if (!ref($possible_langs)) { |
if (!ref($possible_langs)) { |
if( wantarray ) { |
if( wantarray ) { |
return @preferred_langs; |
return @preferred_langs; |
Line 5520 fieldset#LC_mainmenu_fieldset {
|
Line 5470 fieldset#LC_mainmenu_fieldset {
|
margin:0px 10px 10px 0px; |
margin:0px 10px 10px 0px; |
|
|
} |
} |
|
/* ---- Remove when done ---- |
|
# The following styles is part of the redesign of LON-CAPA and are |
|
# subject to change during this project. |
|
# Don't rely on their current functionality as they might be |
|
# changed or removed. |
|
# --------------------------*/ |
|
|
|
|
|
body { |
|
font-family: Tahoma, Arial,Helvetica,sans-serif; |
|
font-size: 0.85em; |
|
line-height: 130%; |
|
color: RGB(45, 45, 45); |
|
} |
|
|
|
a:link,a:visited { |
|
/*color: RGB(0, 118, 127);*/ |
|
/*text-decoration: underline;*/ |
|
} |
|
|
|
a:hover{ |
|
text-decoration:none; |
|
} |
|
/*a:hover, |
|
UL.smallMenu A:hover, |
|
UL.MenuBreadcrumbs A:hover, |
|
UL#TabMainMenuContent A:hover{ |
|
color: rgb(200, 10, 50); |
|
}*/ |
|
|
|
h1 { |
|
padding:5px 10px 5px 20px; |
|
line-height:130%; |
|
} |
|
h2,h4,h6 { |
|
/*color: RGB(0, 118, 127);*/ |
|
} |
|
h2,h3,h4,h5,h6 |
|
{ |
|
margin:5px 0px 5px 0px; |
|
line-height:130%; |
|
} |
|
|
|
.right { |
|
text-align: right; |
|
} |
|
|
|
.center { |
|
text-align: center; |
|
} |
|
|
|
.left { |
|
text-align: left; |
|
} |
|
|
|
|
|
.HeadRight { |
|
text-align: right; |
|
float: right; |
|
margin: 0px; |
|
padding: 0px; |
|
right:0; |
|
position:absolute; |
|
} |
|
|
|
img { |
|
/* border: 0px; */ |
|
} |
|
|
|
.personalBgColor { |
|
background: RGB(237, 239, 0) url(images/headHighlight.png) repeat-y left top; |
|
} |
|
|
|
p { |
|
padding: 10px; |
|
} |
|
DL,UL,Div,Fieldset { |
|
/*margin: 10px;*/ |
|
overflow:hidden; |
|
} |
|
OL.smallMenu { |
|
margin: 0px 0px 0px 0px; |
|
} |
|
|
|
OL.smallMenu li { |
|
display: inline; |
|
padding: 5px 5px 0px 10px; |
|
vertical-align: top; |
|
} |
|
|
|
OL.smallMenu li img { |
|
vertical-align: bottom; |
|
} |
|
|
|
OL.smallMenu A { |
|
font-size: 90%; |
|
color: RGB(80, 80, 80); |
|
text-decoration: none; |
|
} |
|
|
|
OL#TabMainMenuContent { |
|
|
|
margin: 0px 0px 10px 0px; |
|
padding: 0px; |
|
} |
|
|
|
OL#TabMainMenuContent LI { |
|
display: inline; |
|
vertical-align: bottom; |
|
border-bottom: solid 1px RGB(175, 175, 175); |
|
border-right: solid 1px RGB(175, 175, 175); |
|
padding: 5px 15px 5px 15px; |
|
margin-right:4px; |
|
line-height: 140%; |
|
font-weight: bold; |
|
overflow:hidden; |
|
background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left top; |
|
} |
|
|
|
OL#TabMainMenuContent LI A { |
|
color: RGB(47, 47, 47); |
|
text-decoration: none; |
|
} |
|
|
|
OL#TabMainMenuContent DIV.columnSection { |
|
margin-bottom: 0px; |
|
} |
|
|
|
OL#MenuBreadcrumbs { |
|
border-top: solid 1px RGB(255, 255, 255); |
|
height: 20px; |
|
line-height: 20px; |
|
vertical-align: bottom; |
|
margin: 0px 0px 30px 0px; |
|
padding-left: 10px; |
|
list-style-position: inside; |
|
background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left |
|
top; |
|
} |
|
|
|
OL#MenuBreadcrumbs li { |
|
background: url(images/pfeil_white.png) no-repeat left center; |
|
display: inline; |
|
padding: 0px 0px 0px 10px; |
|
vertical-align: bottom; |
|
overflow:hidden; |
|
} |
|
|
|
OL#MenuBreadcrumbs LI A { |
|
text-decoration: none; |
|
font-size:90%; |
|
} |
|
|
|
h4.hcell { |
|
padding: 3px 10px 3px 10px; |
|
margin: 0px; |
|
background: RGB(0, 118, 127); |
|
color: white; |
|
border: outset 1px; |
|
} |
|
|
|
DIV.DivContentBoxSpecial |
|
{ |
|
border: solid 1px RGB(100, 100, 100); |
|
} |
|
|
|
FIELDSET |
|
{ |
|
/*width:78%;*/ |
|
} |
|
DIV.DivContentBox, |
|
DIV.DivContentBoxSpecial { |
|
width: 80%; |
|
margin:10px; |
|
} |
|
|
|
FIELDSET legend,DL DT { |
|
font-weight: bold; |
|
font-size: 110%; |
|
/*padding-left: 0px;*/ |
|
/* margin-left: 0px;*/ |
|
} |
|
|
|
DIV.DivImportant { |
|
background: url(images/important.png) no-repeat center top; |
|
padding: 100px 10px 10px 10px; |
|
width: 200px; |
|
border: double 4px RGB(200, 200, 200); |
|
} |
|
|
|
|
|
|
|
DL.ListStyleClean DT { |
|
padding-right: 5px; |
|
display: table-header-group; |
|
} |
|
|
|
DL.ListStyleClean DD { |
|
display: table-row; |
|
} |
|
|
|
.ListStyleClean, |
|
.ListStyleSimple, |
|
.ListStyleNormal, |
|
.ListStyleNormal_Border, |
|
.ListStyleSpecial |
|
{ |
|
/*display:block; */ |
|
width: 400px; |
|
list-style-position: inside; |
|
list-style-type: none; |
|
overflow: hidden; |
|
padding: 0px; |
|
} |
|
|
|
.ListStyleClean li, |
|
.ListStyleSimple li, |
|
.ListStyleSimple DD, |
|
.ListStyleNormal li, |
|
.ListStyleNormal DD, |
|
.ListStyleSpecial li, |
|
.ListStyleSpecial DD |
|
{ |
|
margin: 0px; |
|
padding: 5px 5px 5px 10px; |
|
clear: both; |
|
/*display:block;*/ |
|
} |
|
|
|
.ListStyleClean LI, |
|
.ListStyleClean DD { |
|
padding-top: 0px; |
|
padding-bottom: 0px; |
|
} |
|
|
|
.ListStyleSimple DD, |
|
.ListStyleSimple LI{ |
|
border-bottom: solid 1px RGB(150, 150, 150); |
|
} |
|
|
|
.ListStyleSpecial LI, |
|
.ListStyleSpecial DD { |
|
list-style-type: none; |
|
background-color: RGB(220, 220, 220); |
|
margin-bottom: 4px; |
|
} |
|
|
|
table.SimpleTable *{ |
|
padding:10px; |
|
} |
|
|
|
table.SimpleTable td { |
|
vertical-align:top; |
|
border:solid 1px RGB(210,210,210); |
|
} |
|
table.SimpleTable thead{ |
|
background:rgb(210,210,210); |
|
} |
|
|
|
DIV.columnSection { |
|
display: block; |
|
clear: both; |
|
overflow: hidden; |
|
margin:0px; |
|
} |
|
|
|
DIV.columnSection>* { |
|
float: left; |
|
margin: 10px 20px 10px 0px; |
|
overflow:hidden; |
|
} |
|
|
|
DIV.columnSection>FIELDSET, |
|
DIV.columnSection>DIV.DivContentBox, |
|
DIV.columnSection>DIV.DivContentBoxSpecial |
|
{ |
|
width: 480px; |
|
|
|
} |
|
|
|
.LC_loginpage_container { |
|
text-align:left; |
|
margin : 0 auto; |
|
width:65%; |
|
padding: 10px; |
|
height: auto; |
|
background-color:#FFFFFF; |
|
border:1px solid #CCCCCC; |
|
} |
|
|
|
|
|
.LC_loginpage_loginContainer { |
|
float:left; |
|
width:60%; |
|
} |
|
|
|
.LC_loginpage_loginInfo { |
|
margin-top:20px; |
|
margin-left:20px; |
|
float:left; |
|
width:30%; |
|
border:1px solid #CCCCCC; |
|
padding:10px; |
|
} |
|
|
|
.LC_loginpage_space { |
|
clear:both; |
|
margin-bottom:20px; |
|
border-bottom: 1px solid #CCCCCC; |
|
} |
|
|
|
.LC_loginpage_fieldset{ |
|
border: 1px solid #CCCCCC; |
|
margin: 0 auto; |
|
} |
|
|
|
.LC_loginpage_legend{ |
|
padding: 2px; |
|
margin: 0px; |
|
font-size:14px; |
|
font-weight:bold; |
|
} |
|
|
|
|
|
|
END |
END |
} |
} |
|
|
Line 7707 sub csv_print_select_table {
|
Line 7982 sub csv_print_select_table {
|
&end_data_table_header_row()."\n"); |
&end_data_table_header_row()."\n"); |
foreach my $array_ref (@$d) { |
foreach my $array_ref (@$d) { |
my ($value,$display,$defaultcol)=@{ $array_ref }; |
my ($value,$display,$defaultcol)=@{ $array_ref }; |
$r->print(&start_data_table_row().'<tr><td>'.$display.'</td>'); |
$r->print(&start_data_table_row().'<td>'.$display.'</td>'); |
|
|
$r->print('<td><select name=f'.$i. |
$r->print('<td><select name=f'.$i. |
' onchange="javascript:flip(this.form,'.$i.');">'); |
' onchange="javascript:flip(this.form,'.$i.');">'); |
Line 9271 sub construct_course {
|
Line 9546 sub construct_course {
|
$outcome .= ($fatal?$errtext:'read ok').' - '; |
$outcome .= ($fatal?$errtext:'read ok').' - '; |
my $title; my $url; |
my $title; my $url; |
if ($args->{'firstres'} eq 'syl') { |
if ($args->{'firstres'} eq 'syl') { |
$title='Syllabus'; |
$title=&mt('Syllabus'); |
$url='/public/'.$$crsudom.'/'.$$crsunum.'/syllabus'; |
$url='/public/'.$$crsudom.'/'.$$crsunum.'/syllabus'; |
} else { |
} else { |
$title='Navigate Contents'; |
$title=&mt('Navigate Contents'); |
$url='/adm/navmaps'; |
$url='/adm/navmaps'; |
} |
} |
|
|
Line 9328 sub icon {
|
Line 9603 sub icon {
|
return &lonhttpdurl($iconname); |
return &lonhttpdurl($iconname); |
} |
} |
|
|
sub lonhttpd_port { |
|
my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; |
|
if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; } |
|
# IE doesn't like a secure page getting images from a non-secure |
|
# port (when logging we haven't parsed the browser type so default |
|
# back to secure |
|
if ((!exists($env{'browser.type'}) || $env{'browser.type'} eq 'explorer') |
|
&& $ENV{'SERVER_PORT'} == 443) { |
|
return 443; |
|
} |
|
return $lonhttpd_port; |
|
|
|
} |
|
|
|
sub lonhttpdurl { |
sub lonhttpdurl { |
|
# |
|
# Had been used for "small fry" static images on separate port 8080. |
|
# Modify here if lightweight http functionality desired again. |
|
# Currently eliminated due to increasing firewall issues. |
|
# |
my ($url)=@_; |
my ($url)=@_; |
|
return $url; |
my $lonhttpd_port = &lonhttpd_port(); |
|
if ($lonhttpd_port == 443) { |
|
return 'https://'.$ENV{'SERVER_NAME'}.$url; |
|
} |
|
return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; |
|
} |
} |
|
|
sub connection_aborted { |
sub connection_aborted { |