From: moodler Date: Tue, 26 Oct 2004 08:43:41 +0000 (+0000) Subject: Fixed minor JS bug in printing out editor configuration X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20b57d6aac9afff127baf7667f410c9e2eee999a;p=moodle.git Fixed minor JS bug in printing out editor configuration --- diff --git a/lib/weblib.php b/lib/weblib.php index 441774f19b..cf7e6088c9 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 '};';