Trash: highlight Files navigation entry while in trash
This commit is contained in:
parent
5417e44b2a
commit
4d3d8ed296
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue