Translated using Weblate (Estonian)
[phpmyadmin.git] / navigation.php
blobf7f2f2ac7cbe399b35c83c7484393046d96e3ed3
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 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
27 $response->addJSON('message', PMA_PageSettings::getNaviSettings());
28 exit();
31 $cfgRelation = PMA_getRelationsParam();
32 if (isset($cfgRelation['navwork']) && $cfgRelation['navwork']) {
33 if (isset($_REQUEST['hideNavItem'])) {
34 if (! empty($_REQUEST['itemName'])
35 && ! empty($_REQUEST['itemType'])
36 && ! empty($_REQUEST['dbName'])
37 ) {
38 $navigation->hideNavigationItem(
39 $_REQUEST['itemName'],
40 $_REQUEST['itemType'],
41 $_REQUEST['dbName'],
42 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
45 exit;
48 if (isset($_REQUEST['unhideNavItem'])) {
49 if (! empty($_REQUEST['itemName'])
50 && ! empty($_REQUEST['itemType'])
51 && ! empty($_REQUEST['dbName'])
52 ) {
53 $navigation->unhideNavigationItem(
54 $_REQUEST['itemName'],
55 $_REQUEST['itemType'],
56 $_REQUEST['dbName'],
57 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
60 exit;
63 if (isset($_REQUEST['showUnhideDialog'])) {
64 if (! empty($_REQUEST['dbName'])) {
65 $response->addJSON(
66 'message',
67 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
70 exit;
74 // Do the magic
75 $response->addJSON('message', $navigation->getDisplay());