version 1.46, 2002/07/02 21:08:24
|
version 1.53, 2002/12/02 17:53:24
|
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 333 function gothere(val) {
|
Line 327 function gothere(val) {
|
</script> |
</script> |
|
|
</head> |
</head> |
<body bgcolor="#FFFFFF"> |
|
ENDHEADER |
ENDHEADER |
|
$r->print(&Apache::loncommon::bodytag('Browse Resources')); |
# - Evaluate actions from previous page (both cumulatively and chronologically) |
# - Evaluate actions from previous page (both cumulatively and chronologically) |
if ($ENV{'form.catalogmode'} eq 'groupimport') { |
if ($ENV{'form.catalogmode'} eq 'groupimport') { |
my $acts=$ENV{'form.acts'}; |
my $acts=$ENV{'form.acts'}; |
Line 378 ENDHEADER
|
Line 371 ENDHEADER
|
} |
} |
} |
} |
|
|
# ---------------------------------------------------------------- output title |
|
$r->print( |
|
'<h2><font color="#339933">The Learning<i>Online</i> Network with CAPA '. |
|
'Network Directory Browser</font></h2>'."\n"); |
|
# ---------------------------------- get state of file attributes to be showing |
# ---------------------------------- get state of file attributes to be showing |
if ($ENV{'form.attrs'} ne '') { |
if ($ENV{'form.attrs'} ne '') { |
for (my $i=0; $i<=7; $i++) { |
for (my $i=0; $i<=7; $i++) { |
Line 525 sub scanDir {
|
Line 514 sub scanDir {
|
my %dupdirs = %dirs; |
my %dupdirs = %dirs; |
my @list=&get_list($r,$startdir); |
my @list=&get_list($r,$startdir); |
foreach my $line (@list) { |
foreach my $line (@list) { |
my ($strip,$dom,$foo,$testdir,$foo)=split(/\&/,$line,5); |
my ($strip,$dom,undef,$testdir,undef)=split(/\&/,$line,5); |
next if $strip =~ /.*\.meta$/; |
next if $strip =~ /.*\.meta$/; |
my (@fileparts) = split(/\./,$strip); |
my (@fileparts) = split(/\./,$strip); |
if ($hash{'display_attrs_7'} != 1) { |
if ($hash{'display_attrs_7'} != 1) { |
Line 550 sub scanDir {
|
Line 539 sub scanDir {
|
while (my ($key,$val)= each %dupdirs) { |
while (my ($key,$val)= each %dupdirs) { |
if ($key eq $compuri and $val eq "open") { |
if ($key eq $compuri and $val eq "open") { |
$diropen = "opened"; |
$diropen = "opened"; |
delete $dupdirs{key},$dirs{$key}; |
delete($dupdirs{$key}); |
|
delete($dirs{$key}); |
} |
} |
} |
} |
} |
} |
Line 636 sub match_ext {
|
Line 626 sub match_ext {
|
# ------------------------------- displays one line in appropriate table format |
# ------------------------------- displays one line in appropriate table format |
sub display_line { |
sub display_line { |
my ($r,$diropen,$line,$indent,$startdir,$hashref,@list)=@_; |
my ($r,$diropen,$line,$indent,$startdir,$hashref,@list)=@_; |
my (@pathfn, $fndir, $fnptr); |
my (@pathfn, $fndir); |
my $dirptr=16384; |
my $dirptr=16384; |
my $fileclr="#ffffe6"; |
my $fileclr="#ffffe6"; |
my $iconpath= $r->dir_config('lonIconsURL') . '/'; |
my $iconpath= $r->dir_config('lonIconsURL') . '/'; |
Line 695 sub display_line {
|
Line 685 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 714 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 733 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 893 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{$_}; |
|
} |
|
} |
} |
} |
} |
|
|