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

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 18:05:30 -0000


raeburn		Tue Sep 14 14:05:30 2004 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Guy's 8/30 modification so sort by title ignores leading spaces in titles.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.288 loncom/interface/lonnavmaps.pm:1.289
--- loncom/interface/lonnavmaps.pm:1.288	Mon Sep 13 16:06:57 2004
+++ loncom/interface/lonnavmaps.pm	Tue Sep 14 14:05:30 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.288 2004/09/13 20:06:57 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.289 2004/09/14 18:05:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1685,7 +1685,12 @@
 		return &$oldFilterFunc($res);
 	    };
 	@resources=$navmap->retrieveResources(undef,$filterFunc);
-	@resources= sort {lc($a->compTitle) cmp lc($b->compTitle)} @resources;
+	@resources= sort {
+	    my ($atitle,$btitle) = (lc($a->compTitle),lc($b->compTitle));
+	    $atitle=~s/^\s*//;
+	    $btitle=~s/^\s*//;
+	    return $atitle cmp $btitle
+	    } @resources;
     } elsif ($args->{'sort'} eq 'duedate') {
 	@resources=$navmap->retrieveResources(undef,
 					       sub { shift->is_problem(); });