[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 22 Dec 2003 18:58:26 -0000


www		Mon Dec 22 13:58:26 2003 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Bread crumbs on top of lonindexer.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.81 loncom/interface/lonindexer.pm:1.82
--- loncom/interface/lonindexer.pm:1.81	Mon Dec  8 13:29:50 2003
+++ loncom/interface/lonindexer.pm	Mon Dec 22 13:58:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.81 2003/12/08 18:29:50 sakharuk Exp $
+# $Id: lonindexer.pm,v 1.82 2003/12/22 18:58:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -83,6 +83,20 @@
 my @Omit = ();
 
 
+# ------------------------------------------------------- Puts directory header
+
+sub crumbs {
+    my $uri=shift;
+    my $output='<br /><tt><b><font size="+2">/';
+    my $path='/';
+    foreach (split('/',$uri)) {
+	unless ($_) { next; }
+	$path.=$_.'/';
+	$output.='<a href="'.$path.'">'.$_.'</a>/';
+    }
+    return $output.'</font></b></tt><br />';
+}
+
 # ----------------------------- Handling routine called via Apache and mod_perl
 sub handler {
     my $r = shift;
@@ -458,7 +472,8 @@
 $groupimportbutton
 </form>
 END
-
+# ---------------------------------------------------------------- Bread crumbs
+        $r->print(&crumbs($uri));
 # ----------------- output starting row to the indexed file/directory hierarchy
         my $titleclr="#ddffff";
 #        $r->print(&initdebug());