version 1.14, 2001/08/07 14:02:27
|
version 1.15, 2001/08/07 15:14:51
|
Line 56 sub handler {
|
Line 56 sub handler {
|
my $tabdir = $r->dir_config('lonTabDir'); |
my $tabdir = $r->dir_config('lonTabDir'); |
|
|
my $fileclr='#ffffe6'; |
my $fileclr='#ffffe6'; |
|
my $line; |
|
my (@attrchk,@openpath); |
|
my $uri=$r->uri; |
|
|
# -------------------------------------- see if called from an interactive mode |
# -------------------------------------- see if called from an interactive mode |
map { |
map { |
my ($name, $value) = split(/=/,$_); |
my ($name, $value) = split(/=/,$_); |
Line 63 sub handler {
|
Line 67 sub handler {
|
$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') { |
if ($name eq 'catalogmode') { |
$ENV{'form.'.$name}=$value; |
$ENV{'form.'.$name}=$value; |
} |
} |
|
if ($name eq 'launch') { |
|
$ENV{'form.'.$name}=$value; |
|
} |
} (split(/&/,$ENV{'QUERY_STRING'})); |
} (split(/&/,$ENV{'QUERY_STRING'})); |
|
|
$hidden=''; my $closebutton=''; |
$hidden=''; my $closebutton=''; |
Line 71 sub handler {
|
Line 78 sub handler {
|
my $colspan=''; |
my $colspan=''; |
|
|
$extrafield=''; |
$extrafield=''; |
if ($ENV{'form.catalogmode'} eq 'interactive') { |
my $diropendb = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; |
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
|
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { |
' border="0"></td>'; |
if ($ENV{'form.launch'} eq '1') { |
$colspan=" colspan='2' "; |
delete $hash{'mode_catalog'}; |
$hidden=<<END; |
} |
|
if ($hash{'mode_catalog'} eq 'interactive') { |
|
$ENV{'form.catalogmode'}='interactive'; |
|
} |
|
if ($hash{'mode_catalog'} eq 'groupimport') { |
|
$ENV{'form.catalogmode'}='groupimport'; |
|
} |
|
|
|
if ($ENV{'form.catalogmode'} eq 'interactive') { |
|
$hash{'mode_catalog'}='interactive'; |
|
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
|
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
|
' border="0"></td>'; |
|
$colspan=" colspan='2' "; |
|
$hidden=<<END; |
<input type='hidden' name='catalogmode' value='interactive'> |
<input type='hidden' name='catalogmode' value='interactive'> |
END |
END |
$closebutton=<<END; |
$closebutton=<<END; |
<input type="button" name="close" value='CLOSE' onClick="self.close()"> |
<input type="button" name="close" value='CLOSE' onClick="self.close()"> |
END |
END |
} |
} |
elsif ($ENV{'form.catalogmode'} eq 'groupimport') { |
elsif ($ENV{'form.catalogmode'} eq 'groupimport') { |
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
$hash{'mode_catalog'}='groupimport'; |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
' border="0"></td>'; |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
$colspan=" colspan='2' "; |
' border="0"></td>'; |
$hidden=<<END; |
$colspan=" colspan='2' "; |
|
$hidden=<<END; |
<input type='hidden' name='catalogmode' value='groupimport'> |
<input type='hidden' name='catalogmode' value='groupimport'> |
END |
END |
$closebutton=<<END; |
$closebutton=<<END; |
<input type="button" name="close" value='CLOSE' onClick="self.close()"> |
<input type="button" name="close" value='CLOSE' onClick="self.close()"> |
END |
END |
$groupimportbutton=<<END; |
$groupimportbutton=<<END; |
<input type="button" name="groupimport" value='GROUP IMPORT' onClick="javascript:select_group()"> |
<input type="button" name="groupimport" value='GROUP IMPORT' onClick="javascript:select_group()"> |
END |
END |
} |
} |
|
|
my $catalogmodefunctions=''; |
my $catalogmodefunctions=''; |
if ($ENV{'form.catalogmode'} eq 'interactive' or |
if ($ENV{'form.catalogmode'} eq 'interactive' or |
$ENV{'form.catalogmode'} eq 'groupimport') { |
$ENV{'form.catalogmode'} eq 'groupimport') { |
$catalogmodefunctions=<<END; |
$catalogmodefunctions=<<END; |
function select_data(title,url) { |
function select_data(title,url) { |
changeTitle(title); |
changeTitle(title); |
changeURL(url); |
changeURL(url); |
Line 161 function changeURL(val) {
|
Line 183 function changeURL(val) {
|
} |
} |
} |
} |
END |
END |
} |
} |
|
|
# ---------------------------------------------------------------- Print Header |
# ---------------------------------------------------------------- Print Header |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
<html> |
<html> |
<head> |
<head> |
<title>The LearningOnline Network With CAPA Directory Browser</title> |
<title>The LearningOnline Network With CAPA Directory Browser</title> |
Line 184 function openWindow(url, wdwName, w, h,
|
Line 206 function openWindow(url, wdwName, w, h,
|
<body bgcolor="#FFFFFF"> |
<body bgcolor="#FFFFFF"> |
ENDHEADER |
ENDHEADER |
|
|
my $line; |
$r->print('<h2><font color="#888888">The LearningOnline With CAPA Network Directory Browser</font></h2>'."\n"); |
my (@attrchk,@openpath); |
} |
my $uri=$r->uri; |
else { |
|
$r->print('<html><head></head><body>Unable to tie hash to db file</body></html>'); |
$r->print('<h2><font color="#888888">The LearningOnline With CAPA Network Directory Browser</font></h2>'."\n"); |
return OK; |
|
} |
my $diropendb = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; |
untie %hash; |
|
|
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { |
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { |
|
|
if ($ENV{'form.attrs'} ne "") { |
if ($ENV{'form.attrs'} ne "") { |
Line 207 ENDHEADER
|
Line 228 ENDHEADER
|
$attrchk[$i] = "checked" if $hash{'display_attrs_'.$i} == 1; |
$attrchk[$i] = "checked" if $hash{'display_attrs_'.$i} == 1; |
} |
} |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<b><font color="#666666">Display file attributes</font></b><br> |
<b><font color="#666666">Display file attributes</font></b><br> |
<form method="post" name="fileattr" action="$uri" enctype="application/x-www-form-urlencoded"> |
<form method="post" name="fileattr" action="$uri" enctype="application/x-www-form-urlencoded"> |
<table border=0><tr> |
<table border=0><tr> |
Line 228 $groupimportbutton
|
Line 249 $groupimportbutton
|
</form> |
</form> |
END |
END |
|
|
my $titleclr="#ddffff"; |
my $titleclr="#ddffff"; |
$r->print("<table border=0><tr><td bgcolor=#eeeeee>\n"); |
$r->print("<table border=0><tr><td bgcolor=#eeeeee>\n"); |
$r->print("<table border=0><tr>\n"); |
$r->print("<table border=0><tr>\n"); |
$r->print("<td $colspan bgcolor=$titleclr><b>Name</b></td>\n"); |
$r->print("<td $colspan bgcolor=$titleclr><b>Name</b></td>\n"); |
$r->print("<td bgcolor=$titleclr align=right><b>Size (bytes) </b></td>\n") if ($hash{'display_attrs_0'} == 1); |
$r->print("<td bgcolor=$titleclr align=right><b>Size (bytes) </b></td>\n") if ($hash{'display_attrs_0'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Last accessed</b></td>\n") if ($hash{'display_attrs_1'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Last accessed</b></td>\n") if ($hash{'display_attrs_1'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Last modified</b></td>\n") if ($hash{'display_attrs_2'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Last modified</b></td>\n") if ($hash{'display_attrs_2'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Author(s)</b></td>\n") if ($hash{'display_attrs_3'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Author(s)</b></td>\n") if ($hash{'display_attrs_3'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Keywords</b></td>\n") if ($hash{'display_attrs_4'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Keywords</b></td>\n") if ($hash{'display_attrs_4'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Language</b></td>\n") if ($hash{'display_attrs_5'} == 1); |
$r->print("<td bgcolor=$titleclr><b>Language</b></td>\n") if ($hash{'display_attrs_5'} == 1); |
$r->print("</tr>"); |
$r->print("</tr>"); |
|
|
map { |
map { |
if ($_ =~ /^diropen_status_/) { |
if ($_ =~ /^diropen_status_/) { |