summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/index.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2013-02-28 20:03:06 +0100
committerLukas Reschke <lukas@statuscode.ch>2013-02-28 20:03:06 +0100
commitdee16deacd8a66c423d8b51ccfc23730823e4019 (patch)
treecc1de2c2ada6291366eb0a4db62fc9510f04cc9c /apps/files_trashbin/index.php
parent5f8bd079272c3e568d80bb984a65d9835a6b4393 (diff)
parenta86761e1e720af148da6cbc3fd641da6b57fab5b (diff)
downloadnextcloud-server-dee16deacd8a66c423d8b51ccfc23730823e4019.tar.gz
nextcloud-server-dee16deacd8a66c423d8b51ccfc23730823e4019.zip
Merge master
Diffstat (limited to 'apps/files_trashbin/index.php')
-rw-r--r--apps/files_trashbin/index.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index 913bac1fbb7..8e726836f8a 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();
@@ -95,7 +109,6 @@ $list->assign('disableDownloadActions', true);
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
$tmpl->assign('fileList', $list->fetchPage());
$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();