*/
public static function determineIcon($file) {
if($file['type'] === 'dir') {
- $icon = \OC_Helper::mimetypeIcon('dir');
+ $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir');
// TODO: move this part to the client side, using mountType
if ($file->isShared()) {
- $icon = \OC_Helper::mimetypeIcon('dir-shared');
+ $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-shared');
} elseif ($file->isMounted()) {
- $icon = \OC_Helper::mimetypeIcon('dir-external');
+ $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-external');
}
}else{
- $icon = \OC_Helper::mimetypeIcon($file->getMimetype());
+ $icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($file->getMimetype());
}
return substr($icon, 0, -3) . 'svg';
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype">
<input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
-<input type="hidden" name="mimetypeIcon" value="<?php p(OC_Helper::mimetypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
+<input type="hidden" name="mimetypeIcon" value="<?php p(\OC::$server->getMimeTypeDetector()->mimeTypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
<input type="hidden" name="filesize" value="<?php p($_['nonHumanFileSize']); ?>" id="filesize">
<input type="hidden" name="maxSizeAnimateGif" value="<?php p($_['maxSizeAnimateGif']); ?>" id="maxSizeAnimateGif">
return OC::$server->getURLGenerator()->imagePath($app, $image);
}
- /**
- * get path to icon of file type
- * @param string $mimetype mimetype
- * @return string the url
- *
- * Returns the path to the image of this file type.
- * @deprecated 8.2.0 Use \OC::$server->getMimeTypeDetector()->mimeTypeIcon($mimetype)
- */
- public static function mimetypeIcon($mimetype) {
- return \OC::$server->getMimeTypeDetector()->mimeTypeIcon($mimetype);
- }
-
/**
* get path to preview of file
* @param string $path path
return self::$templateManager;
}
- /**
- * Try to guess the mimetype based on filename
- *
- * @param string $path
- * @return string
- * @deprecated 8.2.0 Use \OC::$server->getMimeTypeDetector()->detectPath($path)
- */
- static public function getFileNameMimeType($path) {
- return \OC::$server->getMimeTypeDetector()->detectPath($path);
- }
-
/**
* detect if a given program is found in the search PATH
*
*/
private function getMimeIcon() {
$image = new \OC_Image();
- $mimeIconWebPath = \OC_Helper::mimetypeIcon($this->mimeType);
+ $mimeIconWebPath = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($this->mimeType);
if (empty(\OC::$WEBROOT)) {
$mimeIconServerPath = \OC::$SERVERROOT . $mimeIconWebPath;
} else {
* make OC_Helper::mimetypeIcon available as a simple function
* @param string $mimetype mimetype
* @return string link to the image
- *
- * For further information have a look at OC_Helper::mimetypeIcon
*/
function mimetype_icon( $mimetype ) {
- return OC_Helper::mimetypeIcon( $mimetype );
+ return \OC::$server->getMimeTypeDetector()->mimeTypeIcon( $mimetype );
}
/**