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). in error message (bug #1336452).
* left.php, querywindow.php, tbl_query_box.php: Fix including of files * left.php, querywindow.php, tbl_query_box.php: Fix including of files
when search path does not contain current directory. 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> 2005-10-29 Michal Čihař <michal@cihar.com>
* Documentation.html, config.default.php, libraries/common.lib.php: Link * 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 * Displays a link to the official MySQL documentation
* *
* @param chapter of "HTML, one page per chapter" documentation * @param string chapter of "HTML, one page per chapter" documentation
* @param contains name of page/anchor that is being linked * @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 * @return string the html link
* *
* @access public * @access public
*/ */
function PMA_showMySQLDocu($chapter, $link) function PMA_showMySQLDocu($chapter, $link, $big_icon = FALSE)
{ {
global $cfg; global $cfg;
@@ -530,16 +531,19 @@ if ($is_minimum_common == FALSE) {
switch ($cfg['MySQLManualType']) { switch ($cfg['MySQLManualType']) {
case 'chapters': case 'chapters':
if (empty($chapter)) $chapter = 'index';
$url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link; $url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link;
break; break;
case 'big': case 'big':
$url = $cfg['MySQLManualBase'] . '#' . $link; $url = $cfg['MySQLManualBase'] . '#' . $link;
break; break;
case 'searchable': case 'searchable':
if (empty($link)) $link = 'index';
$url = $cfg['MySQLManualBase'] . '/' . $link . '.html'; $url = $cfg['MySQLManualBase'] . '/' . $link . '.html';
break; break;
case 'viewable': case 'viewable':
default: default:
if (empty($link)) $link = 'index';
$mysql = '4.1'; $mysql = '4.1';
if (PMA_MYSQL_INT_VERSION > 50100) { if (PMA_MYSQL_INT_VERSION > 50100) {
$mysql = '5.1'; $mysql = '5.1';
@@ -550,7 +554,9 @@ if ($is_minimum_common == FALSE) {
break; 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>'; 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{ }else{
return '[<a href="' . $url . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; return '[<a href="' . $url . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';

View File

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