public static function get_icon_for_extension($extension)
    {
        $extension = strtolower($extension);
        $module = ModuleLoader::getModule('silverstripe/framework');

        $candidates = [
            $extension,
            static::get_app_category($extension),
            'generic'
        ];
        foreach ($candidates as $candidate) {
            $resource = $module->getResource("client/images/app_icons/{$candidate}_92.png");
            if ($resource->exists()) {
                return $resource->getURL();
            }
        }
        return null;
    }
public static function get_icon_for_extension($extension)
    {
        $extension = strtolower($extension);
        $module = ModuleLoader::getModule('silverstripe/framework');

        $candidates = [
            $extension,
            static::get_app_category($extension),
            'generic'
        ];
        foreach ($candidates as $candidate) {
            $resource = $module->getResource("client/images/app_icons/{$candidate}_92.png");
            if ($resource->exists()) {
                return $resource->getURL();
            }
        }
        return null;
    }
public static function get_icon_for_extension ( $ extension ) { $ extension = strtolower ( $ extension ) ; $ module = ModuleLoader :: getModule ( 'silverstripe/framework' ) ; $ candidates = [ $ extension , static :: get_app_category ( $ extension ) , 'generic' ] ; foreach ( $ candidates as $ candidate ) { $ resource = $ module -> getResource ( "client/images/app_icons/{$candidate}_92.png" ) ; if ( $ resource -> exists ( ) ) { return $ resource -> getURL ( ) ; } } return null ; }
Given an extension, determine the icon that should be used

@param string $extension
@return string Icon filename relative to base url
Given an extension determine the icon that should be used