diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-31 17:59:01 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-31 17:59:01 +0100 |
commit | 4d3d8ed296a148b5dfdd7970ba2779e39ebe91db (patch) | |
tree | 41412205c0830ae87ecfced3800f6c26f26db259 /apps | |
parent | 5417e44b2a6d03042156e002264525091f66a6ad (diff) | |
download | nextcloud-server-4d3d8ed296a148b5dfdd7970ba2779e39ebe91db.tar.gz nextcloud-server-4d3d8ed296a148b5dfdd7970ba2779e39ebe91db.zip |
Trash: highlight Files navigation entry while in trash
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/index.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 46a601cfdde..a07ef8a68ad 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -1,8 +1,10 @@ <?php -// Check if we are a user
+// 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'); @@ -18,7 +20,7 @@ $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; if ($dir) { $dirlisting = true; - $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin');
+ $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin'); $fullpath = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($dir); $dirContent = opendir($fullpath); $i = 0; @@ -35,7 +37,7 @@ if ($dir) { 'type' => $view->is_dir($dir.'/'.$entryName) ? 'dir' : 'file', 'location' => $dir, ); - }
+ } } closedir($fullpath); @@ -66,28 +68,28 @@ foreach ($result as $r) { $files[] = $i; } -// Make breadcrumb
-$breadcrumb = array(array('dir' => '', 'name' => 'Trash'));
-$pathtohere = '';
-foreach (explode('/', $dir) as $i) {
+// Make breadcrumb +$breadcrumb = array(array('dir' => '', 'name' => 'Trash')); +$pathtohere = ''; +foreach (explode('/', $dir) as $i) { if ($i != '') { if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) { $name = $match[1]; } else { $name = $i; - }
- $pathtohere .= '/' . $i;
- $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name);
- }
+ } + $pathtohere .= '/' . $i; + $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name); + } } -$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
-$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
+$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); +$breadcrumbNav->assign('breadcrumb', $breadcrumb, false); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir=', false); $list = new OCP\Template('files_trashbin', 'part.list', ''); $list->assign('files', $files, false); -$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false);
+$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false); $list->assign('downloadURL', OCP\Util::linkTo('files_trashbin', 'download.php') . '?file='.$dir, false); $list->assign('disableSharing', true); $list->assign('dirlisting', $dirlisting); |