[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Thu, 07 Mar 2002 20:12:36 -0000
matthew Thu Mar 7 15:12:36 2002 EDT
Modified files:
/loncom/interface lonsearchcat.pm
Log:
Minor cleanups, preparing for the road ahead.
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.115 loncom/interface/lonsearchcat.pm:1.116
--- loncom/interface/lonsearchcat.pm:1.115 Thu Jan 17 08:53:45 2002
+++ loncom/interface/lonsearchcat.pm Thu Mar 7 15:12:36 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.115 2002/01/17 13:53:45 harris41 Exp $
+# $Id: lonsearchcat.pm,v 1.116 2002/03/07 20:12:36 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -118,16 +118,17 @@
sub handler {
my $r = shift;
untie %hash;
- &get_unprocessed_cgi();
$r->content_type('text/html');
$r->send_http_header;
return OK if $r->header_only;
$domain = $r->dir_config('lonDefDomain');
-
$diropendb= "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_searchcat.db";
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['catalogmode','launch','acts']);
+
if ($ENV{'form.launch'} eq '1') {
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) {
&start_fresh_session();
@@ -305,7 +306,7 @@
<script type="text/javascript">
function openhelp(val) {
openhelpwin=open('/adm/help/searchcat.html','helpscreen',
- 'scrollbars=1,width=400,height=300');
+ 'scrollbars=1,width=600,height=300');
openhelpwin.focus();
}
</script>
@@ -355,18 +356,6 @@
return OK;
}
-# ----------- grab unprocessed CGI variables that may have been appended to URL
-sub get_unprocessed_cgi {
- foreach (split(/&/,$ENV{'QUERY_STRING'})) {
- my ($name, $value) = split(/=/,$_);
- $value =~ tr/+/ /;
- $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') {
- $ENV{'form.'.$name}=$value;
- }
- }
-}
-
# ------------------------------------------------------------- make persistent
sub make_persistent {
my $persistent='';
@@ -975,7 +964,7 @@
$grid.=$sk;
my $hc;
if ($rhash{$sk} eq 'con_lost') {
- $hc="!!!BAD CONNECTION, CONTACT SYSTEM ADMINISTRATOR!!!";
+ $hc="BAD CONNECTION, CONTACT SYSTEM ADMINISTRATOR ";
}
else {
$hc="'+\"'\"+\"+hc['$sk']+\"+\"'\"+'";
@@ -994,7 +983,7 @@
}
$r->print(<<ENDPOP);
<script type="text/javascript">
- popwin=open('','popwin','scrollbars=1,width=400,height=200');
+ popwin=open('','popwin','scrollbars=1,width=400,height=220');
popwin.focus();
popwin.document.writeln('<'+'html>');
popwin.document.writeln('<'+'head>');
@@ -1022,7 +1011,7 @@
$grid
'<'+'br />'+
'Server details '+
- '<'+'input type="text" size="25" name="sdetails"'+
+ '<'+'input type="text" size="35" name="sdetails"'+
' value="" />'+
'<'+'br />'+
' <'+'input type="button" name="button"'+
@@ -1232,10 +1221,9 @@
END
if ($ENV{'form.catalogmode'} eq 'interactive') {
my $titleesc=$title;
- $titleesc=~s/\'/\\'/;
+ $titleesc=~s/\'/\\'/; # '
- $compiledresult.=<<END
- if $ENV{'form.catalogmode'} eq 'interactive';
+ $compiledresult.=<<END if ($ENV{'form.catalogmode'} eq 'interactive');
<font size='-1'><INPUT TYPE="button" NAME="returnvalues" VALUE="SELECT"
onClick="javascript:select_data('$titleesc','$url')">
</font>