';
return $buffer;
}
/**
* Create the code for displaying the phpMyAdmin
* logo based on configuration settings
*
* @return string HTML code for the logo
*/
private function _logo()
{
$retval = '';
// display Logo, depending on $GLOBALS['cfg']['NavigationDisplayLogo']
if ($GLOBALS['cfg']['NavigationDisplayLogo']) {
$logo = 'phpMyAdmin';
if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) {
$logo = '
';
} elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) {
$logo = '
';
if ($GLOBALS['cfg']['NavigationLogoLink']) {
$logo_link = 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', $logo_link)
&& ! preg_match('/^https?:/i', $logo_link)
) {
$logo_link = 'index.php';
}
$retval .= '
';
if ($showIcon) {
$retval .= PMA_Util::getImage(
$icon,
$text
);
}
if ($showText) {
$retval .= $text;
}
$retval .= '';
if ($showText) {
$retval .= '
';
}
return $retval;
}
/**
* 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 .= $this->_getLink(
'index.php?' . PMA_URL_getCommon(),
$showText,
__('Home'),
$showIcon,
'b_home.png'
);
// if we have chosen server
if ($GLOBALS['server'] != 0) {
// Logout for advanced authentication
if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
$link = 'index.php?' . $GLOBALS['url_query'];
$link .= '&old_usr=' . urlencode($GLOBALS['PHP_AUTH_USER']);
$retval .= $this->_getLink(
$link,
$showText,
__('Log out'),
$showIcon,
's_loggoff.png',
'',
true
);
}
$link = 'querywindow.php?';
$link .= PMA_URL_getCommon($GLOBALS['db'], $GLOBALS['table']);
$link .= '&no_js=true';
$retval .= $this->_getLink(
$link,
$showText,
__('Query window'),
$showIcon,
'b_selboard.png',
'pma_open_querywindow',
true
);
}
$retval .= $this->_getLink(
PMA_Util::getDocuLink('index'),
$showText,
__('phpMyAdmin documentation'),
$showIcon,
'b_docs.png',
'',
false,
'documentation'
);
if ($showIcon) {
$retval .= PMA_Util::showMySQLDocu('', true);
}
if ($showText) {
// PMA_showMySQLDocu always spits out an icon,
// we just replace it with some perl regexp.
$link = preg_replace(
'/
]+>/i',
__('Documentation'),
PMA_Util::showMySQLDocu('', true)
);
$retval .= $link;
$retval .= '
';
}
$retval .= $this->_getLink(
'#',
$showText,
__('Reload navigation panel'),
$showIcon,
's_reload.png',
'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
) {
include_once './libraries/select_server.lib.php';
$retval .= '';
$retval .= '
';
$retval .= PMA_selectServer(true, true);
$retval .= '
';
$retval .= '';
}
return $retval;
}
/**
* Displays a drop-down choice of most recently used tables
*
* @return string HTML code for the Recent tables
*/
private function _recent()
{
$retval = '';
// display recently used tables
if ($GLOBALS['cfg']['NumRecentTables'] > 0) {
$retval .= '';
$retval .= '
';
$retval .= '';
$retval .= '
';
$retval .= '';
}
return $retval;
}
}
?>