From d0b7a11f43b502cc1c067915064fdd3b437881cc Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 17 Aug 2009 03:38:19 +0000 Subject: [PATCH] outputlib MDL-20103 fix php NOTICE when content has no assigned icon --- lib/outputrenderers.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 596167134c..8b38648a46 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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'); -- 2.39.5