Translated using Weblate (Romanian)
[phpmyadmin.git] / navigation.php
blob2b1b85a5d2e76fab979a25fdc5bff4e6e4070eab
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 require_once './libraries/common.inc.php';
12 // Also initialises the collapsible tree class
13 require_once './libraries/navigation/Navigation.class.php';
15 $response = PMA_Response::getInstance();
16 $navigation = new PMA_Navigation();
17 if (! $response->isAjax()) {
18 $response->addHTML(
19 PMA_Message::error(
20 __('Fatal error: The navigation can only be accessed via AJAX')
23 exit;
26 $cfgRelation = PMA_getRelationsParam();
27 if (isset($cfgRelation['navwork']) && $cfgRelation['navwork']) {
28 if (isset($_REQUEST['hideNavItem'])) {
29 if (! empty($_REQUEST['itemName'])
30 && ! empty($_REQUEST['itemType'])
31 && ! empty($_REQUEST['dbName'])
32 ) {
33 $navigation->hideNavigationItem(
34 $_REQUEST['itemName'],
35 $_REQUEST['itemType'],
36 $_REQUEST['dbName'],
37 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
40 exit;
43 if (isset($_REQUEST['unhideNavItem'])) {
44 if (! empty($_REQUEST['itemName'])
45 && ! empty($_REQUEST['itemType'])
46 && ! empty($_REQUEST['dbName'])
47 ) {
48 $navigation->unhideNavigationItem(
49 $_REQUEST['itemName'],
50 $_REQUEST['itemType'],
51 $_REQUEST['dbName'],
52 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
55 exit;
58 if (isset($_REQUEST['showUnhideDialog'])) {
59 if (! empty($_REQUEST['dbName'])) {
60 $response->addJSON(
61 'message',
62 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
65 exit;
69 // Do the magic
70 $response->addJSON('message', $navigation->getDisplay());