END
- }
+ }
elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
$hash{'mode_catalog'}='groupimport';
$extrafield=''.
@@ -139,6 +157,10 @@ function save_group() {
}
}
function select_group() {
+// window.location="http://"+window.location.hostname+"/adm/groupsort?acts="+document.forms.fileattr.acts.value;
+ window.location="/adm/groupsort?acts="+document.forms.fileattr.acts.value;
+}
+function select_group2() {
var linkflag=false;
for (var num=0; numprint(<
@@ -200,15 +250,79 @@ function openWindow(url, wdwName, w, h,
var newWin = window.open(url, wdwName, options);
newWin.focus();
}
+function gothere(val) {
+ window.location=val+'?acts='+document.forms.fileattr.acts.value;
+}
ENDHEADER
-
+ if ($ENV{'form.catalogmode'} eq 'groupimport') {
+# $r->print($ENV{'form.acts'}." ");
+ my $acts=$ENV{'form.acts'};
+ my @Acts=split(/b/,$acts);
+ my %ahash;
+ my %achash;
+ my $ac=0;
+ map {
+ my ($state,$ref)=split(/a/);
+ $ahash{$ref}=$state;
+ $achash{$ref}=$ac;
+ $ac++;
+ } (@Acts);
+ map {
+ my $key=$_;
+ if ($ahash{$key} eq '1') {
+# $r->print("NEW: ");
+# $r->print($hash{'pre_'.$key.'_title'});
+# $r->print(" : ");
+# $r->print($hash{'pre_'.$key.'_link'});
+# $r->print(" ");
+ $hash{'store_'.$hash{'pre_'.$key.'_link'}}=
+ $hash{'pre_'.$key.'_title'};
+ $hash{'storectr_'.$hash{'pre_'.$key.'_link'}}=
+ $hash{'storectr'}+0;
+ $hash{'storectr'}++;
+ }
+ if ($ahash{$key} eq '0') {
+ if ($hash{'store_'.$hash{'pre_'.$key.'_link'}}) {
+ delete $hash{'store_'.$hash{'pre_'.$key.'_link'}};
+ }
+ }
+ } sort {$achash{$a}<=>$achash{$b}} (keys %ahash);
+ map {
+ if ($_ =~ /^store_/) {
+ my $key=$_;
+ $key=~s/^store_//;
+# $r->print("STORE: ");
+# $r->print($hash{'storectr_'.$key});
+# $r->print(':');
+# $r->print($hash{'store_'.$key});
+# $r->print(':');
+# $r->print($key);
+# $r->print(" ");
+ }
+ } keys %hash;
+ map {
+ if ($_ =~ /^pre_/ && $_ =~/link$/) {
+ my $key = $_;
+ $key =~ s/^pre_//;
+ $key =~ s/_[^_]*$//;
+# $r->print($key);
+# $r->print(':');
+# $r->print($hash{'pre_'.$key.'_title'});
+# $r->print(':');
+# $r->print($hash{'pre_'.$key.'_link'});
+# $r->print(' ');
+ delete $hash{'pre_'.$key.'_title'};
+ delete $hash{'pre_'.$key.'_link'};
+ }
+ } keys %hash;
+ }
+
$r->print('The LearningOnline With CAPA Network Directory Browser '."\n");
- }
- else {
+ } else {
$r->print('Unable to tie hash to db file');
return OK;
}
@@ -232,17 +346,18 @@ ENDHEADER
Display file attributes
");
@@ -321,7 +436,7 @@ END
# --------------------recursive scan of a directory
sub scanDir {
- my ($r,$startdir,$indent)=@_;
+ my ($r,$startdir,$indent,$hashref)=@_;
my ($compuri,$curdir);
my $dirptr=16384;
$indent++;
@@ -347,7 +462,7 @@ sub scanDir {
}
}
}
- &display_line($r,$diropen,$line,$indent,$curdir,@list);
+ &display_line($r,$diropen,$line,$indent,$curdir,$hashref,@list);
&scanDir ($r,$compuri,$indent) if $diropen eq "opened";
}
$indent--;
@@ -416,7 +531,7 @@ sub match_ext {
#------------------- displays one line in appropriate table format
sub display_line{
- my ($r,$diropen,$line,$indent,$startdir,@list)=@_;
+ my ($r,$diropen,$line,$indent,$startdir,$hashref,@list)=@_;
my (@pathfn, $fndir, $fnptr);
my $dirptr=16384;
my $fileclr="#ffffe6";
@@ -439,9 +554,13 @@ sub display_line{
if ($filecom[1] eq "viewOneUp") {
$r->print("$extrafield");
$r->print("\n");
- $r->print (' \n");
@@ -455,9 +574,10 @@ sub display_line{
my $anchor = $filecom[0].'/';
$anchor =~ s/\///g;
$r->print ('');
+ $r->print (' ');
$r->print (' print (' name="'.$msg.'" height="22" type="image" border="0">'."\n");
- $r->print (' print (' print (' border="0"> '."\n");
$r->print("Domain - $listname $tabtag\n");
return OK;
@@ -470,9 +590,10 @@ sub display_line{
$anchor =~ s/\///g;
&begin_form ($r,$curdir);
$r->print (' '."\n");
+ $r->print (' ');
$r->print (' print (' name="'.$msg.'" height="22" type="image" border="0">'."\n");
- $r->print (' ');
+ $r->print (' ');
$r->print ($listname.$tabtag.''."\n");
return OK;
}
@@ -501,11 +622,18 @@ sub display_line{
$title=$listname unless $title;
$r->print("\n");
$r->print(" ");
+ $hash{"pre_${fnum}_link"}=$filelink;
+ $hash{"pre_${fnum}_title"}=$title;
$fnum++;
}
@@ -575,9 +703,10 @@ sub display_line{
}
$r->print (" \n") if $rem > 0;
}
+ $r->print (' ');
$r->print (' print (' name="'.$msg.'" height="22" type="image" border="0">'."\n");
- $r->print (' '."\n");
+ $r->print (' '."\n");
$r->print ("$listname$tabtag\n");
}
@@ -588,10 +717,12 @@ sub begin_form {
my ($r,$uri) = @_;
my $anchor = $uri;
$anchor =~ s/\///g;
- $r->print ('