version 1.86, 2004/01/05 15:02:43
|
version 1.87, 2004/01/26 19:55:44
|
Line 54 use Apache::lonlocal;
|
Line 54 use Apache::lonlocal;
|
use GDBM_File; |
use GDBM_File; |
|
|
# ---------------------------------------- variables used throughout the module |
# ---------------------------------------- variables used throughout the module |
my %hash; # tied to a user-specific gdbm file |
my %hash; # global user-specific gdbm file |
my %dirs; # keys are directories, values are the open/close status |
my %dirs; # keys are directories, values are the open/close status |
my %language; # has the reference information present in language.tab |
my %language; # has the reference information present in language.tab |
|
|
Line 116 sub handler {
|
Line 116 sub handler {
|
%hash = (); |
%hash = (); |
{ |
{ |
my %dbfile; |
my %dbfile; |
if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { |
if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) { |
while(my($key,$value)=each(%dbfile)) { |
while(my($key,$value)=each(%dbfile)) { |
$hash{$key}=$value; |
$hash{$key}=$value; |
} |
} |
Line 360 $r->print(&Apache::loncommon::bodytag('B
|
Line 360 $r->print(&Apache::loncommon::bodytag('B
|
$achash{$ref}=$ac; |
$achash{$ref}=$ac; |
$ac++; |
$ac++; |
} |
} |
# sorting through the actions and changing the tied database hash |
# sorting through the actions and changing the global database hash |
foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { |
foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { |
my $key=$_; |
my $key=$_; |
if ($ahash{$key} eq '1') { |
if ($ahash{$key} eq '1') { |
Line 389 $r->print(&Apache::loncommon::bodytag('B
|
Line 389 $r->print(&Apache::loncommon::bodytag('B
|
} |
} |
|
|
# ---------------------------------- 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'}) { |
for (my $i=0; $i<=9; $i++) { |
for (my $i=0; $i<=9; $i++) { |
delete $hash{'display_attrs_'.$i}; |
delete $hash{'display_attrs_'.$i}; |
if ($ENV{'form.attr'.$i} == 1) { |
if ($ENV{'form.attr'.$i} == 1) { |
Line 402 $r->print(&Apache::loncommon::bodytag('B
|
Line 402 $r->print(&Apache::loncommon::bodytag('B
|
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
} |
} |
} |
} |
|
|
# ------------------------------- output state of file attributes to be showing |
# ------------------------------- output state of file attributes to be showing |
# All versions has to the last item |
# All versions has to the last item |
# since it does not take an extra col |
# since it does not take an extra col |
Line 424 $r->print(&Apache::loncommon::bodytag('B
|
Line 425 $r->print(&Apache::loncommon::bodytag('B
|
enctype="application/x-www-form-urlencoded"> |
enctype="application/x-www-form-urlencoded"> |
<b><font color="#666666">$Displayfileattributes</font></b><br /> |
<b><font color="#666666">$Displayfileattributes</font></b><br /> |
<table border=0><tr> |
<table border=0><tr> |
<td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> $lt{'ti'}</td> |
<td><input type="checkbox" name="attr0" value="1" $attrchk[0] onClick="this.form.submit();" /> $lt{'ti'}</td> |
<td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> $lt{'si'}</td> |
<td><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</td> |
<td><input type="checkbox" name="attr2" value="1" $attrchk[2] /> $lt{'la'}</td> |
<td><input type="checkbox" name="attr2" value="1" $attrchk[2] onClick="this.form.submit();" /> $lt{'la'}</td> |
<td><input type="checkbox" name="attr3" value="1" $attrchk[3] /> $lt{'lm'}</td> |
<td><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</td> |
<td><input type="checkbox" name="attr8" value="1" $attrchk[8] /> $lt{'st'}</td> |
<td><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</td> |
</tr><tr> |
</tr><tr> |
<td><input type="checkbox" name="attr4" value="1" $attrchk[4] /> $lt{'au'}</td> |
<td><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</td> |
<td><input type="checkbox" name="attr5" value="1" $attrchk[5] /> $lt{'kw'}</td> |
<td><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</td> |
<td><input type="checkbox" name="attr6" value="1" $attrchk[6] /> $lt{'ln'}</td> |
<td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td> |
<td><input type="checkbox" name="attr7" value="1" $attrchk[7] /> $lt{'sr'}</td> |
<td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td> |
<td><input type="checkbox" name="attr9" value="1" $attrchk[9] /> $lt{'av'}</td> |
<td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td> |
<td> </td> |
<td> </td> |
</tr></table> |
</tr></table> |
<input type="hidden" name="dirPointer" value="on" /> |
<input type="hidden" name="attrs" value="1" /> |
|
<input type="submit" name="updatedisplay" value="$lt{'ud'}" /> |
<input type="hidden" name="acts" value="" /> |
<input type="hidden" name="acts" value="" /> |
<input type="submit" name="attrs" value="$lt{'ud'}" /> |
$closebutton $groupimportbutton |
$closebutton |
|
$groupimportbutton |
|
</form> |
|
END |
END |
# ---------------------------------------------------------------- Bread crumbs |
# ---------------------------------------------------------------- Bread crumbs |
$r->print(&Apache::lonhtmlcommon::crumbs($uri)); |
$r->print(&Apache::lonhtmlcommon::crumbs($uri,'','', |
|
(($ENV{'form.catalogmode'} eq 'groupimport')? |
|
'document.forms.fileattr':'')). |
|
&Apache::lonhtmlcommon::select_recent('residx','resrecent', |
|
'this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'). |
|
'</form>'); |
# ------------------------------------------------------ Remember where we were |
# ------------------------------------------------------ Remember where we were |
&Apache::loncommon::storeresurl($uri); |
&Apache::loncommon::storeresurl($uri); |
|
&Apache::lonhtmlcommon::store_recent('residx',$uri,$uri); |
# ----------------- output starting row to the indexed file/directory hierarchy |
# ----------------- output starting row to the indexed file/directory hierarchy |
my $titleclr="#ddffff"; |
my $titleclr="#ddffff"; |
# $r->print(&initdebug()); |
# $r->print(&initdebug()); |
Line 502 END
|
Line 507 END
|
} |
} |
} |
} |
|
|
my $bredir = $ENV{'form.dirPointer'}; |
|
my $toplevel; |
my $toplevel; |
my $indent = 0; |
my $indent = 0; |
$uri = $uri.'/' if $uri !~ /.*\/$/; |
$uri = $uri.'/' if $uri !~ /.*\/$/; |
|
|
if ($bredir ne 'on') { |
|
$hash{'top.level'} = $uri; |
|
$toplevel = $uri; |
|
|
|
} else { |
$hash{'top.level'} = $uri; |
$toplevel = $hash{'top.level'}; |
$toplevel = $uri; |
} |
|
|
|
# -------------------------------- if not at top level, provide an uplink arrow |
# -------------------------------- if not at top level, provide an uplink arrow |
if ($toplevel ne '/res/'){ |
if ($toplevel ne '/res/'){ |
Line 538 END
|
Line 538 END
|
|
|
# --------------------------------------------------- end the output and return |
# --------------------------------------------------- end the output and return |
$r->print('</body></html>'."\n"); |
$r->print('</body></html>'."\n"); |
# } else { |
|
# $r->print('<html><head></head><body>Unable to tie hash to db '. |
|
# 'file</body></html>'); |
|
# return OK; |
|
} |
} |
if(! $c->aborted()) { |
if(! $c->aborted()) { |
|
# write back into the temporary file |
my %dbfile; |
my %dbfile; |
if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_NEWDB(),0640)) { |
if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_NEWDB(),0640)) { |
while (my($key,$value) = each(%hash)) { |
while (my($key,$value) = each(%hash)) { |
Line 610 sub get_list {
|
Line 607 sub get_list {
|
my ($r,$uri)=@_; |
my ($r,$uri)=@_; |
my @list; |
my @list; |
(my $luri = $uri) =~ s/\//_/g; |
(my $luri = $uri) =~ s/\//_/g; |
|
if ($ENV{'form.updatedisplay'}) { |
if ($ENV{'form.attrs'} eq &mt('Update Display')) { |
|
foreach (keys %hash) { |
foreach (keys %hash) { |
delete $hash{$_} if ($_ =~ /^dirlist_files_/); |
delete $hash{$_} if ($_ =~ /^dirlist_files_/); |
} |
} |
} |
} |
|
|
if ($hash{'dirlist_files'.$luri}) { |
if ($hash{'dirlist_files_'.$luri}) { |
@list = split(/\n/,$hash{'dirlist_files_'.$luri}); |
@list = split(/\n/,$hash{'dirlist_files_'.$luri}); |
} else { |
} else { |
@list = &Apache::lonnet::dirlist($uri); |
@list = &Apache::lonnet::dirlist($uri); |
$hash{'dirlist_files_'.$luri} = join('\n',@list); |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
} |
} |
return @list=&match_ext($r,@list); |
return @list=&match_ext($r,@list); |
} |
} |
Line 729 sub display_line {
|
Line 725 sub display_line {
|
|
|
# display domain |
# display domain |
if ($filecom[1] eq 'domain') { |
if ($filecom[1] eq 'domain') { |
$r->print ('<input type="hidden" name="dirPointer" value="on">'."\n") |
|
if ($ENV{'form.dirPointer'} eq "on"); |
|
$r->print("<tr valign='$valign' bgcolor=$fileclr>$extrafield"); |
$r->print("<tr valign='$valign' bgcolor=$fileclr>$extrafield"); |
$r->print("<td>"); |
$r->print("<td>"); |
&begin_form ($r,$filecom[0]); |
&begin_form ($r,$filecom[0]); |
Line 1015 sub begin_form {
|
Line 1009 sub begin_form {
|
'enctype="application/x-www-form-urlencoded">'."\n"); |
'enctype="application/x-www-form-urlencoded">'."\n"); |
$r->print ('<input type="hidden" name="openuri" value="'.$uri.'">'. |
$r->print ('<input type="hidden" name="openuri" value="'.$uri.'">'. |
"\n"); |
"\n"); |
$r->print ('<input type="hidden" name="dirPointer" value="on">'."\n"); |
|
$dnum++; |
$dnum++; |
} |
} |
|
|