Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
b460bde7
Commit
b460bde7
authored
Dec 18, 2015
by
Roeland Jago Douma
Browse files
Removed deprecated OC_Helper::mimeTypeIcon function
parent
a54be132
Changes
5
Hide whitespace changes
Inline
Side-by-side
apps/files/lib/helper.php
View file @
b460bde7
...
...
@@ -66,15 +66,15 @@ class Helper {
*/
public
static
function
determineIcon
(
$file
)
{
if
(
$file
[
'type'
]
===
'dir'
)
{
$icon
=
\
OC
_Helper
::
mime
t
ypeIcon
(
'dir'
);
$icon
=
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
'dir'
);
// TODO: move this part to the client side, using mountType
if
(
$file
->
isShared
())
{
$icon
=
\
OC
_Helper
::
mime
t
ypeIcon
(
'dir-shared'
);
$icon
=
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
'dir-shared'
);
}
elseif
(
$file
->
isMounted
())
{
$icon
=
\
OC
_Helper
::
mime
t
ypeIcon
(
'dir-external'
);
$icon
=
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
'dir-external'
);
}
}
else
{
$icon
=
\
OC
_Helper
::
mime
t
ypeIcon
(
$file
->
getMimetype
());
$icon
=
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
$file
->
getMimetype
());
}
return
substr
(
$icon
,
0
,
-
3
)
.
'svg'
;
...
...
apps/files_sharing/templates/public.php
View file @
b460bde7
...
...
@@ -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
::
mime
t
ypeIcon
(
$_
[
'mimetype'
]));
?>
"
id=
"mimetypeIcon"
>
<input
type=
"hidden"
name=
"mimetypeIcon"
value=
"
<?php
p
(
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
$_
[
'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"
>
...
...
lib/private/helper.php
View file @
b460bde7
...
...
@@ -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
*
...
...
lib/private/preview.php
View file @
b460bde7
...
...
@@ -1168,7 +1168,7 @@ class Preview {
*/
private
function
getMimeIcon
()
{
$image
=
new
\
OC_Image
();
$mimeIconWebPath
=
\
OC
_Helper
::
mime
t
ypeIcon
(
$this
->
mimeType
);
$mimeIconWebPath
=
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
$this
->
mimeType
);
if
(
empty
(
\
OC
::
$WEBROOT
))
{
$mimeIconServerPath
=
\
OC
::
$SERVERROOT
.
$mimeIconWebPath
;
}
else
{
...
...
lib/private/template/functions.php
View file @
b460bde7
...
...
@@ -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
::
mime
t
ypeIcon
(
$mimetype
);
return
\
OC
::
$server
->
getMimeTypeDetector
()
->
mime
T
ypeIcon
(
$mimetype
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment