aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/index.php
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2013-02-28 05:43:51 -0800
committerJan-Christoph Borchardt <hey@jancborchardt.net>2013-02-28 05:43:51 -0800
commit6d4b344f5d8e1330a66836684053453ec4cc2ed9 (patch)
tree049426af3d7a86673b47c33f9608b97dafba4d23 /apps/files_trashbin/index.php
parent4223e99629b2e46bab05195b8788e78b4c25f588 (diff)
parent12fd47af395d5d5fdbcc1da7f8df4feccbea9fd9 (diff)
downloadnextcloud-server-6d4b344f5d8e1330a66836684053453ec4cc2ed9.tar.gz
nextcloud-server-6d4b344f5d8e1330a66836684053453ec4cc2ed9.zip
Merge pull request #1397 from owncloud/trash_fileactions
Enable fileactions while viewing trash
Diffstat (limited to 'apps/files_trashbin/index.php')
-rw-r--r--apps/files_trashbin/index.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index 2f1fb32f8ce..31b46cc2dec 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -3,6 +3,8 @@
// Check if we are a user
OCP\User::checkLoggedIn();
+OCP\App::setActiveNavigationEntry('files_index');
+
OCP\Util::addScript('files_trashbin', 'trash');
OCP\Util::addScript('files_trashbin', 'disableDefaultActions');
OCP\Util::addScript('files', 'fileactions');
@@ -41,7 +43,7 @@ if ($dir) {
} else {
$dirlisting = false;
- $query = \OC_DB::prepare('SELECT id,location,timestamp,type,mime FROM *PREFIX*files_trash WHERE user=?');
+ $query = \OC_DB::prepare('SELECT `id`,`location`,`timestamp`,`type`,`mime` FROM `*PREFIX*files_trash` WHERE user = ?');
$result = $query->execute(array($user))->fetchAll();
}
@@ -66,6 +68,18 @@ foreach ($result as $r) {
$files[] = $i;
}
+function fileCmp($a, $b) {
+ if ($a['type'] == 'dir' and $b['type'] != 'dir') {
+ return -1;
+ } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') {
+ return 1;
+ } else {
+ return strnatcasecmp($a['name'], $b['name']);
+ }
+}
+
+usort($files, "fileCmp");
+
// Make breadcrumb
$pathtohere = '';
$breadcrumb = array();
@@ -93,9 +107,9 @@ $list->assign('disableSharing', true);
$list->assign('dirlisting', $dirlisting);
$list->assign('disableDownloadActions', true);
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
+$tmpl->assign('dirlisting', $dirlisting);
$tmpl->assign('fileList', $list->fetchPage(), false);
$tmpl->assign('files', $files);
-$tmpl->assign('dirlisting', $dirlisting);
-$tmpl->assign('dir', OC_Filesystem::normalizePath($view->getAbsolutePath()));
+$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($view->getAbsolutePath()));
$tmpl->printPage();