nextcloud/apps/files_trashbin/index.php

48 lines
1.3 KiB
PHP
Raw Normal View History

2013-01-18 16:11:29 +04:00
<?php
2013-02-22 20:21:57 +04:00
// Check if we are a user
2013-01-18 16:11:29 +04:00
OCP\User::checkLoggedIn();
OCP\App::setActiveNavigationEntry('files_index');
2013-01-23 14:30:42 +04:00
OCP\Util::addScript('files_trashbin', 'disableDefaultActions');
2013-01-18 16:11:29 +04:00
OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_trashbin', 'index', 'user');
OCP\Util::addStyle('files', 'files');
2013-12-02 18:27:40 +04:00
OCP\Util::addStyle('files_trashbin', 'trash');
OCP\Util::addScript('files', 'filesummary');
OCP\Util::addScript('files', 'breadcrumb');
2013-01-18 16:11:29 +04:00
OCP\Util::addScript('files', 'filelist');
// filelist overrides
OCP\Util::addScript('files_trashbin', 'filelist');
OCP\Util::addscript('files', 'files');
2013-10-09 14:35:15 +04:00
OCP\Util::addScript('files_trashbin', 'trash');
2013-01-18 16:11:29 +04:00
2013-01-21 16:07:43 +04:00
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
$isIE8 = false;
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 0 && $matches[1] <= 8){
$isIE8 = true;
}
// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path"
if ($isIE8 && isset($_GET['dir'])){
if ($dir === ''){
$dir = '/';
}
header('Location: ' . OCP\Util::linkTo('files_trashbin', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir));
exit();
}
$tmpl->assign('dir', $dir);
$tmpl->assign('disableSharing', true);
2013-01-18 16:11:29 +04:00
$nav = new OCP\Template('files', 'appnavigation', '');
$nav->assign('trash', true);
$tmpl->assign('appNavigation', $nav);
2013-01-18 16:11:29 +04:00
$tmpl->printPage();