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\config\PageSettings
;
11 use PMA\libraries\navigation\Navigation
;
13 require_once './libraries/common.inc.php';
15 // Also initialises the collapsible tree class
16 $response = PMA\libraries\Response
::getInstance();
17 $navigation = new Navigation();
18 if (! $response->isAjax()) {
20 PMA\libraries\Message
::error(
21 __('Fatal error: The navigation can only be accessed via AJAX')
27 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
28 $response->addJSON('message', PageSettings
::getNaviSettings());
32 $cfgRelation = PMA_getRelationsParam();
33 if ($cfgRelation['navwork']) {
34 if (isset($_REQUEST['hideNavItem'])) {
35 if (! empty($_REQUEST['itemName'])
36 && ! empty($_REQUEST['itemType'])
37 && ! empty($_REQUEST['dbName'])
39 $navigation->hideNavigationItem(
40 $_REQUEST['itemName'],
41 $_REQUEST['itemType'],
43 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
49 if (isset($_REQUEST['unhideNavItem'])) {
50 if (! empty($_REQUEST['itemName'])
51 && ! empty($_REQUEST['itemType'])
52 && ! empty($_REQUEST['dbName'])
54 $navigation->unhideNavigationItem(
55 $_REQUEST['itemName'],
56 $_REQUEST['itemType'],
58 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
64 if (isset($_REQUEST['showUnhideDialog'])) {
65 if (! empty($_REQUEST['dbName'])) {
68 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
76 $response->addJSON('message', $navigation->getDisplay());