Remove unneeded private wrapper methods

This commit is contained in:
Morris Jobke 2016-05-02 11:23:14 +02:00
parent b8650be732
commit 5595e038ae
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
2 changed files with 2 additions and 35 deletions

View File

@ -66,21 +66,6 @@ class OC_Helper {
return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : ''); return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
} }
/**
* get path to preview of file
* @param string $path path
* @return string the url
*
* Returns the path to the preview of the file.
*/
public static function previewIcon($path) {
return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_preview', ['x' => 32, 'y' => 32, 'file' => $path]);
}
public static function publicPreviewIcon( $path, $token ) {
return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_public_preview', ['x' => 32, 'y' => 32, 'file' => $path, 't' => $token]);
}
/** /**
* Make a human file size * Make a human file size
* @param int $bytes file size in bytes * @param int $bytes file size in bytes
@ -462,22 +447,6 @@ class OC_Helper {
return false; return false;
} }
/**
* Shortens str to maxlen by replacing characters in the middle with '...', eg.
* ellipsis('a very long string with lots of useless info to make a better example', 14) becomes 'a very ...example'
*
* @param string $str the string
* @param string $maxlen the maximum length of the result
* @return string with at most maxlen characters
*/
public static function ellipsis($str, $maxlen) {
if (strlen($str) > $maxlen) {
$characters = floor($maxlen / 2);
return substr($str, 0, $characters) . '...' . substr($str, -1 * $characters);
}
return $str;
}
/** /**
* calculates the maximum upload size respecting system settings, free space and user quota * calculates the maximum upload size respecting system settings, free space and user quota
* *

View File

@ -184,18 +184,16 @@ function mimetype_icon( $mimetype ) {
* Returns the path to the preview of the image. * Returns the path to the preview of the image.
* @param string $path path of file * @param string $path path of file
* @return link to the preview * @return link to the preview
*
* For further information have a look at OC_Helper::previewIcon
*/ */
function preview_icon( $path ) { function preview_icon( $path ) {
return OC_Helper::previewIcon( $path ); return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_preview', ['x' => 32, 'y' => 32, 'file' => $path]);
} }
/** /**
* @param string $path * @param string $path
*/ */
function publicPreview_icon ( $path, $token ) { function publicPreview_icon ( $path, $token ) {
return OC_Helper::publicPreviewIcon( $path, $token ); return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_public_preview', ['x' => 32, 'y' => 32, 'file' => $path, 't' => $token]);
} }
/** /**