[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /interface lonmenu.pm /localize/localize de.pm

droeschl droeschl at source.lon-capa.org
Thu Apr 16 06:13:29 EDT 2015


droeschl		Thu Apr 16 10:13:29 2015 EDT

  Modified files:              
    /loncom/localize/localize	de.pm 
    /loncom/interface	lonmenu.pm 
    /loncom/homework	lonhomework.pm 
  Log:
  - rename: Insert Menu -> Templates
  - translation of the menu title removed from create_submenu in order to allow more than just (translateable) strings for the menu title (e.g. custom html including images). 
    The calling function is now responsible for translation of the menu title.
    All existing calls to create_submenu have been adjusted.
  - moved special treatment of the Personal menu from create_submenu to primary_menu
  - added help icon to Help submenu in XML editor.
  
  
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.609 loncom/localize/localize/de.pm:1.610
--- loncom/localize/localize/de.pm:1.609	Wed Apr  8 10:46:23 2015
+++ loncom/localize/localize/de.pm	Thu Apr 16 10:13:20 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.609 2015/04/08 10:46:23 droeschl Exp $
+# $Id: de.pm,v 1.610 2015/04/16 10:13:20 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -30020,6 +30020,9 @@
    'Student-viewable roster settings'
 => 'Einstellungen zur studierendeeinsehbaren Teilnehmerliste',
 
+   'Templates'
+=> 'Vorlagen'
+
 #SYNCMARKER
 );
 1;
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.431 loncom/interface/lonmenu.pm:1.432
--- loncom/interface/lonmenu.pm:1.431	Mon Jan 19 15:36:01 2015
+++ loncom/interface/lonmenu.pm	Thu Apr 16 10:13:25 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.431 2015/01/19 15:36:01 goltermann Exp $
+# $Id: lonmenu.pm,v 1.432 2015/04/16 10:13:25 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -288,6 +288,11 @@
                     push(@primsub,$item);
                 }
                 if (@primsub > 0) {
+                    if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) {
+                        $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+                    } else {
+                        $title = &mt($title);
+                    }
                     $menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1);
                 } elsif ($link) {
                     $menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>';
@@ -510,19 +515,9 @@
     if ($target ne '') {
         $disptarget = ' target="'.$target.'"';
     }
-    my $name;
-    if ($title eq 'Personal') {
-        if ($env{'user.name'} && $env{'user.domain'}) {
-            $name = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
-        } else {
-            $name = &mt($title);
-        }
-    } else {
-        $name = &mt($title);
-    }
     my $menu = '<li class="LC_hoverable">'.
                '<a href="'.$link.'"'.$disptarget.'>'.
-               '<span class="LC_nobreak">'.$name.
+               '<span class="LC_nobreak">'.$title.
                '<span class="LC_fontsize_small" style="font-weight:normal;">'.
                ' ▼</span></span></a>'.
                '<ul>';
@@ -1785,7 +1780,7 @@
     my $now = time;
     my (%courseroles,%seccount,%courseprivs);
     my $is_cc;
-    my ($js,$form,$switcher,$switchtext);
+    my ($js,$form,$switcher);
     my $ccrole;
     if ($crstype eq 'Community') {
         $ccrole = 'co';
@@ -1873,7 +1868,6 @@
             }
         }
     }
-    $switchtext = 'Switch role'; # do not translate here
     my @roles_order = ($ccrole,'in','ta','ep','ad','st');
     my $numdiffsec;
     if (keys(%seccount) == 1) {
@@ -1929,7 +1923,7 @@
             }
         }
         if (@submenu > 0) {
-            $switcher = &create_submenu('','',$switchtext,\@submenu);
+            $switcher = &create_submenu('','',&mt('Switch role'),\@submenu);
         }
     }
     return ($js,$form,$switcher);
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.350 loncom/homework/lonhomework.pm:1.351
--- loncom/homework/lonhomework.pm:1.350	Wed Apr 15 04:11:20 2015
+++ loncom/homework/lonhomework.pm	Thu Apr 16 10:13:29 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.350 2015/04/15 04:11:20 raeburn Exp $
+# $Id: lonhomework.pm,v 1.351 2015/04/16 10:13:29 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1021,11 +1021,18 @@
 		unless ($env{'environment.nocodemirror'}) {
 		# dropdown menues
     		$result .= '<ol class="LC_primary_menu LC_floatleft">'.
-    		&Apache::lonmenu::create_submenu("#", "", &mt("Insert Menu"), &Apache::structuretags::insert_menu_datastructure(),"").'</ol>';
+    		&Apache::lonmenu::create_submenu("#", "", &mt("Templates"), 
+                &Apache::structuretags::insert_menu_datastructure(),
+                "").'</ol>';
 		}
-    $result .= '<ol class="LC_primary_menu LC_floatleft">'.
-    Apache::lonmenu::create_submenu("#", "", &mt("Help"), &Apache::structuretags::helpmenu_datastructure(),"").'</ol>';
-    $result.="</div>";
+    $result .= '<ol class="LC_primary_menu LC_floatleft">';
+
+    $result .= Apache::lonmenu::create_submenu("#", "", 
+        &mt("Help") . ' <img src="/adm/help/help.png" alt="' . &mt("Help") .
+        '" style="vertical-align:text-bottom; height: auto; margin:0; "/>', 
+        &Apache::structuretags::helpmenu_datastructure(),"");
+
+    $result.="</ol></div>";
          
          $result.='<hr style="clear:both;visibility:hidden" /></div></div>'.&Apache::lonxml::message_location().
                   &Apache::loncommon::xmleditor_js().




More information about the LON-CAPA-cvs mailing list