diff options
author | Kasun Chathuranga <chathuranga.jayaneththi@gmail.com> | 2013-07-20 21:43:25 +0400 |
---|---|---|
committer | Kasun Chathuranga <chathuranga.jayaneththi@gmail.com> | 2013-07-20 21:43:25 +0400 |
commit | 66d01fcffb40eecde04bcb35119b2011f42626e9 (patch) | |
tree | 00cd257ff706a2e5ec8249ee7c84be4236a01c20 /navigation.php | |
parent | 342e0a6b33ec1ce5d76feaa44c87689de55762d4 (diff) |
Hide tables in navigation tree
Diffstat (limited to 'navigation.php')
-rw-r--r-- | navigation.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/navigation.php b/navigation.php index 4b4b3b36f7..2c5080d5b2 100644 --- a/navigation.php +++ b/navigation.php @@ -1,7 +1,7 @@ <?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** - * the navigation frame - displays server, db and table selection tree + * The navigation panel - displays server, db and table selection tree * * @package PhpMyAdmin-Navigation */ @@ -12,6 +12,25 @@ require_once './libraries/common.inc.php'; // Also initialises the collapsible tree class require_once './libraries/navigation/Navigation.class.php'; +$cfgRelation = PMA_getRelationsParam(); +if (isset($_REQUEST['hideNavItem']) && $cfgRelation['navwork']) { + if (! empty($_REQUEST['itemName']) && ! empty($_REQUEST['itemType'])) { + $navTable = PMA_Util::backquote($cfgRelation['db']) + . "." . PMA_Util::backquote($cfgRelation['navigation']); + $sqlQuery = "INSERT INTO " . $navTable + . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" + . " VALUES (" + . "'" . $GLOBALS['cfg']['Server']['user'] . "'," + . "'" . $_REQUEST['itemName'] . "'," + . "'" . $_REQUEST['itemType'] . "'," + . "'" . (! empty($_REQUEST['dbName']) ? $_REQUEST['dbName'] : "") . "'," + . "'" . (! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : "") + . "')"; + PMA_queryAsControlUser($sqlQuery, true); + } + exit; +} + // Do the magic $response = PMA_Response::getInstance(); if ($response->isAjax()) { |