Implemented feature #545379 - phpMyAdmin has now support for all MySQL manuals available.

This commit is contained in:
Michal Čihař
2002-08-15 11:52:26 +00:00
parent b70b4e2552
commit 15eed4df54
16 changed files with 100 additions and 37 deletions

View File

@@ -5,6 +5,15 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-08-15 Michal Cihar <nijel@users.sourceforge.net>
* Documentation.html, config.inc.php3, db_details.php3, db_search.php3,
ldi_table.php3, main.php3, tbl_indexes.php3, tbl_properties.inc.php3,
tbl_properties_operations.php3, tbl_properties_options.php3,
tbl_properties_structure.php3, tbl_query_box.php3, tbl_select.php3,
user_details.php3, libraries/common.lib.php3:
Implemented feature #545379 - phpMyAdmin has now support for all MySQL
manuals available.
2002-08-15 Alexander M. Turek <rabus@users.sourceforge.net>
* main.php3: Undefined variable.

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
more information about MySQL manuals and their types.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<!-- $Id$ -->
@@ -1138,10 +1138,27 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
<br /><br />
</dd>
<dt><b>$cfg['ManualBaseShort']</b> string</dt>
<dt><b>$cfg['MySQLManualBase']</b> string</dt>
<dd>
If set to an URL which points to the MySQL documentation (on short
pages), appropriate help links are generated.
If set to an URL which points to the MySQL documentation (type depends
on $cfg['MySQLManualType']), appropriate help links are generated.
<br />
See <a href="http://www.mysql.com/documentation/index.html">MySQL
Documentation page</a> for more information about MySQL manuals and
their types.
<br /><br />
</dd>
<dt><b>$cfg['MySQLManualType']</b> string</dt>
<dd>
Type of MySQL documentation:
<ul>
<li>old - old style used in phpMyAdmin 2.3.0 and sooner</li>
<li>searchable - "Searchable, with user comments"</li>
<li>chapters - "HTML, one page per chapter"</li>
<li>big - "HTML, all on one page"</li>
<li>none - do not show documentation links</li>
</ul>
<br /><br />
</dd>

View File

@@ -225,10 +225,22 @@ $cfg['DefaultTabTable'] = 'tbl_properties_structure.php3';
/**
* Link to the official MySQL documentation
* Be sure to include no trailing slash on the path
* Link to the official MySQL documentation.
* Be sure to include no trailing slash on the path.
* See http://www.mysql.com/documentation/index.html for more information
* about MySQL manuals and their types.
*/
$cfg['ManualBaseShort'] = 'http://www.mysql.com/doc';
$cfg['MySQLManualBase'] = 'http://www.mysql.com/doc/en';
/**
* Type of MySQL documentation:
* old - old style used in phpMyAdmin 2.3.0 and sooner
* searchable - "Searchable, with user comments"
* chapters - "HTML, one page per chapter"
* big - "HTML, all on one page"
* none - do not show documentation links
*/
$cfg['MySQLManualType'] = 'searchable';
/**

View File

@@ -59,7 +59,7 @@ $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get'))
<input type="hidden" name="goto" value="db_details.php3" />
<input type="hidden" name="zero_rows" value="<?php echo htmlspecialchars($strSuccess); ?>" />
<input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
<?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showDocuShort('S/E/SELECT.html'); ?>&nbsp;:<br />
<?php echo sprintf($strRunSQLQuery, $db) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT'); ?>&nbsp;:<br />
<div style="margin-bottom: 5px">
<textarea name="sql_query" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" rows="<?php echo $cfg['TextareaRows']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"
onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; this.form.elements['sql_query'].select();}">

View File

@@ -339,7 +339,7 @@ if (empty($search_option)) {
<input type="radio" id="search_option_3" name="search_option" value="3"<?php if ($search_option == 3) echo ' checked="checked"'; ?> />
<label for="search_option_3"><?php echo $strSearchOption3; ?></label><br />
<input type="radio" id="search_option_4" name="search_option" value="4"<?php if ($search_option == 4) echo ' checked="checked"'; ?> />
<label for="search_option_4"><?php echo $strSearchOption4 . '</label> ' . PMA_showDocuShort('R/e/Regexp.html'); ?><br />
<label for="search_option_4"><?php echo $strSearchOption4 . '</label> ' . PMA_showMySQLDocu('Regexp', 'Regexp'); ?><br />
<br />
*&nbsp;<?php echo $strSplitWordsWithSpace . "\n"; ?>
</td>
@@ -408,4 +408,4 @@ echo"\n";
*/
echo "\n";
require('./footer.inc.php3');
?>
?>

