]> git.mjollnir.org Git - moodle.git/commitdiff
Better checks when comparing languages. Now highlights missing or
authormoodler <moodler>
Thu, 12 Dec 2002 03:33:12 +0000 (03:33 +0000)
committermoodler <moodler>
Thu, 12 Dec 2002 03:33:12 +0000 (03:33 +0000)
empty strings.  Quick check mode also flags strings when they exist
but are empty.  Larger form space to edit empty strings.

admin/lang.php

index e2626056b19638f095331b290e2e4c4bc947ac14..ccdfd2ec04c1ea874be69d99038a51706e00037a 100644 (file)
@@ -86,7 +86,7 @@
     
             $first = true;
             foreach ($enstring as $key => $value) {
-                if (!isset($string[$key])) {
+                if (!isset($string[$key]) or $string[$key] == "") {
                     $value = htmlspecialchars($value);
                     $value = str_replace("$"."a", "\\$"."a", $value);
                     if ($first) {
 
                 $value = str_replace("\\","",$string[$key]);          // Delete all slashes
                 $value = htmlspecialchars($value);
+
+                $cellcolour = $value ? $THEME->cellcontent: $THEME->highlight;
+
                 if ($editable) {
-                    echo "<TD WIDTH=40% VALIGN=TOP>";
+                    echo "<TD WIDTH=40% BGCOLOR=\"$cellcolour\" VALIGN=TOP>";
                     if (isset($string[$key])) {
                         $valuelen = strlen($value);
                     } else {
                         $rows = ceil($valuelen / $cols);
                         echo "<TEXTAREA NAME=\"string-$key\" cols=\"$cols\" rows=\"$rows\">$value</TEXTAREA>";
                     } else {
-                        $cols = $valuelen + 2;
+                        if ($valuelen) {
+                            $cols = $valuelen + 2;
+                        }
                         echo "<INPUT TYPE=\"TEXT\" NAME=\"string-$key\" VALUE=\"$value\" SIZE=\"$cols\"></TD>";
                     }
                     echo "</TD>";
 
                 } else {
-                    if (isset($string[$key])) {
-                        echo "<TD WIDTH=40% BGCOLOR=white VALIGN=TOP>$value</TD>";
-                    } else {
-                        echo "<TD WIDTH=40% BGCOLOR=white ALIGN=CENTER VALIGN=TOP>-</TD>";
-                    }
+                    echo "<TD WIDTH=40% BGCOLOR=\"$cellcolour\" VALIGN=TOP>$value</TD>";
                 }
             }
             if ($editable) {