Back to PhocaGalleryImageFront class

Method displayCategoryImageOrNoImage

public static
displayCategoryImageOrNoImage
(mixed $filename, mixed $size)

Method displayCategoryImageOrNoImage - Source code

/*
 * IMAGE OR NO IMAGE - CATEGORY VIEW - INTERNAL IMAGE
 */
public static function displayCategoryImageOrNoImage($filename, $size)
{
    phocagalleryimport('phocagallery.image.image');
    phocagalleryimport('phocagallery.path.path');
    phocagalleryimport('phocagallery.file.filethumbnail');
    $path = PhocaGalleryPath::getPath();
    $fileThumbnail = PhocaGalleryFileThumbnail::getThumbnailName($filename, $size);
    //Thumbnail_file doesn't exists
    if (!File::exists($fileThumbnail->abs)) {
        switch ($size) {
            case 'large':
                $fileThumbnail->rel = $path->image_rel_front . 'phoca_thumb_l_no_image.png';
                break;
            case 'medium':
                $fileThumbnail->rel = $path->image_rel_front . 'phoca_thumb_m_no_image.png';
                break;
            default:
            case 'small':
                $fileThumbnail->rel = $path->image_rel_front . 'phoca_thumb_s_no_image.png';
                break;
        }
    }
    return $fileThumbnail->rel;
}