From b460bde7c6c3c70fc0010133c00f1e76a952fa48 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 18 Dec 2015 14:00:20 +0100 Subject: [PATCH] Removed deprecated OC_Helper::mimeTypeIcon function --- apps/files/lib/helper.php | 8 ++++---- apps/files_sharing/templates/public.php | 2 +- lib/private/helper.php | 23 ----------------------- lib/private/preview.php | 2 +- lib/private/template/functions.php | 4 +--- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 9a4e8d5978..4f96051883 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -66,15 +66,15 @@ class Helper { */ 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'; diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 046f954106..aa1f926ea3 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -41,7 +41,7 @@ $thumbSize = 1024; - + diff --git a/lib/private/helper.php b/lib/private/helper.php index f329d53fa7..95f6be27cc 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -137,18 +137,6 @@ class OC_Helper { 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 @@ -335,17 +323,6 @@ class OC_Helper { 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 * diff --git a/lib/private/preview.php b/lib/private/preview.php index 38c043030f..44d38b354a 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -1168,7 +1168,7 @@ class Preview { */ 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 { diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index 6298f25edc..982ecde585 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -173,11 +173,9 @@ function image_path( $app, $image ) { * 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 ); } /**