diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 10:56:28 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 10:56:28 -0400 |
commit | 59655e9afdb896ca298caf24e9f698885d91a37e (patch) | |
tree | b0a40a5791e6fddb15f8d40b63477deb1c7d2e6a /lib/helper.php | |
parent | 24a401a548fd65bd546ed61c38236d286c657eb5 (diff) | |
download | nextcloud-server-59655e9afdb896ca298caf24e9f698885d91a37e.tar.gz nextcloud-server-59655e9afdb896ca298caf24e9f698885d91a37e.zip |
Style fixes
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/helper.php b/lib/helper.php index 9e4978f6b96..225e9fd2a9a 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -188,38 +188,38 @@ class OC_Helper { * * Returns the path to the image of this file type. */ - public static function mimetypeIcon( $mimetype ) { - $alias=array('application/xml'=>'code/xml'); - if(isset($alias[$mimetype])) { - $mimetype=$alias[$mimetype]; + public static function mimetypeIcon($mimetype) { + $alias = array('application/xml' => 'code/xml'); + if (isset($alias[$mimetype])) { + $mimetype = $alias[$mimetype]; } if (isset(self::$mimetypeIcons[$mimetype])) { return self::$mimetypeIcons[$mimetype]; } // Replace slash and backslash with a minus - $icon = str_replace( "/", "-", $mimetype ); - $icon = str_replace( "\\", "-", $icon ); + $icon = str_replace('/', '-', $mimetype); + $icon = str_replace( '\\', '-', $icon); // Is it a dir? - if( $mimetype == "dir" ) { - self::$mimetypeIcons[$mimetype] = OC::$WEBROOT."/core/img/filetypes/folder.png"; - return OC::$WEBROOT."/core/img/filetypes/folder.png"; + if ($mimetype === 'dir') { + self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/folder.png'; + return OC::$WEBROOT.'/core/img/filetypes/folder.png'; } // Icon exists? - if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$icon.png" )) { - self::$mimetypeIcons[$mimetype] = OC::$WEBROOT."/core/img/filetypes/$icon.png"; - return OC::$WEBROOT."/core/img/filetypes/$icon.png"; + if (file_exists(OC::$SERVERROOT.'/core/img/filetypes/'.$icon.'.png')) { + self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/'.$icon.'.png'; + return OC::$WEBROOT.'/core/img/filetypes/'.$icon.'.png'; } - //try only the first part of the filetype - $mimePart=substr($icon, 0, strpos($icon, '-')); - if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimePart.png" )) { - self::$mimetypeIcons[$mimetype] = OC::$WEBROOT."/core/img/filetypes/$mimePart.png"; - return OC::$WEBROOT."/core/img/filetypes/$mimePart.png"; - } - else{ - self::$mimetypeIcons[$mimetype] = OC::$WEBROOT."/core/img/filetypes/file.png"; - return OC::$WEBROOT."/core/img/filetypes/file.png"; + + // Try only the first part of the filetype + $mimePart = substr($icon, 0, strpos($icon, '-')); + if (file_exists(OC::$SERVERROOT.'/core/img/filetypes/'.$mimePart.'.png')) { + self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/'.$mimePart.'.png'; + return OC::$WEBROOT.'/core/img/filetypes/'.$mimePart.'.png'; + } else { + self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/file.png'; + return OC::$WEBROOT.'/core/img/filetypes/file.png'; } } |