You are here

private function Common::vndMimeIcon in Filebrowser 3.x

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

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

Parameters

string $vnd_mime:

Return value

string

1 call to Common::vndMimeIcon()
Common::applicationMimeIcon in src/Services/Common.php
Helper function to located the mime type in the application part of the mimetype

File

src/Services/Common.php, line 465

Class

Common
Class Common @package Drupal\filebrowser\Services

Namespace

Drupal\filebrowser\Services

Code

private function vndMimeIcon($vnd_mime) {
  $parts = explode('.', $vnd_mime);
  switch ($parts[0]) {
    case 'ms-excel':
    case 'ms-powerpoint':
    case 'ms-word':

      // case 'openxmlformats-officedocument':
      $mime = $parts[0];
      break;
    case 'vnd':
      $mime = $this
        ->vndMimeIcon($parts[1]);
      break;
    default:
      $mime = 'unknown';
  }
  return $mime;
}