isAjax()) { $header = new PMA_NavigationHeader(); $retval = $header->getDisplay(); } $tree = new PMA_NavigationTree(); if (! PMA_Response::getInstance()->isAjax() || ! empty($_REQUEST['full']) || ! empty($_REQUEST['reload']) ) { $treeRender = $tree->renderState(); } else { $treeRender = $tree->renderPath(); } if (! $treeRender) { $retval .= PMA_Message::error( __('An error has occurred while loading the navigation tree') )->getDisplay(); } else { $retval .= $treeRender; } if (! PMA_Response::getInstance()->isAjax()) { // closes the tags that were opened by the navigation header $retval .= ''; $retval .= ''; $retval .= ''; } return $retval; } /** * Add an item of navigation tree to the hidden items list in PMA database. * * @param string $itemName name of the navigation tree item * @param string $itemType type of the navigation tree item * @param string $dbName database name * @param string $tableName table name if applicable * * @return void */ public function hideNavigationItem( $itemName, $itemType, $dbName, $tableName = null ) { $navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); $sqlQuery = "INSERT INTO " . $navTable . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" . " VALUES (" . "'" . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "'," . "'" . PMA_Util::sqlAddSlashes($itemName) . "'," . "'" . PMA_Util::sqlAddSlashes($itemType) . "'," . "'" . PMA_Util::sqlAddSlashes($dbName) . "'," . "'" . (! empty($tableName)? PMA_Util::sqlAddSlashes($tableName) : "" ) . "')"; PMA_queryAsControlUser($sqlQuery, false); } /** * Remove a hidden item of navigation tree from the * list of hidden items in PMA database. * * @param string $itemName name of the navigation tree item * @param string $itemType type of the navigation tree item * @param string $dbName database name * @param string $tableName table name if applicable * * @return void */ public function unhideNavigationItem( $itemName, $itemType, $dbName, $tableName = null ) { $navTable = PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); $sqlQuery = "DELETE FROM " . $navTable . " WHERE" . " `username`='" . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "'" . " AND `item_name`='" . PMA_Util::sqlAddSlashes($itemName) . "'" . " AND `item_type`='" . PMA_Util::sqlAddSlashes($itemType) . "'" . " AND `db_name`='" . PMA_Util::sqlAddSlashes($dbName) . "'" . (! empty($tableName) ? " AND `table_name`='" . PMA_Util::sqlAddSlashes($tableName) . "'" : "" ); PMA_queryAsControlUser($sqlQuery, false); } /** * Returns HTML for the dialog to show hidden nativation items. * * @param string $dbName database name * @param string $itemType type of the items to include * @param string $tableName table name * * @return string HTML for the dialog to show hidden nativation items */ public function getItemUnhideDialog($dbName, $itemType = null, $tableName = null) { $html = '
'; return $html; } } ?>