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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 06 May 2004 17:54:11 -0000


matthew		Thu May  6 13:54:11 2004 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  &breadcrumbs: link to main menu should break out of frames, so set
  target=>'_top'
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.68 loncom/interface/lonhtmlcommon.pm:1.69
--- loncom/interface/lonhtmlcommon.pm:1.68	Wed May  5 10:12:54 2004
+++ loncom/interface/lonhtmlcommon.pm	Thu May  6 13:54:11 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.68 2004/05/05 14:12:54 matthew Exp $
+# $Id: lonhtmlcommon.pm,v 1.69 2004/05/06 17:54:11 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -980,9 +980,10 @@
         if ($menulink && exists($ENV{'request.course.id'}) && $ENV{'request.course.id'} ne '') {
             my $cid = $ENV{'request.course.id'};
             unshift(@Crumbs,{
-                             href=>'/adm/menu',
-                             title=>'Go to main menu',
-                             text=>$ENV{'course.'.$cid.'.description'},
+                             href   =>'/adm/menu',
+                             title  =>'Go to main menu',
+                             target =>'_top',
+                             text   =>$ENV{'course.'.$cid.'.description'},
                             });
         }
         my $links .= 
@@ -990,8 +991,13 @@
                  map {
                      $faq = $_->{'faq'} if (exists($_->{'faq'}));
                      $bug = $_->{'bug'} if (exists($_->{'bug'}));
-                     '<a href="'.$_->{'href'}.'" title="'.&mt($_->{'title'}).'">'.
-                         &mt($_->{'text'}).'</a>' 
+                     my $result = '<a href="'.$_->{'href'}.'" ';
+                     if (defined($_->{'target'}) && $_->{'target'} ne '') {
+                         $result .= 'target="'.$_->{'target'}.'" ';
+                     }
+                     $result .='title="'.&mt($_->{'title'}).'">'.
+                         &mt($_->{'text'}).'</a>';
+                     $result;
                      } @Crumbs
                  );
         $links .= '-&gt;' if ($links ne '');