getConstants())){ return true; } else{ return false; } } /** * Forms an image URL. * * It will intentionally fail when used for a non constant class. * * @param string $type Image type. valid values are: * ICON, LOGO, CURRENCY, UNIT, * AREA, SKILL, ESSENCE, RUNE, * GRIND, ELEMENT, SKILL_GUILD, DECORATION, * SOURCE, SKILL_LEADER, INVENTORY, EFFECT, * BUILDING * @param string|int $name Filename, with no path or extension. It can also * skip the padding. An id can be used. * @return Image URL if found. If not, the URL to an 'unknown' icon. */ public static function img($type, $name){ $pad = 1; $url = URL::IMG["UNKNOWN"]; while ($pad < 10){ if (isset(PATH::IMG[$type]) && file_exists(PATH::IMG[$type] . str_pad($name, $pad, '0', STR_PAD_LEFT) . ".png")){ $url = URL::IMG[$type] . str_pad($name, $pad, '0', STR_PAD_LEFT) . ".png"; break; } $pad ++; } return $url; } } ?>