[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface loncommon.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 27 Sep 2006 22:42:25 -0000


albertel		Wed Sep 27 18:42:25 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/homework	structuretags.pm 
  Log:
  - best just to stop attepmting to &mt() the title of a resource
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.459 loncom/interface/loncommon.pm:1.460
--- loncom/interface/loncommon.pm:1.459	Fri Sep 22 15:59:30 2006
+++ loncom/interface/loncommon.pm	Wed Sep 27 18:42:05 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.459 2006/09/22 19:59:30 albertel Exp $
+# $Id: loncommon.pm,v 1.460 2006/09/27 22:42:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2854,6 +2854,9 @@
 =item * $no_inline_link, if true and in remote mode, don't show the 
          'Switch To Inline Menu' link
 
+=item * $args, optional argument valid values are
+            no_auto_mt_title -> prevents &mt()ing the title arg
+
 =back
 
 Returns: A uniform header for LON-CAPA web pages.  
@@ -2865,9 +2868,9 @@
 
 sub bodytag {
     my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle,
-	$notopbar,$bgcolor,$notitle,$no_inline_link)=@_;
+	$notopbar,$bgcolor,$notitle,$no_inline_link,$args)=@_;
 
-    $title=&mt($title);
+    if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
 
     $function = &get_users_function() if (!$function);
     my $img =    &designparm($function.'.img',$domain);
@@ -3723,7 +3726,8 @@
                                domain
             function       -> force usage of a specific rolish color scheme
             bgcolor        -> override the default page bgcolor
-
+            no_auto_mt_title
+                           -> prevent &mt()ing the title arg
 =back
 
 =cut
@@ -3770,8 +3774,8 @@
     if (!defined($title)) {
 	$title = 'The LearningOnline Network with CAPA';
     }
-    
-    $result .= '<title> LON-CAPA '.&mt($title).'</title>'
+    if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
+    $result .= '<title> LON-CAPA '.$title.'</title>'
 	.'<link rel="stylesheet" type="text/css" href="'.$url.'" />'
 	.$head_extra;
     return $result;
@@ -3915,6 +3919,8 @@
                   no_inline_link -> if true and in remote mode, don't show the 
                                     'Switch To Inline Menu' link
 
+                  no_auto_mt_title -> prevent &mt()ing the title arg
+
 =back
 
 =cut
@@ -3924,7 +3930,8 @@
     #&Apache::lonnet::logthis("start_page ".join(':',caller(0)));
     my %head_args;
     foreach my $arg ('redirect','force_register','domain','function',
-		     'bgcolor','frameset','no_nav_bar','only_body') {
+		     'bgcolor','frameset','no_nav_bar','only_body',
+		     'no_auto_mt_title') {
 	if (defined($args->{$arg})) {
 	    $head_args{$arg} = $args->{$arg};
 	}
@@ -3950,7 +3957,8 @@
 			 $args->{'only_body'},      $args->{'domain'},
 			 $args->{'force_register'}, $args->{'body_title'},
 			 $args->{'no_nav_bar'},     $args->{'bgcolor'},
-			 $args->{'no_title'},       $args->{'no_inline_link'});
+			 $args->{'no_title'},       $args->{'no_inline_link'},
+			 $args);
 	}
     }
 
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.364 loncom/homework/structuretags.pm:1.365
--- loncom/homework/structuretags.pm:1.364	Mon Aug 28 10:26:04 2006
+++ loncom/homework/structuretags.pm	Wed Sep 27 18:42:25 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.364 2006/08/28 14:26:04 albertel Exp $
+# $Id: structuretags.pm,v 1.365 2006/09/27 22:42:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -134,7 +134,7 @@
 	$body_args{'force_register'} = 1;
 	$body_args{'add_entries'}    = \%add_entries;	
     }
-    &Apache::lonlocal::mt_escape(\$name);
+    $body_args{'no_auto_mt_title'} = 1;
     my $page_start = &Apache::loncommon::start_page($name,$extra_head,
 						    \%body_args);