bug #2954916 [interface] Do not insert doc links to not formatted SQL.

This commit is contained in:
Michal Čihař
2010-02-25 09:11:42 +00:00
parent 4ad6f11561
commit 1cdc4cc50a
2 changed files with 83 additions and 67 deletions

View File

@@ -44,6 +44,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ [lang] Add English (United Kingdom) translation, thanks to Robert Readman. + [lang] Add English (United Kingdom) translation, thanks to Robert Readman.
+ patch #2948421 [auth] HTTP Basic auth realm name, + patch #2948421 [auth] HTTP Basic auth realm name,
thanks to Harald Jenny - haraldj thanks to Harald Jenny - haraldj
- bug #2954916 [interface] Do not insert doc links to not formatted SQL.
3.3.1.0 (not yet released) 3.3.1.0 (not yet released)
- bug #2941037 [core] Database structure not sorted by table correctly - bug #2941037 [core] Database structure not sorted by table correctly

View File

@@ -2080,14 +2080,17 @@ if (! defined('PMA_MINIMUM_COMMON')) {
case 'color': case 'color':
$str = '<span class="syntax">'; $str = '<span class="syntax">';
$html_line_break = '<br />'; $html_line_break = '<br />';
$docu = TRUE;
break; break;
case 'query_only': case 'query_only':
$str = ''; $str = '';
$html_line_break = "\n"; $html_line_break = "\n";
$docu = FALSE;
break; break;
case 'text': case 'text':
$str = ''; $str = '';
$html_line_break = '<br />'; $html_line_break = '<br />';
$docu = TRUE;
break; break;
} // end switch } // end switch
$close_docu_link = false; $close_docu_link = false;
@@ -2274,6 +2277,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$infunction = ($functionlevel > 0) ? TRUE : FALSE; $infunction = ($functionlevel > 0) ? TRUE : FALSE;
break; break;
case 'alpha_columnType': case 'alpha_columnType':
if ($docu) {
switch ($arr[$i]['data']) { switch ($arr[$i]['data']) {
case 'tinyint': case 'tinyint':
case 'smallint': case 'smallint':
@@ -2316,6 +2320,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$after = '</a>' . $after; $after = '</a>' . $after;
break; break;
} }
}
if ($typearr[3] == 'alpha_columnAttrib') { if ($typearr[3] == 'alpha_columnAttrib') {
$after .= ' '; $after .= ' ';
} }
@@ -2406,6 +2411,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
case 'ANALYZE': case 'ANALYZE':
case 'ANALYSE': case 'ANALYSE':
case 'OPTIMIZE': case 'OPTIMIZE':
if ($docu) {
switch ($arr[$i + 1]['data']) { switch ($arr[$i + 1]['data']) {
case 'EVENT': case 'EVENT':
case 'TABLE': case 'TABLE':
@@ -2425,6 +2431,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_LOGFILE_GROUP', false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_LOGFILE_GROUP', false, '', true);
$close_docu_link = true; $close_docu_link = true;
} }
}
if (!$in_priv_list) { if (!$in_priv_list) {
$space_punct_listsep = $html_line_break; $space_punct_listsep = $html_line_break;
$space_alpha_reserved_word = ' '; $space_alpha_reserved_word = ' ';
@@ -2447,7 +2454,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} }
break; break;
case 'SET': case 'SET':
if ($i == 0 || $arr[$i - 1]['data'] != 'CHARACTER') { if ($docu && ($i == 0 || $arr[$i - 1]['data'] != 'CHARACTER')) {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$after = '</a>' . $after; $after = '</a>' . $after;
} }
@@ -2461,8 +2468,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
case 'DELETE': case 'DELETE':
case 'SHOW': case 'SHOW':
case 'UPDATE': case 'UPDATE':
if ($docu) {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$after = '</a>' . $after; $after = '</a>' . $after;
}
if (!$in_priv_list) { if (!$in_priv_list) {
$space_punct_listsep = $html_line_break; $space_punct_listsep = $html_line_break;
$space_alpha_reserved_word = ' '; $space_alpha_reserved_word = ' ';
@@ -2470,8 +2479,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
break; break;
case 'INSERT': case 'INSERT':
case 'REPLACE': case 'REPLACE':
if ($docu) {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$after = '</a>' . $after; $after = '</a>' . $after;
}
if (!$in_priv_list) { if (!$in_priv_list) {
$space_punct_listsep = $html_line_break; $space_punct_listsep = $html_line_break;
$space_alpha_reserved_word = $html_line_break; $space_alpha_reserved_word = $html_line_break;
@@ -2482,16 +2493,20 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$space_alpha_reserved_word = $html_line_break; $space_alpha_reserved_word = $html_line_break;
break; break;
case 'SELECT': case 'SELECT':
if ($docu) {
$before .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT', false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT', false, '', true);
$after = '</a>' . $after; $after = '</a>' . $after;
}
$space_punct_listsep = ' '; $space_punct_listsep = ' ';
$space_alpha_reserved_word = $html_line_break; $space_alpha_reserved_word = $html_line_break;
break; break;
case 'CALL': case 'CALL':
case 'DO': case 'DO':
case 'HANDLER': case 'HANDLER':
if ($docu) {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$after = '</a>' . $after; $after = '</a>' . $after;
}
break; break;
default: default:
break; break;