View File

@@ -97,7 +97,7 @@ if (function_exists('PMA_set_enc_form')) {
} // end if
?>
<tr>
<td colspan="3" align="center"><?php print PMA_showDocuShort('L/O/LOAD_DATA.html'); ?></td>
<td colspan="3" align="center"><?php print PMA_showMySQLDocu('Reference', 'LOAD_DATA'); ?></td>
</tr>
<tr>
<td colspan="3" align="center">

View File

@@ -1283,7 +1283,7 @@ if (typeof(document.getElementById) != 'undefined'
/**
* Displays a link to the official MySQL documentation (short)
* Displays a link to the official MySQL documentation
*
* @param string an anchor to move to
*
@@ -1291,10 +1291,35 @@ if (typeof(document.getElementById) != 'undefined'
*
* @access public
*/
function PMA_showDocuShort($link)
function PMA_showMySQLDocu($chapter, $link)
{
if (!empty($GLOBALS['cfg']['ManualBaseShort'])) {
return '[<a href="' . $GLOBALS['cfg']['ManualBaseShort'] . '/' . $link .'" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
if (!empty($GLOBALS['cfg']['MySQLManualBase'])) {
if (!empty($GLOBALS['cfg']['MySQLManualType'])) {
switch ($GLOBALS['cfg']['MySQLManualType']) {
case 'old':
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
case 'chapters':
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/manual_' . $chapter . '.html#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
case 'big':
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '#' . $link . '" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
case 'none':
return '';
case 'searchable':
default:
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
}
} else {
// no Type defined, show the old one
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
}
} else {
// no URL defined
if (!empty($GLOBALS['cfg']['ManualBaseShort'])) {
// the old configuration
return '[<a href="' . $GLOBALS['cfg']['MySQLManualBase'] . '/' . $link[0] . '/' . $link[1] . '/' . $link . '.html" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
} else {
return '';
}
}
} // end of the 'PMA_showDocuShort()' function

View File

@@ -285,7 +285,7 @@ if ($server > 0) {
<td valign="baseline"><img src="<?php echo $item_img; ?>" width="7" height="7" alt="item" /></td>
<td>
<form method="post" action="db_create.php3">
<?php echo $strCreateNewDatabase . '&nbsp;' . PMA_showDocuShort('C/R/CREATE_DATABASE.html'); ?><br />
<?php echo $strCreateNewDatabase . '&nbsp;' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE'); ?><br />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
@@ -311,7 +311,7 @@ if ($server > 0) {
<td>
<a href="sql.php3?<?php echo $common_url_query; ?>&amp;db=mysql&amp;sql_query=<?php echo urlencode('SHOW STATUS'); ?>&amp;goto=main.php3">
<?php echo $strMySQLShowStatus; ?></a>&nbsp;
<?php echo PMA_showDocuShort('S/H/SHOW_STATUS.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'SHOW_STATUS') . "\n"; ?>
</td>
</tr>
<?php
@@ -324,7 +324,7 @@ if ($server > 0) {
<td>
<a href="sql.php3?<?php echo $common_url_query; ?>&amp;db=mysql&amp;sql_query=<?php echo urlencode('SHOW VARIABLES'); ?>&amp;goto=main.php3">
<?php echo $strMySQLShowVars;?></a>&nbsp;
<?php echo PMA_showDocuShort('S/H/SHOW_VARIABLES.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'SHOW_VARIABLES') . "\n"; ?>
</td>
</tr>
<?php
@@ -338,7 +338,7 @@ if ($server > 0) {
<td>
<a href="sql.php3?<?php echo $common_url_query; ?>&amp;db=mysql&amp;sql_query=<?php echo urlencode('SHOW PROCESSLIST'); ?>&amp;goto=main.php3">
<?php echo $strMySQLShowProcess; ?></a>&nbsp;
<?php echo PMA_showDocuShort('S/H/SHOW_PROCESSLIST.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'SHOW_PROCESSLIST') . "\n"; ?>
</td>
</tr>
<?php
@@ -352,7 +352,7 @@ if ($server > 0) {
<td>
<a href="main.php3?<?php echo $common_url_query; ?>&amp;mode=reload">
<?php echo $strReloadMySQL; ?></a>&nbsp;
<?php echo PMA_showDocuShort('F/L/FLUSH.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH') . "\n"; ?>
</td>
</tr>
<?php
@@ -366,7 +366,7 @@ if ($server > 0) {
<td>
<a href="user_details.php3?<?php echo $common_url_query; ?>&amp;db=mysql&amp;table=user">
<?php echo $strUsers; ?></a>&nbsp;
<?php echo PMA_showDocuShort('P/r/Privilege_system.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'Privilege_system') . "\n"; ?>
</td>
</tr>
<?php

View File

@@ -343,7 +343,7 @@ else if (!defined('PMA_IDX_INCLUDED')
} // end for
?>
</select>&nbsp;
<?php echo PMA_showDocuShort('A/L/ALTER_TABLE.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('Reference', 'ALTER_TABLE.html') . "\n"; ?>
</td>
</tr>
</table><br />
@@ -424,7 +424,7 @@ else if (!defined('PMA_IDX_INCLUDED')
<?php
echo "\n";
echo ' ' . $strIndexes . '&nbsp;:' . "\n";
echo ' ' . PMA_showDocuShort('O/p/Optimising_Database_Structure.html') . '<br />' ."\n";
echo ' ' . PMA_showMySQLDocu('MySQL_Optimisation', 'Optimising_Database_Structure') . '<br />' ."\n";
if ($idx_cnt > 0) {
?>

View File

@@ -28,7 +28,7 @@ $is_backup = ($action != 'tbl_create.php3' && $action != 'tbl_addfield.php3');
<table border="<?php echo $cfg['Border']; ?>">
<tr>
<th><?php echo $strField; ?></th>
<th><?php echo $strType . '<br /><span style="font-weight: normal">' . PMA_showDocuShort('C/o/Column_types.html'); ?></span></th>
<th><?php echo $strType . '<br /><span style="font-weight: normal">' . PMA_showMySQLDocu('Reference', 'Column_types'); ?></span></th>
<th><?php echo $strLengthSet; ?></th>
<th><?php echo $strAttr; ?></th>
<th><?php echo $strNull; ?></th>
@@ -374,4 +374,4 @@ echo "\n";
</table>
<br />
<center><?php echo PMA_showDocuShort('C/R/CREATE_TABLE.html'); ?></center>
<center><?php echo PMA_showMySQLDocu('Reference', 'CREATE_TABLE'); ?></center>

View File

@@ -219,7 +219,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<td>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('CHECK TABLE ' . PMA_backquote($table)); ?>">
<?php echo $strCheckTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('C/H/CHECK_TABLE.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE') . "\n"; ?>
</td>
<td>&nbsp;-&nbsp;</td>
<?php
@@ -230,7 +230,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<td>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('ANALYZE TABLE ' . PMA_backquote($table)); ?>">
<?php echo $strAnalyzeTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('A/N/ANALYZE_TABLE.html') . "\n";?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE') . "\n";?>
</td>
<?php
}
@@ -246,7 +246,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<td>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('REPAIR TABLE ' . PMA_backquote($table)); ?>">
<?php echo $strRepairTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('R/E/REPAIR_TABLE.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE') . "\n"; ?>
</td>
<td>&nbsp;-&nbsp;</td>
<?php
@@ -257,7 +257,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<td>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>">
<?php echo $strOptimizeTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('O/P/OPTIMIZE_TABLE.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE') . "\n"; ?>
</td>
<?php
}
@@ -283,7 +283,7 @@ else if (PMA_MYSQL_INT_VERSION >= 32306
<?php echo $strTableMaintenance; ?>&nbsp;:&nbsp;
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('OPTIMIZE TABLE ' . PMA_backquote($table)); ?>">
<?php echo $strOptimizeTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('O/P/OPTIMIZE_TABLE.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE') . "\n"; ?>
</div>
</li>
<?php
@@ -336,7 +336,7 @@ if ($cfgRelation['relwork']) {
<li>
<a href="sql.php3?<?php echo $url_query; ?>&amp;sql_query=<?php echo urlencode('FLUSH TABLE ' . PMA_backquote($table)); ?>&amp;zero_rows=<?php echo urlencode(sprintf($strTableHasBeenFlushed, htmlspecialchars($table))); if ($cfg['ShowTooltip']) echo '&amp;reload=1'; ?>">
<?php echo $strFlushTable; ?></a>&nbsp;
<?php echo PMA_showDocuShort('F/L/FLUSH.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH') . "\n"; ?>
<br /><br />
</li>

View File

@@ -145,7 +145,7 @@ if (PMA_MYSQL_INT_VERSION >= 32322) {
<option value="MERGE"<?php if ($tbl_type == 'MRG_MYISAM') echo ' selected="selected"'; ?>>Merge</option>
</select>&nbsp;
<input type="submit" name="submittype" value="<?php echo $strGo; ?>" style="vertical-align: middle" />&nbsp;
<?php echo PMA_showDocuShort('T/a/Table_types.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('Table_types', 'Table_types') . "\n"; ?>
</form>
</li>

View File

@@ -545,7 +545,7 @@ echo "\n";
<div style="margin-bottom: 10px">
<a href="sql.php3?<?php echo $url_query; ?>&amp;session_max_rows=all&amp;sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>">
<?php echo $strStructPropose; ?></a>
<?php echo PMA_showDocuShort('p/r/procedure_analyse.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?>
</div>
</li>

View File

@@ -68,7 +68,7 @@ $is_upload = (PMA_PHP_INT_VERSION >= 40000 && function_exists('ini_get'))
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>" />
<input type="hidden" name="prev_sql_query" value="<?php echo ((!empty($query_to_display)) ? urlencode($query_to_display) : ''); ?>" />
<?php echo sprintf($strRunSQLQuery, htmlspecialchars($db)) . ' ' . PMA_showDocuShort('S/E/SELECT.html') . '&nbsp;&nbsp;&nbsp;' . $strFields . ':' . "\n"; ?>
<?php echo sprintf($strRunSQLQuery, htmlspecialchars($db)) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT') . '&nbsp;&nbsp;&nbsp;' . $strFields . ':' . "\n"; ?>
<select name="dummy" size="1">
<?php
echo "\n";

View File

@@ -93,7 +93,7 @@ if (!isset($param) || $param[0] == '') {
<li>
<?php echo $strAddSearchConditions; ?><br />
<input type="text" name="where" class="textfield" />&nbsp;
<?php echo PMA_showDocuShort('F/u/Functions.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('Reference', 'Functions') . "\n"; ?>
<br /><br />
<?php echo '<i>' . $strOr . '</i> ' . $strDoAQuery; ?><br />
<table border="<?php echo $cfg['Border']; ?>">
@@ -221,4 +221,4 @@ else {
}
?>
?>

View File

@@ -344,7 +344,7 @@ function PMA_normalOperations()
<div style="margin-bottom: 10px">
<a href="user_details.php3?lang=<?php echo $lang; ?>&amp;convcharset=<?php echo $convcharset; ?>&amp;server=<?php echo $server; ?>&amp;db=mysql&amp;table=user&amp;mode=reload">
<?php echo $GLOBALS['strReloadMySQL']; ?></a>&nbsp;
<?php echo PMA_showDocuShort('F/L/FLUSH.html') . "\n"; ?>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration.', 'FLUSH') . "\n"; ?>
</div>
</li>