';
return $buffer;
}
/**
* Create the code for displaying the phpMyAdmin
* logo based on configuration settings
*
* @return string HTML code for the logo
*/
private function _logo()
{
$logo = 'phpMyAdmin';
if (isset($GLOBALS['pmaThemeImage'])) {
$imgTag = '
';
if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) {
$logo = sprintf($imgTag, $GLOBALS['pmaThemeImage'], 'logo_left.png');
} elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) {
$logo = sprintf($imgTag, $GLOBALS['pmaThemeImage'], 'pma_logo2.png');
}
}
// display Logo, depending on $GLOBALS['cfg']['NavigationDisplayLogo']
if (!$GLOBALS['cfg']['NavigationDisplayLogo']) {
return Template::get('navigation/logo')->render([
'display_logo' => false,
'use_logo_link' => false,
'logo_link' => null,
'link_attribs' => null,
'logo' => $logo,
]);
}
if (!$GLOBALS['cfg']['NavigationLogoLink']) {
return Template::get('navigation/logo')->render([
'display_logo' => true,
'use_logo_link' => false,
'logo_link' => null,
'link_attribs' => null,
'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 (! Sanitize::checkLink($logoLink, true)) {
$logoLink = 'index.php';
}
switch ($GLOBALS['cfg']['NavigationLogoLinkWindow']) {
case 'new':
$linkAttriks = 'target="_blank" rel="noopener noreferrer"';
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 .= Url::getCommon();
} else {
$linkAttriks = 'target="_blank" rel="noopener noreferrer"';
}
}
{
return Template::get('navigation/logo')->render([
'display_logo' => false,
'use_logo_link' => false,
'logo_link' => null,
'link_attribs' => null,
'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 .= Util::getNavigationLink(
'index.php' . Url::getCommon(),
$showText,
__('Home'),
$showIcon,
'b_home'
);
// if we have chosen server
if ($GLOBALS['server'] != 0) {
// Logout for advanced authentication
if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
$text = __('Log out');
} else {
$text = __('Empty session data');
}
$link = 'logout.php' . $GLOBALS['url_query'];
$retval .= Util::getNavigationLink(
$link,
$showText,
$text,
$showIcon,
's_loggoff',
'',
true,
'',
array('logout')
);
}
$retval .= Util::getNavigationLink(
Util::getDocuLink('index'),
$showText,
__('phpMyAdmin documentation'),
$showIcon,
'b_docs',
'',
false,
'documentation'
);
$retval .= Util::getNavigationLink(
Util::getMySQLDocuURL('', ''),
$showText,
__('Documentation'),
$showIcon,
'b_sqlhelp',
'',
false,
'mysql_doc'
);
$retval .= Util::getNavigationLink(
'#',
$showText,
__('Navigation panel settings'),
$showIcon,
's_cog',
'pma_navigation_settings_icon',
false,
'',
defined('PMA_DISABLE_NAVI_SETTINGS') ? array('hide') : array()
);
$retval .= Util::getNavigationLink(
'#',
$showText,
__('Reload navigation panel'),
$showIcon,
's_reload',
'pma_navigation_reload'
);
$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
) {
$retval .= '';
$retval .= '
';
$retval .= Select::render(true, true);
$retval .= '
';
$retval .= '';
}
return $retval;
}
}
?>