outputlib MDL-20103 fix php NOTICE when content has no assigned icon

This commit is contained in:
jerome 2009-08-17 03:38:19 +00:00
parent 9181e76774
commit d0b7a11f43

View 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');