diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-07-08 10:53:53 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-07-08 10:53:53 +0200 |
commit | 04292ff16c56d85216ddbd6f644e8055413c0170 (patch) | |
tree | d05dfd86565997c95a33f536b34a3a904e38c531 /lib/preview.php | |
parent | 6e864e6599602609b5808ae4d043b273a9fe5071 (diff) | |
download | nextcloud-server-04292ff16c56d85216ddbd6f644e8055413c0170.tar.gz nextcloud-server-04292ff16c56d85216ddbd6f644e8055413c0170.zip |
implement use of preview icons in thrashbin app
Diffstat (limited to 'lib/preview.php')
-rwxr-xr-x | lib/preview.php | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/lib/preview.php b/lib/preview.php index 87e2e78d1d8..f12107c9f57 100755 --- a/lib/preview.php +++ b/lib/preview.php @@ -519,10 +519,6 @@ class Preview { $file = ''; $maxX = 0; $maxY = 0; - /* - * use: ?scalingup=0 / ?scalingup = 1 - * do not use ?scalingup=false / ?scalingup = true as these will always be true - */ $scalingup = true; if(array_key_exists('file', $_GET)) $file = (string) urldecode($_GET['file']); @@ -610,6 +606,37 @@ class Preview { } } + public static function trashbinPreviewRouter() { + if(!\OC_App::isEnabled('files_trashbin')){ + exit; + } + \OC_Util::checkLoggedIn(); + + $file = ''; + $maxX = 0; + $maxY = 0; + $scalingup = true; + + if(array_key_exists('file', $_GET)) $file = (string) urldecode($_GET['file']); + if(array_key_exists('x', $_GET)) $maxX = (int) $_GET['x']; + if(array_key_exists('y', $_GET)) $maxY = (int) $_GET['y']; + if(array_key_exists('scalingup', $_GET)) $scalingup = (bool) $_GET['scalingup']; + + if($file !== '' && $maxX !== 0 && $maxY !== 0) { + try{ + $preview = new Preview(\OC_User::getUser(), 'files_trashbin/files', $file, $maxX, $maxY, $scalingup); + $preview->showPreview(); + }catch(\Exception $e) { + \OC_Response::setStatus(404); + \OC_Log::write('core', $e->getmessage(), \OC_Log::ERROR); + exit; + } + }else{ + \OC_Response::setStatus(404); + exit; + } + } + public static function post_write($args) { self::post_delete($args); } |