true, ) ); $class = ' class="list_container'; if ($GLOBALS['cfg']['NavigationLinkWithMainPanel']) { $class .= ' synced'; } if ($GLOBALS['cfg']['NavigationTreePointerEnable']) { $class .= ' highlight'; } $class .= '"'; $buffer = '
'; $buffer .= '
'; $buffer .= '
'; $buffer .= '
'; $buffer .= '
'; $buffer .= sprintf( '', $link_url ); $buffer .= $this->_logo(); $buffer .= $this->_links(); $buffer .= $this->_serverChoice(); $buffer .= PMA\libraries\Util::getImage( 'ajax_clock_small.gif', __('Loading…'), array( 'style' => 'visibility: hidden; display:none', 'class' => 'throbber', ) ); $buffer .= '
'; // pma_navigation_header $buffer .= '
'; return $buffer; } /** * Create the code for displaying the phpMyAdmin * logo based on configuration settings * * @return string HTML code for the logo */ private function _logo() { // display Logo, depending on $GLOBALS['cfg']['NavigationDisplayLogo'] if (!$GLOBALS['cfg']['NavigationDisplayLogo']) { return Template::get('navigation/logo') ->render(array('displayLogo' => false)); } $logo = 'phpMyAdmin'; if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { $logo = ''; } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { $logo = ''; } if (!$GLOBALS['cfg']['NavigationLogoLink']) { return Template::get('navigation/logo') ->render( array( 'displayLogo' => true, 'useLogoLink' => false, 'logo' => $logo, ) ); } $useLogoLink = true; $linkAttriks = null; $logoLink = trim( htmlspecialchars($GLOBALS['cfg']['NavigationLogoLink']) ); // prevent XSS, see PMASA-2013-9 // if link has protocol, allow only http and https if (preg_match('/^[a-z]+:/i', $logoLink) && !preg_match('/^https?:/i', $logoLink) ) { $logoLink = 'index.php'; } switch ($GLOBALS['cfg']['NavigationLogoLinkWindow']) { case 'new': $linkAttriks = 'target="_blank"'; break; case 'main': // do not add our parameters for an external link $host = parse_url( $GLOBALS['cfg']['NavigationLogoLink'], PHP_URL_HOST ); if (empty($host)) { $logoLink .= PMA_URL_getCommon(); } else { $linkAttriks = 'target="_blank"'; } } return Template::get('navigation/logo') ->render( array( 'displayLogo' => true, 'useLogoLink' => $useLogoLink, 'logoLink' => $logoLink, 'linkAttribs' => $linkAttriks, 'logo' => $logo, ) ); } /** * Creates the code for displaying the links * at the top of the navigation panel * * @return string HTML code for the links */ private function _links() { // always iconic $showIcon = true; $showText = false; $retval = ''; $retval .= ''; $retval .= ''; return $retval; } /** * Displays the MySQL servers choice form * * @return string HTML code for the MySQL servers choice */ private function _serverChoice() { $retval = ''; if ($GLOBALS['cfg']['NavigationDisplayServers'] && count($GLOBALS['cfg']['Servers']) > 1 ) { include_once './libraries/select_server.lib.php'; $retval .= ''; $retval .= '
'; $retval .= PMA_selectServer(true, true); $retval .= '
'; $retval .= ''; } return $retval; } }