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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Fri, 20 Jun 2008 17:38:51 -0000


bisitz		Fri Jun 20 13:38:51 2008 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Localization
      - Added some missing &mt() calls
      - First part of optimization of parameter headlines translation
  - XHTML
      - Made "selected" attributes in options XHTML-compliant
      - Exchanged outdated center tag by div
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.400 loncom/interface/lonparmset.pm:1.401
--- loncom/interface/lonparmset.pm:1.400	Mon Jun 16 19:35:58 2008
+++ loncom/interface/lonparmset.pm	Fri Jun 20 13:38:51 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.400 2008/06/16 23:35:58 raeburn Exp $
+# $Id: lonparmset.pm,v 1.401 2008/06/20 17:38:51 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1010,7 +1010,7 @@
 	    $$mapp{$mapid}=$$mapp{$id};
 	    $$allmaps{$mapid}=$$mapp{$id};
 	    if ($mapid eq '1') {
-		$$maptitles{$mapid}='Main Course Documents';
+		$$maptitles{$mapid}=&mt('Main Course Documents');
 	    } else {
 		$$maptitles{$mapid}=
 		    &Apache::lonnet::gettitle($$mapp{$id});    
@@ -1137,7 +1137,7 @@
     my ($r,$allparts,$psprt)=@_;
     $r->print('<select multiple name="psprt" size="8">');
     $r->print('<option value="all"');
-    $r->print(' selected') unless (@{$psprt});
+    $r->print(' selected="selected"') unless (@{$psprt});
     $r->print('>'.&mt('All Parts').'</option>');
     my %temphash=();
     foreach (@{$psprt}) { $temphash{$_}=1; }
@@ -1147,7 +1147,7 @@
 	unless ($tempkey =~ /\./) {
 	    $r->print('<option value="'.$tempkey.'"');
 	    if ($$psprt[0] eq "all" ||  $temphash{$tempkey}) {
-		$r->print(' selected');
+		$r->print(' selected="selected"');
 	    }
 	    $r->print('>'.$$allparts{$tempkey}.'</option>');
 	}
@@ -1268,7 +1268,7 @@
     $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');
     foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) {
 	$r->print('<option value="'.$_.'"');
-	if (($pschp eq $_)) { $r->print(' selected'); }
+	if (($pschp eq $_)) { $r->print(' selected="selected"'); }
 	$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>');
     }
     $r->print("</select>");
@@ -1282,9 +1282,9 @@
     foreach (reverse sort keys %{$alllevs}) {
 	$r->print('<option value="'.$$alllevs{$_}.'"');
 	if ($parmlev eq $$alllevs{$_}) {
-	    $r->print(' selected'); 
+	    $r->print(' selected="selected"'); 
 	}
-	$r->print('>'.$_.'</option>');
+	$r->print('>'.&mt($_).'</option>');
     }
     $r->print("</select>");
 }
@@ -1300,7 +1300,7 @@
 	$r->print('    <option value="'.$s.'"');
 	foreach (@{$selectedsections}) {
 	    if ($s eq $_) {
-		$r->print(' selected');
+		$r->print(' selected="selected"');
 		last;
 	    }
 	}
@@ -1319,7 +1319,7 @@
 	$r->print('    <option value="'.$group.'"');
 	foreach (@{$selectedgroups}) {
 	    if ($group eq $_) {
-		$r->print(' selected');
+		$r->print(' selected="selected"');
 		last;
 	    }
 	}
@@ -1881,29 +1881,30 @@
 #---------------------------------------------------- print header information
                 my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map');
                 my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
-                $r->print(<<ENDMAPONE);
-<center><h4>
-Set Defaults for All Resources in $foldermap<br />
-<font color="red"><i>$showtitle</i></font><br />
-Specifically for
-ENDMAPONE
+                my $tmp="";
                 if ($uname) {
 		    my $person=&Apache::loncommon::plainname($uname,$udom);
-                    $r->print(&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ".
-                        &mt('in')." \n");
+                    $tmp.=&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ".
+                        &mt('in')." \n";
                 } else {
-                    $r->print("<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n");
+                    $tmp.="<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n";
                 }
                 if ($cgroup) {
-                    $r->print(&mt("Group")." <font color=\"red\"><i>$cgroup".
-                              "</i></font> ".&mt('of')." \n");
+                    $tmp.=&mt("Group")." <font color=\"red\"><i>$cgroup".
+                              "</i></font> ".&mt('of')." \n";
                     $csec = '';
                 } elsif ($csec) {
-                    $r->print(&mt("Section")." <font color=\"red\"><i>$csec".
-                              "</i></font> ".&mt('of')." \n");
+                    $tmp.=&mt("Section")." <font color=\"red\"><i>$csec".
+                              "</i></font> ".&mt('of')." \n";
                 }
-                $r->print("<font color=\"red\"><i>$coursename</i></font><br />");
-                $r->print("</h4>\n");
+                $r->print('<div align="center"><h4>'
+                         .&mt('Set Defaults for All Resources in [_1]Specifically for [_2][_3]'
+                             ,$foldermap.'<br /><font color="red"><i>$showtitle</i></font><br />'
+                             ,$tmp
+                             ,'<font color="red"><i>'.$coursename.'</i></font>'
+                             )
+                         ."<br /></h4>\n"
+                         );
 #---------------------------------------------------------------- print table
                 $r->print('<p><table border="2">');
                 $r->print('<tr><th>'.&mt('Parameter Name').'</th>');
@@ -1916,7 +1917,7 @@
                            \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
                            $parmlev,$uname,$udom,$csec,$cgroup);
                 }
-                $r->print("</table></center>");
+                $r->print("</table></div>");
             } # end each map
         } # end of $parmlev eq map
 #--------------------------------- Entry for parm level general (Course level)