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 if (! defined('ROOT_PATH')) {
16 define('ROOT_PATH', __DIR__
. DIRECTORY_SEPARATOR
);
19 require_once ROOT_PATH
. 'libraries/common.inc.php';
21 // Also initialises the collapsible tree class
22 $response = Response
::getInstance();
23 $navigation = new Navigation();
24 if (! $response->isAjax()) {
26 PhpMyAdmin\Message
::error(
27 __('Fatal error: The navigation can only be accessed via AJAX')
33 if (isset($_POST['getNaviSettings']) && $_POST['getNaviSettings']) {
34 $response->addJSON('message', PageSettings
::getNaviSettings());
38 $relation = new Relation($GLOBALS['dbi']);
39 $cfgRelation = $relation->getRelationsParam();
40 if ($cfgRelation['navwork']) {
41 if (isset($_POST['hideNavItem'])) {
42 if (! empty($_POST['itemName'])
43 && ! empty($_POST['itemType'])
44 && ! empty($_POST['dbName'])
46 $navigation->hideNavigationItem(
50 (! empty($_POST['tableName']) ?
$_POST['tableName'] : null)
56 if (isset($_POST['unhideNavItem'])) {
57 if (! empty($_POST['itemName'])
58 && ! empty($_POST['itemType'])
59 && ! empty($_POST['dbName'])
61 $navigation->unhideNavigationItem(
65 (! empty($_POST['tableName']) ?
$_POST['tableName'] : null)
71 if (isset($_POST['showUnhideDialog'])) {
72 if (! empty($_POST['dbName'])) {
75 $navigation->getItemUnhideDialog($_POST['dbName'])
83 $response->addJSON('message', $navigation->getDisplay());