relation = new Relation(); } /** * Renders the navigation tree, or part of it * * @return string The navigation tree */ public function getDisplay() { /* Init */ $retval = ''; $response = Response::getInstance(); if (! $response->isAjax()) { $header = new NavigationHeader(); $retval = $header->getDisplay(); } $tree = new NavigationTree(); if (! $response->isAjax() || ! empty($_POST['full']) || ! empty($_POST['reload']) ) { if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) { // provide database tree in navigation $navRender = $tree->renderState(); } else { // provide legacy pre-4.0 navigation $navRender = $tree->renderDbSelect(); } } else { $navRender = $tree->renderPath(); } if (! $navRender) { $retval .= Message::error( __('An error has occurred while loading the navigation display') )->getDisplay(); } else { $retval .= $navRender; } if (! $response->isAjax()) { // closes the tags that were opened by the navigation header $retval .= ''; // pma_navigation_tree $retval .= '
'; //pma_navi_settings_container $retval .= ''; // pma_navigation_content $retval .= $this->_getDropHandler(); $retval .= ''; // pma_navigation } 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 = Util::backquote($GLOBALS['cfgRelation']['db']) . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); $sqlQuery = "INSERT INTO " . $navTable . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" . " VALUES (" . "'" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'," . "'" . $GLOBALS['dbi']->escapeString($itemName) . "'," . "'" . $GLOBALS['dbi']->escapeString($itemType) . "'," . "'" . $GLOBALS['dbi']->escapeString($dbName) . "'," . "'" . (! empty($tableName)? $GLOBALS['dbi']->escapeString($tableName) : "" ) . "')"; $this->relation->queryAsControlUser($sqlQuery, false); } /** * Inserts Drag and Drop Import handler * * @return string html code for drop handler */ private function _getDropHandler() { $retval = ''; $retval .= '