From 4d3d8ed296a148b5dfdd7970ba2779e39ebe91db Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 31 Jan 2013 17:59:01 +0100 Subject: [PATCH] Trash: highlight Files navigation entry while in trash --- apps/files_trashbin/index.php | 30 ++++++++++++++++-------------- 1 file 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 @@ 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);