--- loncom/interface/loncommon.pm 2003/04/03 03:08:12 1.93 +++ loncom/interface/loncommon.pm 2003/05/04 21:20:17 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.93 2003/04/03 03:08:12 www Exp $ +# $Id: loncommon.pm,v 1.98 2003/05/04 21:20:17 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -151,8 +151,8 @@ BEGIN { while (<$fh>) { next if /^\#/; chomp; - my ($key,$val)=(split(/\s+/,$_,2)); - $language{$key}=$val; + my ($key,$two,$country,$three,$enc,$val)=(split(/\t/,$_)); + $language{$key}=$val.' - '.$enc; } } } @@ -1347,6 +1347,26 @@ sub languagedescription { return $language{shift(@_)}; } +# ----------------------------------------------------------- Display Languages +# returns a hash with all desired display languages +# + +sub display_languages { + my %languages=(); + if ($ENV{'environment.languages'}) { + foreach (split(/\s*(\,|\;|\:)\s*/,$ENV{'environment.languages'})) { + $languages{$_}=1; + } + } + &get_unprocessed_cgi($ENV{'QUERY_STRING'},['displaylanguage']); + if ($ENV{'form.displaylanguage'}) { + foreach (split(/\s*(\,|\;|\:)\s*/,$ENV{'form.displaylanguage'})) { + $languages{$_}=1; + } + } + return %languages; +} + # --------------------------------------------------------------- Copyright IDs sub copyrightids { return sort(keys(%cprtag)); @@ -1635,6 +1655,9 @@ Returns: value of designparamter $which ############################################## sub designparm { my ($which,$domain)=@_; + if ($ENV{'environment.color.'.$which}) { + return $ENV{'environment.color.'.$which}; + } $domain=&determinedomain($domain); if ($designhash{$domain.'.'.$which}) { return $designhash{$domain.'.'.$which}; @@ -1715,32 +1738,32 @@ sub bodytag { END + my $upperleft=''; if ($bodyonly) { return $bodytag; } elsif ($ENV{'browser.interface'} eq 'textual') { -# -# Accessibility rendering -# +# Accessibility return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web', $forcereg). '

LON-CAPA: '.$title.'

'; } elsif ($ENV{'environment.remote'} eq 'off') { -# -# No-Remote rendering -# +# No Remote return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web', $forcereg). - '

LON-CAPA: '.$title.'

'; - } else { + '
'.$title. +'
'; + } + # -# Remote rendering +# Top frame rendering, Remote is up # - return(< - - -$messages + +$upperleft +$messages  @@ -1761,7 +1784,6 @@ $bodytag $realm 
ENDBODY - } } ###############################################