Beispiel #1
0
 /**
  * Determine icon for a given file
  *
  * @param \OC\Files\FileInfo $file file info
  * @return string icon URL
  */
 public static function determineIcon($file)
 {
     if ($file['type'] === 'dir') {
         $icon = \OC_Helper::mimetypeIcon('dir');
         // TODO: move this part to the client side, using mountType
         if ($file->isShared()) {
             $icon = \OC_Helper::mimetypeIcon('dir-shared');
         } elseif ($file->isMounted()) {
             $icon = \OC_Helper::mimetypeIcon('dir-external');
         }
     } else {
         $icon = \OC_Helper::mimetypeIcon($file->getMimetype());
     }
     return substr($icon, 0, -3) . 'svg';
 }