--- loncom/homework/Attic/lonindexer.pm 2000/02/22 21:33:18 1.1
+++ loncom/homework/Attic/lonindexer.pm 2000/08/04 19:24:12 1.4
@@ -3,6 +3,7 @@
# (Login Screen
# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer)
# 11/23 Gerd Kortemeyer
+# 07/20-08/04 H.K. Ng
#
package Apache::lonindexer;
@@ -33,6 +34,312 @@ sub handler {
ENDHEADER
+
+ my $line;
+ my (@attrchk,@openpath);
+ my $uri=$r->uri;
+ my $iconpath="/res/adm/pages/indexericons/";
+
+ $r->print("The LearningOnline Network Directory Browser
\n");
+
+ for (my $i=0; $i<=5; $i++) {
+ $attrchk[$i] = "checked" if $ENV{'form.attr'.$i} == 1;
+ }
+ $r->print(<Display file attributes
+
+END
+ my $titleclr="#ddffff";
+ my $fileclr="#ffffdd";
+
+ $r->print("\n");
+ $r->print("\n");
+ $r->print("Name | \n");
+ $r->print("Size (bytes) | \n") if ($ENV{'form.attr0'} == 1);
+ $r->print("Last accessed | \n") if ($ENV{'form.attr1'} == 1);
+ $r->print("Last modified | \n") if ($ENV{'form.attr2'} == 1);
+ $r->print(" ");
+
+ if ($ENV{'form.openuri'} =~ /$uri\&/) {
+ my @pathcom = split(/\//,$uri);
+ pop @pathcom;
+ my $splituri = join ('/',@pathcom);
+ $uri = join ('',$splituri,"/");
+ }
+
+
+ my $openuri = $ENV{'form.openuri'};
+# $r->print (" openuri=$openuri ");
+ $openuri =~ s/$uri(.*)\&//g;
+# $r->print (" parsed openuri=$openuri ");
+ @openpath = split(/\&/,$openuri);
+# $r->print (" open path=@openpath ");
+ push @openpath, $uri;
+# $r->print (" append current uri to open path=@openpath ");
+ @openpath = sort @openpath;
+# $r->print (" sorted open path=@openpath ");
+
+
+ my $indent = -1;
+ &display_line ($r,1,"/res/".$domain."&domain");
+ &branch ($r,"/res/".$domain."/",$indent,@openpath);
+
+ $r->print(" ");
+ $r->print(" |
");
+ $r->print("