diff options
author | Michal Čihař <mcihar@suse.cz> | 2013-08-06 14:00:06 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2013-08-06 14:00:06 +0400 |
commit | 9473fb8fedaa912eaa5f761cb2d86231f853820c (patch) | |
tree | ccc5f11b0c83da91ed3516eb8621c3c4ae14524b | |
parent | 6bb21aec664ffbc60a10f8d74183c32670ff8190 (diff) |
Remove code for adding MySQL documentation links to query
This does not work anyway with CodeMirror based highlighter.
-rw-r--r-- | libraries/sqlparser.lib.php | 251 |
1 files changed, 0 insertions, 251 deletions
diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index b0595397ed..40cde13db8 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -2288,18 +2288,10 @@ function PMA_SQP_format( case 'query_only': $str = ''; $html_line_break = "\n"; - $docu = false; break; case 'text': $str = ''; $html_line_break = '<br />'; - if (($GLOBALS['cfg']['MySQLManualType'] == 'none') - || empty($GLOBALS['cfg']['MySQLManualBase']) - ) { - $docu = false; - } else { - $docu = true; - } break; } // end switch // inner_sql is a span that exists for all cases, except query_only @@ -2308,7 +2300,6 @@ function PMA_SQP_format( if ($mode!='query_only') { $str .= '<span class="inner_sql">'; } - $close_docu_link = false; $indent = 0; $bracketlevel = 0; $functionlevel = 0; @@ -2479,18 +2470,6 @@ function PMA_SQP_format( break; case 'punct': $before .= ' '; - if ($docu && isset($PMA_SQPdata_operators_docs[$arr[$i]['data']]) - && ($arr[$i]['data'] != '*' || in_array($arr[$i]['type'], array('digit_integer','digit_float','digit_hex'))) - ) { - $before .= PMA_Util::showMySQLDocu( - 'functions', - $PMA_SQPdata_operators_docs[$arr[$i]['data']]['link'], - false, - $PMA_SQPdata_operators_docs[$arr[$i]['data']]['anchor'], - true - ); - $after .= '</a>'; - } // workaround for // select * from mytable limit 0,-1 @@ -2519,68 +2498,6 @@ function PMA_SQP_format( } break; case 'alpha_columnType': - if ($docu) { - switch ($arr[$i]['data']) { - case 'tinyint': - case 'smallint': - case 'mediumint': - case 'int': - case 'bigint': - case 'decimal': - case 'float': - case 'double': - case 'real': - case 'bit': - case 'boolean': - case 'serial': - $before .= PMA_Util::showMySQLDocu( - 'data-types', - 'numeric-types', - false, - '', - true - ); - $after = '</a>' . $after; - break; - case 'date': - case 'datetime': - case 'timestamp': - case 'time': - case 'year': - $before .= PMA_Util::showMySQLDocu( - 'data-types', - 'date-and-time-types', - false, - '', - true - ); - $after = '</a>' . $after; - break; - case 'char': - case 'varchar': - case 'tinytext': - case 'text': - case 'mediumtext': - case 'longtext': - case 'binary': - case 'varbinary': - case 'tinyblob': - case 'mediumblob': - case 'blob': - case 'longblob': - case 'enum': - case 'set': - $before .= PMA_Util::showMySQLDocu( - 'data-types', - 'string-types', - false, - '', - true - ); - $after = '</a>' . $after; - break; - } - } if ($typearr[3] == 'alpha_columnAttrib') { $after .= ' '; } @@ -2623,16 +2540,6 @@ function PMA_SQP_format( break; case 'alpha_functionName': $funcname = strtoupper($arr[$i]['data']); - if ($docu && isset($PMA_SQPdata_functions_docs[$funcname])) { - $before .= PMA_Util::showMySQLDocu( - 'functions', - $PMA_SQPdata_functions_docs[$funcname]['link'], - false, - $PMA_SQPdata_functions_docs[$funcname]['anchor'], - true - ); - $after .= '</a>'; - } break; case 'alpha_reservedWord': // do not uppercase the reserved word if we are calling @@ -2697,41 +2604,6 @@ function PMA_SQP_format( case 'ANALYZE': case 'ANALYSE': case 'OPTIMIZE': - if ($docu) { - switch ($arr[$i + 1]['data']) { - case 'EVENT': - case 'TABLE': - case 'TABLESPACE': - case 'FUNCTION': - case 'INDEX': - case 'PROCEDURE': - case 'TRIGGER': - case 'SERVER': - case 'DATABASE': - case 'VIEW': - $before .= PMA_Util::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_Util::showMySQLDocu( - 'SQL-Syntax', - $arr[$i]['data'] . '_LOGFILE_GROUP', - false, - '', - true - ); - $close_docu_link = true; - } - } if (!$in_priv_list) { $space_punct_listsep = $html_line_break; $space_alpha_reserved_word = ' '; @@ -2748,24 +2620,8 @@ function PMA_SQP_format( case 'DATABASE': case 'VIEW': case 'GROUP': - if ($close_docu_link) { - $after = '</a>' . $after; - $close_docu_link = false; - } break; case 'SET': - if ($docu - && ($i == 0 || $arr[$i - 1]['data'] != 'CHARACTER') - ) { - $before .= PMA_Util::showMySQLDocu( - 'SQL-Syntax', - $arr[$i]['data'], - false, - '', - true - ); - $after = '</a>' . $after; - } if (!$in_priv_list) { $space_punct_listsep = $html_line_break; $space_alpha_reserved_word = ' '; @@ -2776,16 +2632,6 @@ function PMA_SQP_format( case 'DELETE': case 'SHOW': case 'UPDATE': - if ($docu) { - $before .= PMA_Util::showMySQLDocu( - 'SQL-Syntax', - $arr[$i]['data'], - false, - '', - true - ); - $after = '</a>' . $after; - } if (!$in_priv_list) { $space_punct_listsep = $html_line_break; $space_alpha_reserved_word = ' '; @@ -2793,16 +2639,6 @@ function PMA_SQP_format( break; case 'INSERT': case 'REPLACE': - if ($docu) { - $before .= PMA_Util::showMySQLDocu( - 'SQL-Syntax', - $arr[$i]['data'], - false, - '', - true - ); - $after = '</a>' . $after; - } if (!$in_priv_list) { $space_punct_listsep = $html_line_break; $space_alpha_reserved_word = $html_line_break; @@ -2813,96 +2649,14 @@ function PMA_SQP_format( $space_alpha_reserved_word = $html_line_break; break; case 'SELECT': - if ($docu) { - $before .= PMA_Util::showMySQLDocu( - 'SQL-Syntax', - 'SELECT', - false, - '', - true - ); - $after = '</a>' . $after; - } $space_punct_listsep = ' '; $space_alpha_reserved_word = $html_line_break; break; case 'CALL': case 'DO': case 'HANDLER': - if ($docu) { - $before .= PMA_Util::showMySQLDocu( - 'SQL-Syntax', - $arr[$i]['data'], - false, - '', - true - ); - $after = '</a>' . $after; - } break; default: - if ($close_docu_link - && in_array( - $arr[$i]['data'], - array('LIKE', 'NOT', 'IN', 'REGEXP', 'NULL') - ) - ) { - $after .= '</a>'; - $close_docu_link = false; - } else if ($docu - && isset($PMA_SQPdata_functions_docs[$arr[$i]['data']]) - ) { - /* Handle multi word statements first */ - if (isset($typearr[4]) - && $typearr[4] == 'alpha_reservedWord' - && $typearr[3] == 'alpha_reservedWord' - && isset($PMA_SQPdata_functions_docs[strtoupper( - $arr[$i]['data'] . '_' - . $arr[$i + 1]['data'] . '_' - . $arr[$i + 2]['data'] - )]) - ) { - $tempname = strtoupper( - $arr[$i]['data'] . '_' - . $arr[$i + 1]['data'] . '_' - . $arr[$i + 2]['data'] - ); - $before .= PMA_Util::showMySQLDocu( - 'functions', - $PMA_SQPdata_functions_docs[$tempname]['link'], - false, - $PMA_SQPdata_functions_docs[$tempname]['anchor'], - true - ); - $close_docu_link = true; - } else if (isset($typearr[3]) - && $typearr[3] == 'alpha_reservedWord' - && isset($PMA_SQPdata_functions_docs[strtoupper( - $arr[$i]['data'] . '_' . $arr[$i + 1]['data'] - )]) - ) { - $tempname = strtoupper( - $arr[$i]['data'] . '_' . $arr[$i + 1]['data'] - ); - $before .= PMA_Util::showMySQLDocu( - 'functions', - $PMA_SQPdata_functions_docs[$tempname]['link'], - false, - $PMA_SQPdata_functions_docs[$tempname]['anchor'], - true - ); - $close_docu_link = true; - } else { - $before .= PMA_Util::showMySQLDocu( - 'functions', - $PMA_SQPdata_functions_docs[$arr[$i]['data']]['link'], - false, - $PMA_SQPdata_functions_docs[$arr[$i]['data']]['anchor'], - true - ); - $after .= '</a>'; - } - } break; } // end switch ($arr[$i]['data']) @@ -2983,11 +2737,6 @@ function PMA_SQP_format( $indent--; $str .= ($mode != 'query_only' ? '</div>' : ' '); } - /* End possibly unclosed documentation link */ - if ($close_docu_link) { - $str .= '</a>'; - $close_docu_link = false; - } if ($mode!='query_only') { // close inner_sql span $str .= '</span>'; |