You are here

private function Common::applicationMimeIcon in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/Services/Common.php \Drupal\filebrowser\Services\Common::applicationMimeIcon()

Helper function to located the mime type in the application part of the mimetype

Parameters

string $application_mime:

Return value

string

1 call to Common::applicationMimeIcon()
Common::mimeIcon in src/Services/Common.php
Returns a string containing the mime type of the file. This will be used to identify the file icon. Returns 'unknown' for mime types that have no icon.

File

src/Services/Common.php, line 436

Class

Common
Class Common @package Drupal\filebrowser\Services

Namespace

Drupal\filebrowser\Services

Code

private function applicationMimeIcon($application_mime) {
  $parts = explode('.', $application_mime);
  switch ($parts[0]) {
    case 'pdf':
    case 'xml':

    //case 'zip':
    case 'msword':
    case 'xhtml+xml':
      $mime = $parts[0];
      break;
    case 'vnd':
      $mime = $this
        ->vndMimeIcon($parts[1]);
      break;
    default:
      $mime = 'unknown';
  }
  return $mime;
}