]> git.mjollnir.org Git - moodle.git/commitdiff
outputlib MDL-20103 fix php NOTICE when content has no assigned icon
authorjerome <jerome>
Mon, 17 Aug 2009 03:38:19 +0000 (03:38 +0000)
committerjerome <jerome>
Mon, 17 Aug 2009 03:38:19 +0000 (03:38 +0000)
lib/outputrenderers.php

index 596167134c3d4b9dad89460124a71d3ddd6e4ef1..8b38648a464e6ce1d7b00427617984c71dd70faa 100644 (file)
@@ -1006,7 +1006,9 @@ class moodle_core_renderer extends moodle_renderer_base {
         foreach ($items as $key => $string) {
             $item = $this->output_start_tag('li', array('class' => 'r' . $row));
             if ($icons) {
-                $item .= $this->output_tag('div', array('class' => 'icon column c0'), $icons[$key]);
+                if (key_exists($key, $icons)) { //test if the content has an assigned icon
+                    $item .= $this->output_tag('div', array('class' => 'icon column c0'), $icons[$key]);
+                }
             }
             $item .= $this->output_tag('div', array('class' => 'column c1'), $string);
             $item .= $this->output_end_tag('li');