]> source.dussan.org Git - nextcloud-server.git/commitdiff
Removed deprecated OC_Helper::mimeTypeIcon function
authorRoeland Jago Douma <rullzer@owncloud.com>
Fri, 18 Dec 2015 13:00:20 +0000 (14:00 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Fri, 18 Dec 2015 13:00:20 +0000 (14:00 +0100)
apps/files/lib/helper.php
apps/files_sharing/templates/public.php
lib/private/helper.php
lib/private/preview.php
lib/private/template/functions.php

index 9a4e8d59786ad1b68c64eb77131a92548e728aa6..4f960518839792625f199070b72e2c541aabd295 100644 (file)
@@ -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';
index 046f954106a34ed03e84bee161a3d3e137fa8fb8..aa1f926ea35d69a4dd5aa60d39601144405b2c22 100644 (file)
@@ -41,7 +41,7 @@ $thumbSize = 1024;
 <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">
 
index f329d53fa763ea9b067d75839fef6c2820e3238b..95f6be27ccf5b699210af4de4cf2910147c7da0d 100644 (file)
@@ -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
         *
index 38c043030fc7e0ac5d8913b9bde8e94b9a000e3e..44d38b354a9acbd3bffa00a48c1664dd3ec5e37c 100644 (file)
@@ -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 {
index 6298f25edc13a3136f930b0db9c948093fd0f70d..982ecde5850ec18b6bf64fc5d5e7bf48ed0bf0e1 100644 (file)
@@ -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 );
 }
 
 /**