--- loncom/interface/loncommon.pm 2003/04/05 22:14:40 1.95 +++ 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.95 2003/04/05 22:14:40 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};