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,47 +2277,49 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$infunction = ($functionlevel > 0) ? TRUE : FALSE; $infunction = ($functionlevel > 0) ? TRUE : FALSE;
break; break;
case 'alpha_columnType': case 'alpha_columnType':
switch ($arr[$i]['data']) { if ($docu) {
case 'tinyint': switch ($arr[$i]['data']) {
case 'smallint': case 'tinyint':
case 'mediumint': case 'smallint':
case 'int': case 'mediumint':
case 'bigint': case 'int':
case 'decimal': case 'bigint':
case 'float': case 'decimal':
case 'double': case 'float':
case 'real': case 'double':
case 'bit': case 'real':
case 'boolean': case 'bit':
case 'serial': case 'boolean':
$before .= PMA_showMySQLDocu('data-types', 'numeric-types', false, '', true); case 'serial':
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('data-types', 'numeric-types', false, '', true);
break; $after = '</a>' . $after;
case 'date': break;
case 'datetime': case 'date':
case 'timestamp': case 'datetime':
case 'time': case 'timestamp':
case 'year': case 'time':
$before .= PMA_showMySQLDocu('data-types', 'date-and-time-types', false, '', true); case 'year':
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('data-types', 'date-and-time-types', false, '', true);
break; $after = '</a>' . $after;
case 'char': break;
case 'varchar': case 'char':
case 'tinytext': case 'varchar':
case 'text': case 'tinytext':
case 'mediumtext': case 'text':
case 'longtext': case 'mediumtext':
case 'binary': case 'longtext':
case 'varbinary': case 'binary':
case 'tinyblob': case 'varbinary':
case 'mediumblob': case 'tinyblob':
case 'blob': case 'mediumblob':
case 'longblob': case 'blob':
case 'enum': case 'longblob':
case 'set': case 'enum':
$before .= PMA_showMySQLDocu('data-types', 'string-types', false, '', true); case 'set':
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('data-types', 'string-types', false, '', true);
break; $after = '</a>' . $after;
break;
}
} }
if ($typearr[3] == 'alpha_columnAttrib') { if ($typearr[3] == 'alpha_columnAttrib') {
$after .= ' '; $after .= ' ';
@@ -2406,24 +2411,26 @@ if (! defined('PMA_MINIMUM_COMMON')) {
case 'ANALYZE': case 'ANALYZE':
case 'ANALYSE': case 'ANALYSE':
case 'OPTIMIZE': case 'OPTIMIZE':
switch ($arr[$i + 1]['data']) { if ($docu) {
case 'EVENT': switch ($arr[$i + 1]['data']) {
case 'TABLE': case 'EVENT':
case 'TABLESPACE': case 'TABLE':
case 'FUNCTION': case 'TABLESPACE':
case 'INDEX': case 'FUNCTION':
case 'PROCEDURE': case 'INDEX':
case 'TRIGGER': case 'PROCEDURE':
case 'SERVER': case 'TRIGGER':
case 'DATABASE': case 'SERVER':
case 'VIEW': case 'DATABASE':
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_' . $arr[$i + 1]['data'], false, '', true); case 'VIEW':
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_' . $arr[$i + 1]['data'], false, '', true);
$close_docu_link = true;
break;
}
if ($arr[$i + 1]['data'] == 'LOGFILE' && $arr[$i + 2]['data'] == 'GROUP') {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_LOGFILE_GROUP', false, '', true);
$close_docu_link = true; $close_docu_link = true;
break; }
}
if ($arr[$i + 1]['data'] == 'LOGFILE' && $arr[$i + 2]['data'] == 'GROUP') {
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'] . '_LOGFILE_GROUP', false, '', 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;
@@ -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':
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); if ($docu) {
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$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':
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); if ($docu) {
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$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':
$before .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT', false, '', true); if ($docu) {
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('SQL-Syntax', 'SELECT', false, '', true);
$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':
$before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true); if ($docu) {
$after = '</a>' . $after; $before .= PMA_showMySQLDocu('SQL-Syntax', $arr[$i]['data'], false, '', true);
$after = '</a>' . $after;
}
break; break;
default: default:
break; break;