Translated using Weblate (French)
[phpmyadmin.git] / navigation.php
blobfd36d1b39bee37d99e525607321f58b2791565c5
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * The navigation panel - displays server, db and table selection tree
6 * @package PhpMyAdmin-Navigation
7 */
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()) {
19 $response->addHTML(
20 PMA\libraries\Message::error(
21 __('Fatal error: The navigation can only be accessed via AJAX')
24 exit;
27 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
28 $response->addJSON('message', PageSettings::getNaviSettings());
29 exit();
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'])
38 ) {
39 $navigation->hideNavigationItem(
40 $_REQUEST['itemName'],
41 $_REQUEST['itemType'],
42 $_REQUEST['dbName'],
43 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
46 exit;
49 if (isset($_REQUEST['unhideNavItem'])) {
50 if (! empty($_REQUEST['itemName'])
51 && ! empty($_REQUEST['itemType'])
52 && ! empty($_REQUEST['dbName'])
53 ) {
54 $navigation->unhideNavigationItem(
55 $_REQUEST['itemName'],
56 $_REQUEST['itemType'],
57 $_REQUEST['dbName'],
58 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
61 exit;
64 if (isset($_REQUEST['showUnhideDialog'])) {
65 if (! empty($_REQUEST['dbName'])) {
66 $response->addJSON(
67 'message',
68 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
71 exit;
75 // Do the magic
76 $response->addJSON('message', $navigation->getDisplay());