Translated using Weblate (Tamil)
[phpmyadmin.git] / navigation.php
blobaf103bf2a74311832d8d03530eda799a5233c395
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\Response;
11 use PMA\libraries\config\PageSettings;
12 use PMA\libraries\navigation\Navigation;
14 require_once './libraries/common.inc.php';
16 // Also initialises the collapsible tree class
17 $response = Response::getInstance();
18 $navigation = new Navigation();
19 if (! $response->isAjax()) {
20 $response->addHTML(
21 PMA\libraries\Message::error(
22 __('Fatal error: The navigation can only be accessed via AJAX')
25 exit;
28 if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
29 $response->addJSON('message', PageSettings::getNaviSettings());
30 exit();
33 $cfgRelation = PMA_getRelationsParam();
34 if ($cfgRelation['navwork']) {
35 if (isset($_REQUEST['hideNavItem'])) {
36 if (! empty($_REQUEST['itemName'])
37 && ! empty($_REQUEST['itemType'])
38 && ! empty($_REQUEST['dbName'])
39 ) {
40 $navigation->hideNavigationItem(
41 $_REQUEST['itemName'],
42 $_REQUEST['itemType'],
43 $_REQUEST['dbName'],
44 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
47 exit;
50 if (isset($_REQUEST['unhideNavItem'])) {
51 if (! empty($_REQUEST['itemName'])
52 && ! empty($_REQUEST['itemType'])
53 && ! empty($_REQUEST['dbName'])
54 ) {
55 $navigation->unhideNavigationItem(
56 $_REQUEST['itemName'],
57 $_REQUEST['itemType'],
58 $_REQUEST['dbName'],
59 (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
62 exit;
65 if (isset($_REQUEST['showUnhideDialog'])) {
66 if (! empty($_REQUEST['dbName'])) {
67 $response->addJSON(
68 'message',
69 $navigation->getItemUnhideDialog($_REQUEST['dbName'])
72 exit;
76 // Do the magic
77 $response->addJSON('message', $navigation->getDisplay());