diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-02-28 20:03:06 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-02-28 20:03:06 +0100 |
commit | dee16deacd8a66c423d8b51ccfc23730823e4019 (patch) | |
tree | cc1de2c2ada6291366eb0a4db62fc9510f04cc9c /apps/files_trashbin/index.php | |
parent | 5f8bd079272c3e568d80bb984a65d9835a6b4393 (diff) | |
parent | a86761e1e720af148da6cbc3fd641da6b57fab5b (diff) | |
download | nextcloud-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.php | 19 |
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(); |