Use common code for generating links to documentation, fixes link to new style docs.

This commit is contained in:
Michal Čihař
2005-10-30 18:59:40 +00:00
parent 7ae4646de6
commit da6fae1ec9
3 changed files with 14 additions and 9 deletions

View File

@@ -16,6 +16,8 @@ $Source$
in error message (bug #1336452).
* left.php, querywindow.php, tbl_query_box.php: Fix including of files
when search path does not contain current directory.
* libraries/common.lib.php, libraries/left_header.inc.php: Use common code
for generating links to documentation, fixes link to new style docs.
2005-10-29 Michal Čihař <michal@cihar.com>
* Documentation.html, config.default.php, libraries/common.lib.php: Link

View File

@@ -511,14 +511,15 @@ if ($is_minimum_common == FALSE) {
/**
* Displays a link to the official MySQL documentation
*
* @param chapter of "HTML, one page per chapter" documentation
* @param contains name of page/anchor that is being linked
* @param string chapter of "HTML, one page per chapter" documentation
* @param string contains name of page/anchor that is being linked
* @param bool whether to use big icon (like in left frame)
*
* @return string the html link
*
* @access public
*/
function PMA_showMySQLDocu($chapter, $link)
function PMA_showMySQLDocu($chapter, $link, $big_icon = FALSE)
{
global $cfg;
@@ -530,16 +531,19 @@ if ($is_minimum_common == FALSE) {
switch ($cfg['MySQLManualType']) {
case 'chapters':
if (empty($chapter)) $chapter = 'index';
$url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link;
break;
case 'big':
$url = $cfg['MySQLManualBase'] . '#' . $link;
break;
case 'searchable':
if (empty($link)) $link = 'index';
$url = $cfg['MySQLManualBase'] . '/' . $link . '.html';
break;
case 'viewable':
default:
if (empty($link)) $link = 'index';
$mysql = '4.1';
if (PMA_MYSQL_INT_VERSION > 50100) {
$mysql = '5.1';
@@ -550,7 +554,9 @@ if ($is_minimum_common == FALSE) {
break;
}
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
if ($big_icon) {
return '<a href="' . $url . '" target="mysql_doc"><img src="' . $GLOBALS['pmaThemeImage'] . 'b_sqlhelp.png" width="16" height="16" alt="' . $GLOBALS['strDocu'] . '" title="' . $GLOBALS['strDocu'] . '" /></a>';
} elseif ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="' . $url . '" target="mysql_doc"><img src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" border="0" alt="' . $GLOBALS['strDocu'] . '" title="' . $GLOBALS['strDocu'] . '" hspace="2" align="middle" /></a>';
}else{
return '[<a href="' . $url . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';

View File

@@ -81,10 +81,7 @@ if ($GLOBALS['cfg']['MainPageIconic']) {
.' title="' . $strPmaDocumentation . '" >'
.'<img src="' . $pmaThemeImage . 'b_docs.png" width="16" height="16"'
.' alt="' . $strPmaDocumentation . '" /></a>' . "\n";
echo ' <a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '"'
.' target="documentation" title="MySQL - ' . $strDocu . '">'
.'<img src="' . $GLOBALS['pmaThemeImage'] . 'b_sqlhelp.png" width="16"'
.' height="16" alt="MySQL - ' . $strDocu . '" /></a>' . "\n";
echo ' ' . PMA_showMySQLDocu('', '', TRUE) . "\n";
}
echo '</div>' . "\n";
@@ -92,4 +89,4 @@ if ( $GLOBALS['cfg']['LeftDisplayServers'] ) {
$show_server_left = TRUE;
include('./libraries/select_server.lib.php');
} // end if LeftDisplayServers
?>
?>