/** * Renders the navigation tree, or part of it * * @return string The navigation tree */ public function getDisplay() { /* Init */ $retval = ''; if (!PMA_Response::getInstance()->isAjax()) { $header = new PMA_NavigationHeader(); $retval = $header->getDisplay(); } $tree = new PMA_NavigationTree(); if (!PMA_Response::getInstance()->isAjax() || !empty($_REQUEST['full']) || !empty($_REQUEST['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 .= PMA_Message::error(__('An error has occurred while loading the navigation display'))->getDisplay(); } else { $retval .= $navRender; } if (!PMA_Response::getInstance()->isAjax()) { // closes the tags that were opened by the navigation header $retval .= '</div>'; // pma_navigation_tree $retval .= '<div id="pma_navi_settings_container">'; if (!defined('PMA_DISABLE_NAVI_SETTINGS')) { $retval .= PMA_PageSettings::getNaviSettings(); } $retval .= '</div>'; //pma_navi_settings_container $retval .= '</div>'; // pma_navigation_content $retval .= $this->_getDropHandler(); $retval .= '</div>'; // pma_navigation } return $retval; }
/** * Very basic select rendering test. * * @return void */ public function testRenderDbSelect() { $result = $this->object->renderDbSelect(); $this->assertContains('pma_navigation_select_database', $result); }