Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded private wrapper methods #24379

Merged
merged 1 commit into from May 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 0 additions & 31 deletions lib/private/legacy/helper.php
Expand Up @@ -66,21 +66,6 @@ public static function linkToPublic($service, $add_slash = false) {
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
Expand Down Expand Up @@ -462,22 +447,6 @@ public static function recursiveArraySearch($haystack, $needle, $index = null) {
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
*
Expand Down
6 changes: 2 additions & 4 deletions lib/private/template/functions.php
Expand Up @@ -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]);
}

/**
Expand Down