diff --git a/ChangeLog b/ChangeLog index 868dfc394..f4e57539d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -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ř * Documentation.html, config.default.php, libraries/common.lib.php: Link diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 4998276ba..d3b2d1454 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -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 '' . $GLOBALS['strDocu'] . ''; + } elseif ($GLOBALS['cfg']['ReplaceHelpImg']) { return '' . $GLOBALS['strDocu'] . ''; }else{ return '[' . $GLOBALS['strDocu'] . ']'; diff --git a/libraries/left_header.inc.php b/libraries/left_header.inc.php index 25bbb8c78..96a04c68f 100644 --- a/libraries/left_header.inc.php +++ b/libraries/left_header.inc.php @@ -81,10 +81,7 @@ if ($GLOBALS['cfg']['MainPageIconic']) { .' title="' . $strPmaDocumentation . '" >' .'' . $strPmaDocumentation . '' . "\n"; - echo ' ' - .'MySQL - ' . $strDocu . '' . "\n"; + echo ' ' . PMA_showMySQLDocu('', '', TRUE) . "\n"; } echo '' . "\n"; @@ -92,4 +89,4 @@ if ( $GLOBALS['cfg']['LeftDisplayServers'] ) { $show_server_left = TRUE; include('./libraries/select_server.lib.php'); } // end if LeftDisplayServers -?> \ No newline at end of file +?>