2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * The navigation panel - displays server, db and table selection tree
6 * @package PhpMyAdmin-Navigation
9 // Include common functionalities
10 use PMA\libraries\Response
;
11 use PMA\libraries\config\PageSettings
;
12 use PMA\libraries\navigation\Navigation
;
14 require_once './libraries/common.inc.php';
16 // Also initialises the collapsible tree class
17 $response = Response
::getInstance();
18 $navigation = new Navigation();
19 if (! $response->isAjax()) {
21 PMA\libraries\Message
::error(
22 __('Fatal error: The navigation can only be accessed via AJAX')
28 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
29 $response->addJSON('message', PageSettings
::getNaviSettings());
33 $cfgRelation = PMA_getRelationsParam();
34 if ($cfgRelation['navwork']) {
35 if (isset($_REQUEST['hideNavItem'])) {
36 if (! empty($_REQUEST['itemName'])
37 && ! empty($_REQUEST['itemType'])
38 && ! empty($_REQUEST['dbName'])
40 $navigation->hideNavigationItem(
41 $_REQUEST['itemName'],
42 $_REQUEST['itemType'],
44 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
50 if (isset($_REQUEST['unhideNavItem'])) {
51 if (! empty($_REQUEST['itemName'])
52 && ! empty($_REQUEST['itemType'])
53 && ! empty($_REQUEST['dbName'])
55 $navigation->unhideNavigationItem(
56 $_REQUEST['itemName'],
57 $_REQUEST['itemType'],
59 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
65 if (isset($_REQUEST['showUnhideDialog'])) {
66 if (! empty($_REQUEST['dbName'])) {
69 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
77 $response->addJSON('message', $navigation->getDisplay());