]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug 1608:
authordefacer <defacer>
Fri, 2 Jul 2004 08:18:47 +0000 (08:18 +0000)
committerdefacer <defacer>
Fri, 2 Jul 2004 08:18:47 +0000 (08:18 +0000)
When editing the language, you can easily switch between the two views with a button.

Also fixes in the HTML generation.

admin/lang.php

index 39a8b9e84b2408a9365e50d1a2fd7b55a49d6052..fd599a4576aa089c14c8d5f268e64e5b2fbba6b3 100644 (file)
         case "missing":
             $navigation = "<A HREF=\"lang.php\">$strlanguage</A> -> $strmissingstrings";
             $title = $strmissingstrings;
+            $button = '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/admin/lang.php">'.
+                      '<input type="hidden" name="mode" value="compare" />'.
+                      '<input type="submit" value="'.$strcomparelanguage.'" /></form>';
             break;
         case "compare":
             $navigation = "<A HREF=\"lang.php\">$strlanguage</A> -> $strcomparelanguage";
             $title = $strcomparelanguage;
+            $button = '<form target="'.$CFG->framename.'" method="get" action="'.$CFG->wwwroot.'/admin/lang.php">'.
+                      '<input type="hidden" name="mode" value="missing" />'.
+                      '<input type="submit" value="'.$strmissingstrings.'" /></form>';
             break;
         default:
             $title = $strlanguage;
             $navigation = $strlanguage;
+            $button = '';
             break;
     }
 
@@ -42,7 +49,8 @@
 
     print_header("$site->shortname: $title", "$site->fullname",
                  "<a href=\"index.php\">$stradministration</a> -> ".
-                 "<a href=\"configure.php\">$strconfiguration</a> -> $navigation");
+                 "<a href=\"configure.php\">$strconfiguration</a> -> $navigation",
+                 '', '', true, $button);
 
     if (!$mode) {
         $currlang = current_language();
                     $value = str_replace("$"."a", "\\$"."a", $value);
                     $value = str_replace("%%","%",$value);
                     if ($first) {
-                        echo "</PRE><HR><P><B>".get_string("stringsnotset","","$langdir/$file")."</B></P><PRE>";
+                        echo "<p><b>".get_string("stringsnotset","","$langdir/$file")."</b></p><pre>";
                         $first = false;
                         $somethingfound = true;
                     }
-                    echo "$"."string['$key'] = \"$value\";<BR>";
+                    echo "$"."string['$key'] = \"$value\";<br />";
                 }
             }
+            if (!$first) {
+                echo '</pre><hr />';
+            }
         }
-    
+  
         if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
             error("Could not find English language help files!");
         }