Remove unneeded private wrapper methods
This commit is contained in:
parent
b8650be732
commit
5595e038ae
|
@ -66,21 +66,6 @@ class OC_Helper {
|
|||
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
|
||||
* @param int $bytes file size in bytes
|
||||
|
@ -462,22 +447,6 @@ class OC_Helper {
|
|||
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
|
||||
*
|
||||
|
|
|
@ -184,18 +184,16 @@ function mimetype_icon( $mimetype ) {
|
|||
* Returns the path to the preview of the image.
|
||||
* @param string $path path of file
|
||||
* @return link to the preview
|
||||
*
|
||||
* For further information have a look at OC_Helper::previewIcon
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue