]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed minor JS bug in printing out editor configuration
authormoodler <moodler>
Tue, 26 Oct 2004 08:43:41 +0000 (08:43 +0000)
committermoodler <moodler>
Tue, 26 Oct 2004 08:43:41 +0000 (08:43 +0000)
lib/weblib.php

index 441774f19bc2394d9ff254548cdfe09f4a908f2b..cf7e6088c9e6d6e8b0752a4481a20bc9ce18530e 100644 (file)
@@ -3413,17 +3413,17 @@ function print_side_block_end() {
 
     $fontlist = isset($CFG->editorfontlist) ? explode(';', $CFG->editorfontlist) : array();
     $i = 1;                     // Counter is used to get rid of the last comma.
-    $count = count($fontlist);  // Otherwise IE doesn't load the editor.
 
     foreach($fontlist as $fontline) {
         if(!empty($fontline)) {
-            list($fontkey, $fontvalue) = split(':', $fontline);
-            echo '"'. $fontkey ."\":\t'". $fontvalue ."'";
-            if($i < $count) {
+            if ($i > 1) {
                 echo ','."\n";
             }
+            list($fontkey, $fontvalue) = split(':', $fontline);
+            echo '"'. $fontkey ."\":\t'". $fontvalue ."'";
+
+            $i++;
         }
-        $i++;
     }
     echo '};';