$customicon = $modinfo->cms[$modnumber]->icon;
if (!empty($customicon)) {
if (substr($customicon, 0, 4) === 'mod/') {
- $icon = "$CFG->modpixpath/".substr($customicon, 4);
+ list($modname, $iconname) = explode('/', substr($customicon, 4), 2);
+ $icon = $OUTPUT->mod_icon_url($iconname, $modname);
} else {
- $icon = "$CFG->pixpath/".$customicon;
+ $icon = $OUTPUT->old_icon_url($customicon);
}
} else {
$icon = "" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "";
$config = array(
'wwwroot' => $CFG->httpswwwroot, // Yes, really. See above.
'pixpath' => $CFG->pixpath,
- 'modpixpath' => $CFG->modpixpath,
'sesskey' => sesskey(),
);
if (debugging('', DEBUG_DEVELOPER)) {
* @return string
*/
function image() {
- global $CFG;
+ global $OUTPUT;
$str = '<a href="field.php?d='.$this->data->id.'&fid='.$this->field->id.'&mode=display&sesskey='.sesskey().'">';
- $str .= '<img src="'.$CFG->modpixpath.'/data/field/'.$this->type.'/icon.gif" ';
+ $str .= '<img src="'.$OUTPUT->mod_icon_url('/field/' . $this->type . '/icon', 'data') . '" ';
$str .= 'height="'.$this->iconheight.'" width="'.$this->iconwidth.'" alt="'.$this->type.'" title="'.$this->type.'" /></a>';
return $str;
}