Renders a state of the tree, used in light mode when
either JavaScript and/or Ajax are disabled
public renderState ( ) : string | ||
Результат | string | HTML code for the navigation tree |
/** * Renders the navigation tree, or part of it * * @return string The navigation tree */ public function getDisplay() { /* Init */ $retval = ''; if (!Response::getInstance()->isAjax()) { $header = new NavigationHeader(); $retval = $header->getDisplay(); } $tree = new NavigationTree(); if (!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 .= Message::error(__('An error has occurred while loading the navigation display'))->getDisplay(); } else { $retval .= $navRender; } if (!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 .= PageSettings::getNaviSettings(); } $retval .= '</div>'; //pma_navi_settings_container $retval .= '</div>'; // pma_navigation_content $retval .= $this->_getDropHandler(); $retval .= '</div>'; // pma_navigation } return $retval; }
/** * Very basic rendering test. * * @return void */ public function testRenderState() { $result = $this->object->renderState(); $this->assertContains('pma_quick_warp', $result); }