/** * Get URLs for icons if available. * @param MessageGroup $g * @param int $size Length of the edge of a bounding box to fit the icon. * @return null|array * @since 2013-04-01 */ public static function getIcon(MessageGroup $g, $size) { $icon = $g->getIcon(); if (substr($icon, 0, 7) !== 'wiki://') { return null; } $formats = array(); $filename = substr($icon, 7); $file = wfFindFile($filename); if (!$file) { wfWarn("Unknown message group icon file {$icon}"); return null; } if ($file->isVectorized()) { $formats['vector'] = $file->getFullUrl(); } $formats['raster'] = $file->createThumb($size, $size); return $formats; }