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

raeburn raeburn at source.lon-capa.org
Tue Oct 4 10:38:08 EDT 2022


raeburn		Tue Oct  4 14:38:08 2022 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - For text in link to a folder in the breadcrumbs trail, use ellipsis if
    there in no folder title.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.560 loncom/interface/lonnavmaps.pm:1.561
--- loncom/interface/lonnavmaps.pm:1.560	Mon Jun 27 20:35:51 2022
+++ loncom/interface/lonnavmaps.pm	Tue Oct  4 14:38:08 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.560 2022/06/27 20:35:51 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.561 2022/10/04 14:38:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3078,8 +3078,12 @@
         my $pc = $map->map_pc();
         next if ((!$pc) || ($pc == 1));
         push(@links,$map);
-        push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,});
-        $totallength += length($map->title());
+        my $text = $map->title();
+        if ($text eq '') {
+            $text = '...';
+        }
+        push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $text,'no_mt' => 1,});
+        $totallength += length($text);
     }
     my $numlinks = scalar(@links);
     if ($numlinks) {
@@ -3091,7 +3095,11 @@
             }
             @revmapinfo = ();
             foreach my $map (@links) {
-                my $showntitle = &truncate_crumb_text($map->title(),$avg);
+                my $title = $map->title();
+                if ($title eq '') {
+                    $title = '...';
+                }
+                my $showntitle = &truncate_crumb_text($title,$avg);
                 if ($showntitle ne '') {
                     push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $showntitle,'no_mt' => 1,});
                 }




More information about the LON-CAPA-cvs mailing list