From 39c387eed4e5da7bddb6f7cd48a8f8b607f3b8dd Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 26 Jun 2013 18:04:18 +0200 Subject: [PATCH] implement server side use of previews --- apps/files/templates/part.list.php | 3 ++- lib/helper.php | 11 +++++++++++ lib/public/template.php | 9 +++++++++ lib/template.php | 12 ++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 1e94275dcba..6dabd7d6970 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -1,6 +1,7 @@ style="background-image:url()" - style="background-image:url()" + style="background-image:url()" > diff --git a/lib/helper.php b/lib/helper.php index a315c640d1a..e8cc81774dd 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -223,6 +223,17 @@ class OC_Helper { } } + /** + * @brief 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 self::linkToRoute( 'core_ajax_preview', array('x' => 32, 'y' => 32, 'file' => $path)); + } + /** * @brief Make a human file size * @param int $bytes file size in bytes diff --git a/lib/public/template.php b/lib/public/template.php index ccf19cf052c..5f9888f9f28 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -54,6 +54,15 @@ function mimetype_icon( $mimetype ) { return(\mimetype_icon( $mimetype )); } +/** + * @brief make preview_icon available as a simple function + * Returns the path to the preview of the image. + * @param $path path of file + * @returns link to the preview + */ +function preview_icon( $path ) { + return(\preview_icon( $path )); +} /** * @brief make OC_Helper::humanFileSize available as a simple function diff --git a/lib/template.php b/lib/template.php index ae9ea187445..048d172f1c9 100644 --- a/lib/template.php +++ b/lib/template.php @@ -62,6 +62,18 @@ function image_path( $app, $image ) { return OC_Helper::imagePath( $app, $image ); } +/** + * @brief make preview_icon available as a simple function + * Returns the path to the preview of the image. + * @param $path path of file + * @returns link to the preview + * + * For further information have a look at OC_Helper::previewIcon + */ +function preview_icon( $path ) { + return OC_Helper::previewIcon( $path ); +} + /** * @brief make OC_Helper::mimetypeIcon available as a simple function * @param string $mimetype mimetype -- 2.39.5