version 1.108, 2001/11/29 20:33:28
|
version 1.109, 2001/12/11 02:18:13
|
Line 103 sub BEGIN {
|
Line 103 sub BEGIN {
|
{ |
{ |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
'/language.tab'); |
'/language.tab'); |
map { |
while (<$fh>) { |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$language{$1}=$2; |
$language{$1}=$2; |
} <$fh>; |
} |
} |
} |
$cprtag{'any'}='Any copyright/distribution'; |
$cprtag{'any'}='Any copyright/distribution'; |
{ |
{ |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonIncludes'}. |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonIncludes'}. |
'/copyright.tab'); |
'/copyright.tab'); |
map { |
while (<$fh>) { |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$cprtag{$1}=$2; |
$cprtag{$1}=$2; |
} <$fh>; |
} |
} |
} |
$mimetag{'any'}='Any type'; |
$mimetag{'any'}='Any type'; |
{ |
{ |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
'/filetypes.tab'); |
'/filetypes.tab'); |
map { |
while (<$fh>) { |
$_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; chomp; |
$_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; chomp; |
$mimetag{$1}=".$1 $3"; |
$mimetag{$1}=".$1 $3"; |
} <$fh>; |
} |
} |
} |
{ |
{ |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. |
'/hosts.tab'); |
'/hosts.tab'); |
map { |
while (<$fh>) { |
$_=~/(\w+?)\:(\w+?)\:(\w+?)\:(.*)/; chomp; |
$_=~/(\w+?)\:(\w+?)\:(\w+?)\:(.*)/; chomp; |
if ($3 eq 'library') { |
if ($3 eq 'library') { |
$hostdomains{$1}=$2; |
$hostdomains{$1}=$2; |
$hostips{$1}=$4; |
$hostips{$1}=$4; |
} |
} |
} <$fh>; |
} |
} |
} |
} |
} |
|
|
Line 376 ENDDOCUMENT
|
Line 376 ENDDOCUMENT
|
|
|
# ----------- grab unprocessed CGI variables that may have been appended to URL |
# ----------- grab unprocessed CGI variables that may have been appended to URL |
sub get_unprocessed_cgi { |
sub get_unprocessed_cgi { |
map { |
foreach (split(/&/,$ENV{'QUERY_STRING'})) { |
my ($name, $value) = split(/=/,$_); |
my ($name, $value) = split(/=/,$_); |
$value =~ tr/+/ /; |
$value =~ tr/+/ /; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
if ($name eq 'catalogmode' or $name eq 'launch' or $name eq 'acts') { |
if ($name eq 'catalogmode' or $name eq 'launch' or $name eq 'acts') { |
$ENV{'form.'.$name}=$value; |
$ENV{'form.'.$name}=$value; |
} |
} |
} (split(/&/,$ENV{'QUERY_STRING'})); |
} |
} |
} |
|
|
# ------------------------------------------------------------- make persistent |
# ------------------------------------------------------------- make persistent |
sub make_persistent { |
sub make_persistent { |
my $persistent=''; |
my $persistent=''; |
|
|
map { |
foreach (keys %ENV) { |
if (/^form\./ && !/submit/) { |
if (/^form\./ && !/submit/) { |
my $name=$_; |
my $name=$_; |
my $key=$name; |
my $key=$name; |
Line 400 sub make_persistent {
|
Line 400 sub make_persistent {
|
<input type='hidden' name='$name' value='$ENV{$key}' /> |
<input type='hidden' name='$name' value='$ENV{$key}' /> |
END |
END |
} |
} |
} (keys %ENV); |
} |
return $persistent; |
return $persistent; |
} |
} |
|
|
Line 580 sub selectbox {
|
Line 580 sub selectbox {
|
my $uctitle=uc($title); |
my $uctitle=uc($title); |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
"</b></font><br />".'<select name="'.$name.'">'; |
"</b></font><br />".'<select name="'.$name.'">'; |
map { |
foreach (sort keys %options) { |
$selout.='<option value=\''.$_.'\''; |
$selout.='<option value=\''.$_.'\''; |
if ($_ eq $value) { $selout.=' selected'; } |
if ($_ eq $value) { $selout.=' selected'; } |
$selout.='>'.$options{$_}.'</option>'; |
$selout.='>'.$options{$_}.'</option>'; |
} sort keys %options; |
} |
return $selout.'</select>'; |
return $selout.'</select>'; |
} |
} |
|
|
Line 1506 RESULTS
|
Line 1506 RESULTS
|
# --------- settings whenever the user causes the search window to be launched |
# --------- settings whenever the user causes the search window to be launched |
sub start_fresh_session { |
sub start_fresh_session { |
delete $hash{'mode_catalog'}; |
delete $hash{'mode_catalog'}; |
map { |
foreach (keys %hash) { |
if ($_ =~ /^pre_/) { |
if ($_ =~ /^pre_/) { |
delete $hash{$_}; |
delete $hash{$_}; |
} |
} |
if ($_ =~ /^store/) { |
if ($_ =~ /^store/) { |
delete $hash{$_}; |
delete $hash{$_}; |
} |
} |
} keys %hash; |
} |
} |
} |
|
|
1; |
1; |