--- loncom/interface/loncommon.pm 2003/09/17 14:30:13 1.118 +++ loncom/interface/loncommon.pm 2003/11/10 23:25:52 1.152 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.118 2003/09/17 14:30:13 www Exp $ +# $Id: loncommon.pm,v 1.152 2003/11/10 23:25:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -69,6 +69,7 @@ use Apache::Constants qw(:common :http : use Apache::lonmsg(); use Apache::lonmenu(); use Apache::lonlocal; +use HTML::Entities; my $readit; @@ -80,6 +81,7 @@ my $readit; # ----------------------------------------------- Filetypes/Languages/Copyright my %language; +my %supported_language; my %cprtag; my %fe; my %fd; my %category_extensions; @@ -89,50 +91,19 @@ my %category_extensions; my %designhash; # ---------------------------------------------- Thesaurus variables - -# FIXME: I don't think it's necessary to document these things; -# they're privately used - Jeremy - -=pod - -=over 4 - -=item * %Keywords - -A hash used by &keyword to determine if a word is considered a keyword. - -=item * $thesaurus_db_file - -Scalar containing the full path to the thesaurus database. - -=back - -=cut +# +# %Keywords: +# A hash used by &keyword to determine if a word is considered a keyword. +# $thesaurus_db_file +# Scalar containing the full path to the thesaurus database. my %Keywords; my $thesaurus_db_file; -# ----------------------------------------------------------------------- BEGIN - -# FIXME: I don't think this needs to be documented, it prepares -# private data structures - Jeremy -=pod - -=head1 General Subroutines - -=over 4 - -=item * BEGIN() - -Initialize values from language.tab, copyright.tab, filetypes.tab, -thesaurus.tab, and filecategories.tab. - -=back - -=cut - -# ----------------------------------------------------------------------- BEGIN - +# +# Initialize values from language.tab, copyright.tab, filetypes.tab, +# thesaurus.tab, and filecategories.tab. +# BEGIN { # Variable initialization $thesaurus_db_file = $Apache::lonnet::perlvar{'lonTabDir'}."/thesaurus.db"; @@ -146,8 +117,11 @@ BEGIN { while (<$fh>) { next if /^\#/; chomp; - my ($key,$two,$country,$three,$enc,$val)=(split(/\t/,$_)); + my ($key,$two,$country,$three,$enc,$val,$sup)=(split(/\t/,$_)); $language{$key}=$val.' - '.$enc; + if ($sup) { + $supported_language{$key}=$sup; + } } } } @@ -230,6 +204,10 @@ BEGIN { =pod +=head1 General Subroutines + +=over 4 + =head1 HTML and Javascript Functions =over 4 @@ -270,7 +248,7 @@ of the element the selection from the se sub browser_and_searcher_javascript { return <Select User"; + '","'.$udomele.'");'."'>".&mt('Select User').""; } if ($ENV{'request.role'}=~/^(au|dc|su)/) { return "Select User"; + '","'.$udomele.'",1);'."'>".&mt('Select User').""; } return ''; } sub coursebrowser_javascript { - return (<<'ENDSTDBRW'); + my ($domainfilter)=@_; + return (< var stdeditbrowser; function opencrsbrowser(formname,uname,udom) { @@ -369,6 +354,12 @@ sub coursebrowser_javascript { url += 'filter='+filter+'&'; } } + var domainfilter='$domainfilter'; + if (domainfilter != null) { + if (domainfilter != '') { + url += 'domainfilter='+domainfilter+'&'; + } + } url += 'form=' + formname + '&cnumelement='+uname+ '&cdomelement='+udom; var title = 'Course_Browser'; @@ -384,7 +375,7 @@ ENDSTDBRW sub selectcourse_link { my ($form,$unameele,$udomele)=@_; return "Select Course"; + '","'.$udomele.'");'."'>".&mt('Select Course').""; } =pod @@ -503,6 +494,7 @@ function select1_changed() { // in with the nuclear for (i=0;i{$value}->{'text'})."\n"; } $result .= "\n"; my %select2 = %{$hashref->{$firstdefault}->{'select2'}}; @@ -526,7 +518,7 @@ END foreach my $value (sort(keys(%select2))) { $result.="