You are here

function _assets_get_icons in Asset 7

1 call to _assets_get_icons()
asset_type_form in includes/asset.admin.inc
Generates the asset type editing form.

File

./asset.module, line 551
Asset module.

Code

function _assets_get_icons() {
  $dir = ASSET_MODULE_PATH . '/ckeditor/buttons/';
  $icons =& drupal_static(__FUNCTION__, array());
  if (!$icons) {
    if (is_dir($dir)) {
      foreach (scandir($dir) as $file_name) {
        $file_path = $dir . $file_name;
        if (is_file($file_path)) {
          if (exif_imagetype($file_path)) {
            if (FALSE !== getimagesize($file_path)) {
              $icons[$file_name] = theme('image', array(
                'path' => $file_path,
                'width' => 18,
                'height' => 18,
              ));
            }
          }
        }
      }
    }
  }
  return $icons;
}