diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-05-08 16:24:24 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-05-15 17:51:04 +0200 |
commit | 88ebb15f1d91b82022e02903ab73338065e223b9 (patch) | |
tree | fab7c807dc21209aa00980701107e26d695dba74 /apps/files_trashbin | |
parent | 9ccb3279dd09b7042ab07c936a4c04127282476f (diff) | |
download | nextcloud-server-88ebb15f1d91b82022e02903ab73338065e223b9.tar.gz nextcloud-server-88ebb15f1d91b82022e02903ab73338065e223b9.zip |
Added navigation manager in files app for the sidebar
Apps can now register navigation items into the sidebar of the files app.
For every sidebar item there is a container.
The container's content is rendered based on the script name given at
registration time.
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/appinfo/app.php | 13 | ||||
-rw-r--r-- | apps/files_trashbin/index.php | 37 | ||||
-rw-r--r-- | apps/files_trashbin/templates/index.php | 7 |
3 files changed, 12 insertions, 45 deletions
diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index d30a601ef56..a045b1f0f51 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -1,7 +1,14 @@ <?php - -//OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'files_trashbin/lib/hooks.php'; -//OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'files_trashbin/lib/trash.php'; +$l = OC_L10N::get('files_trashbin'); // register hooks \OCA\Files_Trashbin\Trashbin::registerHooks(); + +\OCA\Files\App::getNavigationManager()->add( + array( + "appname" => 'files_trashbin', + "script" => 'index.php', + "order" => 1, + "name" => $l->t('Deleted files') + ) +); diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 16cd5ecd4cd..59258a6cf16 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -3,45 +3,12 @@ // Check if we are a user OCP\User::checkLoggedIn(); -OCP\App::setActiveNavigationEntry('files_index'); - OCP\Util::addScript('files_trashbin', 'disableDefaultActions'); -OCP\Util::addScript('files', 'fileactions'); -$tmpl = new OCP\Template('files_trashbin', 'index', 'user'); -OCP\Util::addStyle('files', 'files'); +$tmpl = new OCP\Template('files_trashbin', 'index', ''); + OCP\Util::addStyle('files_trashbin', 'trash'); -OCP\Util::addScript('files', 'filesummary'); -OCP\Util::addScript('files', 'breadcrumb'); -OCP\Util::addScript('files', 'filelist'); -// filelist overrides OCP\Util::addScript('files_trashbin', 'filelist'); -OCP\Util::addscript('files', 'files'); OCP\Util::addScript('files_trashbin', 'trash'); -$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); - -$nav = new OCP\Template('files', 'appnavigation', ''); -$nav->assign('trash', true); - -$tmpl->assign('appNavigation', $nav); - $tmpl->printPage(); diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index 02067385d4e..e90162e4d54 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -1,6 +1,4 @@ <?php /** @var $l OC_L10N */ ?> -<?php $_['appNavigation']->printPage(); ?> -<div id="app-content"> <div id="controls"> <div id="file_action_panel"></div> </div> @@ -8,10 +6,6 @@ <div id="emptycontent" class="hidden"><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div> -<input type="hidden" id="permissions" value="0"> -<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"> -<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir"> - <table id="filestable"> <thead> <tr> @@ -46,4 +40,3 @@ <tfoot> </tfoot> </table> -</div> |