Removed deprecated OC_Helper::mimeTypeIcon function

This commit is contained in:
Roeland Jago Douma 2015-12-18 14:00:20 +01:00
parent a54be132fc
commit b460bde7c6
5 changed files with 7 additions and 32 deletions

View 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';

View 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">

View 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
*

View 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 {

View 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 );
}
/**