version 1.45, 2002/06/29 19:55:19
|
version 1.51, 2002/08/20 13:01:53
|
Line 90 my @Omit = ();
|
Line 90 my @Omit = ();
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
$r->content_type('text/html'); |
$r->content_type('text/html'); |
|
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
$fnum=0; |
$fnum=0; |
Line 130 sub handler {
|
Line 131 sub handler {
|
my $diropendb = |
my $diropendb = |
"/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; |
"/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; |
|
|
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { |
if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { |
if ($ENV{'form.launch'} eq '1') { |
if ($ENV{'form.launch'} eq '1') { |
&start_fresh_session(); |
&start_fresh_session(); |
} |
} |
# -------------------- refresh environment with user database values (in %hash) |
# -------------------- refresh environment with user database values (in %hash) |
if ($hash{'mode_catalog'} eq 'interactive') { |
&setvalues(\%hash,'form.catalogmode',\%ENV,'form.catalogmode' ); |
$ENV{'form.catalogmode'}='interactive'; |
|
} |
|
if ($hash{'mode_catalog'} eq 'groupimport') { |
|
$ENV{'form.catalogmode'}='groupimport'; |
|
} |
|
|
|
# --------------------- define extra fields and buttons in case of special mode |
# --------------------- define extra fields and buttons in case of special mode |
if ($ENV{'form.catalogmode'} eq 'interactive') { |
if ($ENV{'form.catalogmode'} eq 'interactive') { |
$hash{'mode_catalog'}='interactive'; |
|
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
' border="0" /></td>'; |
' border="0" /></td>'; |
Line 154 sub handler {
|
Line 149 sub handler {
|
END |
END |
} |
} |
elsif ($ENV{'form.catalogmode'} eq 'groupimport') { |
elsif ($ENV{'form.catalogmode'} eq 'groupimport') { |
$hash{'mode_catalog'}='groupimport'; |
|
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
$extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'. |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'. |
' border="0" /></td>'; |
' border="0" /></td>'; |
Line 176 END
|
Line 170 END
|
# $element is the name of the element in $formname which receives |
# $element is the name of the element in $formname which receives |
# the URL. |
# the URL. |
# &Apache::lonxml::debug('Checking mode, form, element'); |
# &Apache::lonxml::debug('Checking mode, form, element'); |
&setvalues(\%hash,'form_mode' ,\%ENV,'form.mode' ); |
&setvalues(\%hash,'form.mode' ,\%ENV,'form.mode' ); |
&setvalues(\%hash,'form_form' ,\%ENV,'form.form' ); |
&setvalues(\%hash,'form.form' ,\%ENV,'form.form' ); |
&setvalues(\%hash,'form_element',\%ENV,'form.element'); |
&setvalues(\%hash,'form.element',\%ENV,'form.element'); |
&setvalues(\%hash,'form_only' ,\%ENV,'form.only' ); |
&setvalues(\%hash,'form.only' ,\%ENV,'form.only' ); |
&setvalues(\%hash,'form_omit' ,\%ENV,'form.omit' ); |
&setvalues(\%hash,'form.omit' ,\%ENV,'form.omit' ); |
|
|
# Deal with 'omit' and 'only' |
# Deal with 'omit' and 'only' |
if (exists $ENV{'form.omit'}) { |
if (exists $ENV{'form.omit'}) { |
Line 426 END
|
Line 420 END
|
# $r->print(&initdebug()); |
# $r->print(&initdebug()); |
# $r->print(&writedebug("Omit:@Omit")) if (@Omit); |
# $r->print(&writedebug("Omit:@Omit")) if (@Omit); |
# $r->print(&writedebug("Only:@Only")) if (@Only); |
# $r->print(&writedebug("Only:@Only")) if (@Only); |
$r->print("<table width='100\%' border=0><tr><td bgcolor=#990404>\n"); |
$r->print("<table width='100\%' border=0><tr><td bgcolor=#777777>\n"); |
$r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n"); |
$r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n"); |
$r->print("<td $colspan><b>Name</b></td>\n"); |
$r->print("<td $colspan><b>Name</b></td>\n"); |
$r->print("<td><b>Title</b></td>\n") |
$r->print("<td><b>Title</b></td>\n") |
Line 695 sub display_line {
|
Line 689 sub display_line {
|
$r->print ('<a href="javascript:gothere(\''.$filecom[0]. |
$r->print ('<a href="javascript:gothere(\''.$filecom[0]. |
'/\')"><img src="'.$iconpath.'server.gif"'); |
'/\')"><img src="'.$iconpath.'server.gif"'); |
$r->print (' border="0" /></a>'."\n"); |
$r->print (' border="0" /></a>'."\n"); |
$r->print("Domain - $listname $tabtag</tr></form>\n"); |
$r->print("Domain - $listname (". |
|
$Apache::lonnet::domaindescription{$listname}.") $tabtag</tr></form>\n"); |
return OK; |
return OK; |
|
|
# display user directory |
# display user directory |
Line 723 sub display_line {
|
Line 718 sub display_line {
|
|
|
# display file |
# display file |
if ($fnptr == 0 and $filecom[3] ne '') { |
if ($fnptr == 0 and $filecom[3] ne '') { |
|
my $filelink = $startdir.$filecom[0]; |
|
return OK if (!&Apache::lonnet::allowed('bre',$filelink)); |
my @file_ext = split (/\./,$listname); |
my @file_ext = split (/\./,$listname); |
my $curfext = $file_ext[-1]; |
my $curfext = $file_ext[-1]; |
if (@Omit) { |
if (@Omit) { |
Line 740 sub display_line {
|
Line 737 sub display_line {
|
$iconname = $curfext.".gif" unless |
$iconname = $curfext.".gif" unless |
(!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn'); |
(!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn'); |
# |
# |
my $filelink = $startdir.$filecom[0]; |
|
$r->print("<tr bgcolor=$fileclr><td nowrap valign='bottom'>"); |
$r->print("<tr bgcolor=$fileclr><td nowrap valign='bottom'>"); |
my $metafile = grep /^$filecom[0]\.meta\&/, @list; |
my $metafile = grep /^$filecom[0]\.meta\&/, @list; |
my $title; |
my $title; |
Line 901 sub begin_form {
|
Line 897 sub begin_form {
|
|
|
# --------- settings whenever the user causes the indexer window to be launched |
# --------- settings whenever the user causes the indexer window to be launched |
sub start_fresh_session { |
sub start_fresh_session { |
delete $hash{'mode_catalog'}; |
delete $hash{'form.catalogmode'}; |
delete $hash{'form_mode'}; |
delete $hash{'form.mode'}; |
delete $hash{'form_form'}; |
delete $hash{'form.form'}; |
delete $hash{'form_element'}; |
delete $hash{'form.element'}; |
delete $hash{'form_omit'}; |
delete $hash{'form.omit'}; |
delete $hash{'form_only'}; |
delete $hash{'form.only'}; |
foreach (keys %hash) { |
foreach (keys %hash) { |
if ($_ =~ /^pre_/) { |
delete $hash{$_} if (/^(pre_|store)/); |
delete $hash{$_}; |
|
} |
|
if ($_ =~ /^store/) { |
|
delete $hash{$_}; |
|
} |
|
} |
} |
} |
} |
|
|