rex_media::isDocType PHP Method

isDocType() public static method

public static isDocType ( $type )
    public static function isDocType($type)
    {
        return in_array($type, self::getDocTypes());
    }

Usage Example

Example #1
0
 }
 // Eine beschreibende Spalte schätzen
 $desc = '';
 foreach (['med_description'] as $col) {
     if ($files->hasValue($col) && $files->getValue($col) != '') {
         $desc = '<p>' . htmlspecialchars($files->getValue($col)) . '</p>';
         break;
     }
 }
 // wenn datei fehlt
 if (!file_exists(rex_path::media($file_name))) {
     $thumbnail = '<i class="rex-mime rex-mime-error" title="' . rex_i18n::msg('pool_file_does_not_exist') . '"></i><span class="sr-only">' . $file_name . '</span>';
 } else {
     $file_ext = substr(strrchr($file_name, '.'), 1);
     $icon_class = ' rex-mime-default';
     if (rex_media::isDocType($file_ext)) {
         $icon_class = ' rex-mime-' . $file_ext;
     }
     $thumbnail = '<i class="rex-mime' . $icon_class . '" title="' . $alt . '" data-extension="' . $file_ext . '"></i><span class="sr-only">' . $file_name . '</span>';
     if (rex_media::isImageType(rex_file::extension($file_name)) && $thumbs) {
         $thumbnail = '<img class="thumbnail" src="' . rex_url::media($file_name) . '" alt="' . $alt . '" title="' . $alt . '" />';
         if ($media_manager) {
             $thumbnail = '<img class="thumbnail" src="' . rex_url::backendController(['rex_media_type' => 'rex_mediapool_preview', 'rex_media_file' => $encoded_file_name]) . '" alt="' . $alt . '" title="' . $alt . '" />';
         }
     }
 }
 // ----- get file size
 $size = $file_size;
 $file_size = rex_formatter::bytes($size);
 if ($file_title == '') {
     $file_title = '[' . rex_i18n::msg('pool_file_notitle') . ']';