PMA\libraries\navigation\Navigation::getDisplay PHP Метод

getDisplay() публичный Метод

Renders the navigation tree, or part of it
public getDisplay ( ) : string
Результат 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;
    }

Usage Example

Пример #1
0
 /**
  * Generates the header
  *
  * @return string The header
  */
 public function getDisplay()
 {
     $retval = '';
     if (!$this->_headerIsSent) {
         if (!$this->_isAjax && $this->_isEnabled) {
             $this->sendHttpHeaders();
             $retval .= $this->_getHtmlStart();
             $retval .= $this->_getMetaTags();
             $retval .= $this->_getLinkTags();
             $retval .= $this->getTitleTag();
             // The user preferences have been merged at this point
             // so we can conditionally add CodeMirror
             if ($GLOBALS['cfg']['CodemirrorEnable']) {
                 $this->_scripts->addFile('codemirror/lib/codemirror.js');
                 $this->_scripts->addFile('codemirror/mode/sql/sql.js');
                 $this->_scripts->addFile('codemirror/addon/runmode/runmode.js');
                 $this->_scripts->addFile('codemirror/addon/hint/show-hint.js');
                 $this->_scripts->addFile('codemirror/addon/hint/sql-hint.js');
                 if ($GLOBALS['cfg']['LintEnable']) {
                     $this->_scripts->addFile('codemirror/addon/lint/lint.js');
                     $this->_scripts->addFile('codemirror/addon/lint/sql-lint.js');
                 }
             }
             $this->_scripts->addCode('ConsoleEnterExecutes=' . ($GLOBALS['cfg']['ConsoleEnterExecutes'] ? 'true' : 'false'));
             $this->_scripts->addFiles($this->_console->getScripts());
             if ($this->_userprefsOfferImport) {
                 $this->_scripts->addFile('config.js');
             }
             $retval .= $this->_scripts->getDisplay();
             $retval .= '<noscript>';
             $retval .= '<style>html{display:block}</style>';
             $retval .= '</noscript>';
             $retval .= $this->_getBodyStart();
             if ($this->_menuEnabled && $GLOBALS['server'] > 0) {
                 $nav = new Navigation();
                 $retval .= $nav->getDisplay();
             }
             // Include possible custom headers
             if (file_exists(CUSTOM_HEADER_FILE)) {
                 $retval .= '<div id="pma_header">';
                 ob_start();
                 include CUSTOM_HEADER_FILE;
                 $retval .= ob_get_contents();
                 ob_end_clean();
                 $retval .= '</div>';
             }
             // offer to load user preferences from localStorage
             if ($this->_userprefsOfferImport) {
                 include_once './libraries/user_preferences.lib.php';
                 $retval .= PMA_userprefsAutoloadGetHeader();
             }
             // pass configuration for hint tooltip display
             // (to be used by PMA_tooltip() in js/functions.js)
             if (!$GLOBALS['cfg']['ShowHint']) {
                 $retval .= '<span id="no_hint" class="hide"></span>';
             }
             $retval .= $this->_getWarnings();
             if ($this->_menuEnabled && $GLOBALS['server'] > 0) {
                 $retval .= $this->_menu->getDisplay();
                 $retval .= '<span id="page_nav_icons">';
                 $retval .= '<span id="lock_page_icon"></span>';
                 $retval .= '<span id="page_settings_icon">' . Util::getImage('s_cog.png', __('Page-related settings')) . '</span>';
                 $retval .= sprintf('<a id="goto_pagetop" href="#">%s</a>', Util::getImage('s_top.png', __('Click on the bar to scroll to top of page')));
                 $retval .= '</span>';
             }
             $retval .= $this->_console->getDisplay();
             $retval .= '<div id="page_content">';
             $retval .= $this->getMessage();
         }
         if ($this->_isEnabled && empty($_REQUEST['recent_table'])) {
             $retval .= $this->_addRecentTable($GLOBALS['db'], $GLOBALS['table']);
         }
     }
     return $retval;
 }
All Usage Examples Of PMA\libraries\navigation\Navigation::getDisplay