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
8 declare(strict_types
=1);
10 use PhpMyAdmin\Config\PageSettings
;
11 use PhpMyAdmin\Navigation\Navigation
;
12 use PhpMyAdmin\Relation
;
13 use PhpMyAdmin\Response
;
15 require_once './libraries/common.inc.php';
17 // Also initialises the collapsible tree class
18 $response = Response
::getInstance();
19 $navigation = new Navigation();
20 if (! $response->isAjax()) {
22 PhpMyAdmin\Message
::error(
23 __('Fatal error: The navigation can only be accessed via AJAX')
29 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
30 $response->addJSON('message', PageSettings
::getNaviSettings());
34 $relation = new Relation();
35 $cfgRelation = $relation->getRelationsParam();
36 if ($cfgRelation['navwork']) {
37 if (isset($_REQUEST['hideNavItem'])) {
38 if (! empty($_REQUEST['itemName'])
39 && ! empty($_REQUEST['itemType'])
40 && ! empty($_REQUEST['dbName'])
42 $navigation->hideNavigationItem(
43 $_REQUEST['itemName'],
44 $_REQUEST['itemType'],
46 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
52 if (isset($_REQUEST['unhideNavItem'])) {
53 if (! empty($_REQUEST['itemName'])
54 && ! empty($_REQUEST['itemType'])
55 && ! empty($_REQUEST['dbName'])
57 $navigation->unhideNavigationItem(
58 $_REQUEST['itemName'],
59 $_REQUEST['itemType'],
61 (! empty($_REQUEST['tableName']) ?
$_REQUEST['tableName'] : null)
67 if (isset($_REQUEST['showUnhideDialog'])) {
68 if (! empty($_REQUEST['dbName'])) {
71 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
79 $response->addJSON('message', $navigation->getDisplay());