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 PhpMyAdmin\Config\PageSettings
;
11 use PhpMyAdmin\Navigation\Navigation
;
12 use PhpMyAdmin\Relation
;
13 use PhpMyAdmin\Response
;
16 require_once './libraries/common.inc.php';
18 // Also initialises the collapsible tree class
19 $response = Response
::getInstance();
20 $navigation = new Navigation();
21 if (! $response->isAjax()) {
23 PhpMyAdmin\Message
::error(
24 __('Fatal error: The navigation can only be accessed via AJAX')
30 if (isset($_POST['getNaviSettings']) && $_POST['getNaviSettings']) {
31 $response->addJSON('message', PageSettings
::getNaviSettings());
35 if (isset($_POST['reload'])) {
36 Util
::cacheSet('dbs_to_test', false);// Empty database list cache, see #14252
39 $relation = new Relation();
40 $cfgRelation = $relation->getRelationsParam();
41 if ($cfgRelation['navwork']) {
42 if (isset($_POST['hideNavItem'])) {
43 if (! empty($_POST['itemName'])
44 && ! empty($_POST['itemType'])
45 && ! empty($_POST['dbName'])
47 $navigation->hideNavigationItem(
51 (! empty($_POST['tableName']) ?
$_POST['tableName'] : null)
57 if (isset($_POST['unhideNavItem'])) {
58 if (! empty($_POST['itemName'])
59 && ! empty($_POST['itemType'])
60 && ! empty($_POST['dbName'])
62 $navigation->unhideNavigationItem(
66 (! empty($_POST['tableName']) ?
$_POST['tableName'] : null)
72 if (isset($_POST['showUnhideDialog'])) {
73 if (! empty($_POST['dbName'])) {
76 $navigation->getItemUnhideDialog($_POST['dbName'])
84 $response->addJSON('message', $navigation->getDisplay());