Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

This commit is contained in:
Thilanka Kaushalya 2011-06-03 22:50:39 +05:30
commit 67b67faa71
116 changed files with 24577 additions and 21592 deletions

14
.gitignore vendored
View File

@ -1,14 +1,14 @@
# Directory for creating releases
release
/release/
# Configuration files
config.inc.php
config.header.inc.php
config.footer.inc.php
# Upload/save dirs
upload
save
/upload/
/save/
# For setup script
config
/config/
# ctags
tags
# Editor files
@ -22,12 +22,12 @@ phpmyadmin.wpj
.idea
*.sw[op]
# Locales
locale
/locale/
# Backups
*~
# Javascript sources
sources
/sources/
# API documentation
apidoc
/apidoc/
# Demo server
revision-info.php

View File

@ -11,6 +11,10 @@
+ rfe #2098927 Remember recent tables
+ rfe #3078542 Remember the last sort order for each table
+ AJAX for Create table in navigation panel
+ rfe #3310562 Wording about Column
3.4.3.0 (not yet released)
- bug #3311170 [sync] Missing helper icons in Synchronize
3.4.2.0 (not yet released)
- bug #3301249 [interface] Iconic table operations does not remove inline edit label
@ -24,6 +28,7 @@
- bug #3306958 [interface] Unnecessary Details slider
- bug #3308476 [interface] "Show all" not persistent after a sort
- bug #3308072 [auth] Version disclosure to anonymous visitors
- bug #3306981 [interface] pmahomme and table statistics
3.4.1.0 (2011-05-20)
- bug #3301108 [interface] Synchronize and already configured host

View File

@ -1934,14 +1934,12 @@ $cfg['TrustedProxies'] =
<dd>Maximum number of characters shown in any non-numeric field on browse view.
Can be turned off by a toggle button on the browse page.</dd>
<dt><span id="cfg_ModifyDeleteAtLeft">$cfg['ModifyDeleteAtLeft'] </span>boolean
<span id="cfg_ModifyDeleteAtRight">$cfg['ModifyDeleteAtRight'] </span>boolean
<dt><span id="cfg_RowActionLinks">$cfg['RowActionLinks'] </span>string
</dt>
<dd>Defines the place where table row links (Edit, Inline edit, Copy,
Delete) would be put when
tables contents are displayed (you may have them displayed both at the
left and at the right).
&quot;Left&quot; and &quot;right&quot; are parsed as &quot;top&quot;
Delete) would be put when tables contents are displayed (you may
have them displayed at the left side, right side, both sides or nowhere).
&quot;left&quot; and &quot;right&quot; are parsed as &quot;top&quot;
and &quot;bottom&quot; with vertical display mode.</dd>
<dt id="cfg_DefaultDisplay">$cfg['DefaultDisplay'] string</dt>

View File

@ -147,7 +147,7 @@ function PMA_exportOutputHandler($line)
if ($dump_buffer_len > $GLOBALS['memory_limit']) {
if ($GLOBALS['output_charset_conversion']) {
$dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer);
$dump_buffer = PMA_convert_string('utf-8', $GLOBALS['charset_of_file'], $dump_buffer);
}
// as bzipped
if ($GLOBALS['compression'] == 'bzip' && @function_exists('bzcompress')) {
@ -181,7 +181,7 @@ function PMA_exportOutputHandler($line)
} else {
if ($GLOBALS['asfile']) {
if ($GLOBALS['output_charset_conversion']) {
$line = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $line);
$line = PMA_convert_string('utf-8', $GLOBALS['charset_of_file'], $line);
}
if ($GLOBALS['save_on_server'] && strlen($line) > 0) {
$write_result = @fwrite($GLOBALS['file_handle'], $line);
@ -218,7 +218,7 @@ $output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xl
// Do we need to convert charset?
$output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE
&& isset($charset_of_file) && $charset_of_file != $charset
&& isset($charset_of_file) && $charset_of_file != 'utf-8'
&& $type != 'xls';
// Use on the fly compression?
@ -273,7 +273,7 @@ if ($asfile) {
$filename = PMA_expandUserString($filename_template);
// convert filename to iso-8859-1, it is safer
$filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
$filename = PMA_convert_string('utf-8', 'iso-8859-1', $filename);
// Grab basic dump extension and mime type
// Check if the user already added extension; get the substring where the extension would be if it was included
@ -637,7 +637,7 @@ if ($save_on_server && isset($message)) {
if (!empty($asfile)) {
// Convert the charset if required.
if ($output_charset_conversion) {
$dump_buffer = PMA_convert_string($GLOBALS['charset'], $GLOBALS['charset_of_file'], $dump_buffer);
$dump_buffer = PMA_convert_string('utf-8', $GLOBALS['charset_of_file'], $dump_buffer);
}
// Do the compression

View File

@ -343,7 +343,7 @@ if ($import_file != 'none' && !$error) {
// Convert the file's charset if necessary
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file)) {
if ($charset_of_file != $charset) {
if ($charset_of_file != 'utf-8') {
$charset_conversion = TRUE;
}
} elseif (isset($charset_of_file) && $charset_of_file != 'utf8') {

View File

@ -12,7 +12,6 @@
* or common.inc.php
* @uses $GLOBALS['available_languages'] from common.inc.php (select_lang.lib.php)
* @uses $GLOBALS['db']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['lang']
* @uses $GLOBALS['text_dir']
* @uses $_ENV['HTTP_HOST']
@ -102,8 +101,7 @@ include ('./libraries/header_http.inc.php');
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin <?php echo PMA_VERSION; ?> -
<?php echo htmlspecialchars($HTTP_HOST); ?></title>
<meta http-equiv="Content-Type"
content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<script type="text/javascript">
// <![CDATA[

19
js/codemirror/LICENSE Normal file
View File

@ -0,0 +1,19 @@
Copyright (C) 2011 by Marijn Haverbeke <marijnh@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2035
js/codemirror/lib/codemirror.js vendored Normal file

File diff suppressed because it is too large Load Diff

145
js/codemirror/mode/mysql/mysql.js vendored Normal file
View File

@ -0,0 +1,145 @@
CodeMirror.defineMode("mysql", function(config, parserConfig) {
var indentUnit = config.indentUnit,
keywords = parserConfig.keywords,
functions = parserConfig.functions,
types = parserConfig.types,
attributes = parserConfig.attributes,
multiLineStrings = parserConfig.multiLineStrings;
var isOperatorChar = /[+\-*&%=<>!?:\/|]/;
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
}
var type;
function ret(tp, style) {
type = tp;
return style;
}
function tokenBase(stream, state) {
var ch = stream.next();
// start of string?
if (ch == '"' || ch == "'" || ch == '`')
return chain(stream, state, tokenString(ch));
// is it one of the special signs []{}().,;? Seperator?
else if (/[\[\]{}\(\),;\.]/.test(ch))
return ret(ch);
// start of a number value?
else if (/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/)
return ret("number", "mysql-number");
}
// multi line comment or simple operator?
else if (ch == "/") {
if (stream.eat("*")) {
return chain(stream, state, tokenComment);
}
else {
stream.eatWhile(isOperatorChar);
return ret("operator", "mysql-operator");
}
}
// single line comment or simple operator?
else if (ch == "-") {
if (stream.eat("-")) {
stream.skipToEnd();
return ret("comment", "mysql-comment");
}
else {
stream.eatWhile(isOperatorChar);
return ret("operator", "mysql-operator");
}
}
// pl/sql variable?
else if (ch == "@" || ch == "$") {
stream.eatWhile(/[\w\d\$_]/);
return ret("word", "mysql-var");
}
// is it a operator?
else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return ret("operator", "mysql-operator");
}
else {
// get the whole word
stream.eatWhile(/[\w\$_]/);
// is it one of the listed keywords?
if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-keyword");
// is it one of the listed functions?
if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-function");
// is it one of the listed types?
if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-type");
// is it one of the listed attributes?
if (attributes && attributes.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-attribute");
// default: just a "word"
return ret("word", "mysql-word");
}
}
function tokenString(quote) {
return function(stream, state) {
var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
if (next == quote && !escaped) {end = true; break;}
escaped = !escaped && next == "\\";
}
if (end || !(escaped || multiLineStrings))
state.tokenize = tokenBase;
return ret("string", "mysql-string");
};
}
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "*");
}
return ret("comment", "mysql-comment");
}
// Interface
return {
startState: function(basecolumn) {
return {
tokenize: tokenBase,
indented: 0,
startOfLine: true
};
},
token: function(stream, state) {
if (stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
return style;
}
};
});
(function() {
function keywords(str) {
var obj = {}, words = str.split(" ");
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
var cKeywords = "accessible action add after against aggregate algorithm all alter analyse analyze and as asc autocommit auto_increment avg_row_length backup begin between binlog both by cascade case change changed charset check checksum collate collation column columns comment commit committed compressed concurrent constraint contains convert create cross current_timestamp database databases day day_hour day_minute day_second definer delayed delay_key_write delete desc describe deterministic distinct distinctrow div do drop dumpfile duplicate dynamic else enclosed end engine engines escape escaped events execute exists explain extended fast fields file first fixed flush for force foreign from full fulltext function gemini gemini_spin_retries global grant grants group having heap high_priority hosts hour hour_minute hour_second identified if ignore in index indexes infile inner insert insert_id insert_method interval into invoker is isolation join key keys kill last_insert_id leading left like limit linear lines load local lock locks logs low_priority maria master master_connect_retry master_host master_log_file master_log_pos master_password master_port master_user match max_connections_per_hour max_queries_per_hour max_rows max_updates_per_hour max_user_connections medium merge minute minute_second min_rows mode modify month mrg_myisam myisam names natural no not null offset on open optimize option optionally or order outer outfile pack_keys page page_checksum partial partition partitions password primary privileges procedure process processlist purge quick raid0 raid_chunks raid_chunksize raid_type range read read_only read_write references regexp reload rename repair repeatable replace replication reset restore restrict return returns revoke right rlike rollback row rows row_format second security select separator serializable session share show shutdown slave soname sounds sql sql_auto_is_null sql_big_result sql_big_selects sql_big_tables sql_buffer_result sql_cache sql_calc_found_rows sql_log_bin sql_log_off sql_log_update sql_low_priority_updates sql_max_join_size sql_no_cache sql_quote_show_create sql_safe_updates sql_select_limit sql_slave_skip_counter sql_small_result sql_warnings start starting status stop storage straight_join string striped super table tables temporary terminated then to trailing transactional truncate type types uncommitted union unique unlock update usage use using values variables view when where with work write xor year_month";
var cFunctions = "abs acos adddate addtime aes_decrypt aes_encrypt area asbinary ascii asin astext atan atan2 avg bdmpolyfromtext bdmpolyfromwkb bdpolyfromtext bdpolyfromwkb benchmark bin bit_and bit_count bit_length bit_or bit_xor boundary buffer cast ceil ceiling centroid char character_length charset char_length coalesce coercibility collation compress concat concat_ws connection_id contains conv convert convert_tz convexhull cos cot count crc32 crosses curdate current_date current_time current_timestamp current_user curtime database date datediff date_add date_diff date_format date_sub day dayname dayofmonth dayofweek dayofyear decode default degrees des_decrypt des_encrypt difference dimension disjoint distance elt encode encrypt endpoint envelope equals exp export_set exteriorring extract extractvalue field find_in_set floor format found_rows from_days from_unixtime geomcollfromtext geomcollfromwkb geometrycollection geometrycollectionfromtext geometrycollectionfromwkb geometryfromtext geometryfromwkb geometryn geometrytype geomfromtext geomfromwkb get_format get_lock glength greatest group_concat group_unique_users hex hour if ifnull inet_aton inet_ntoa insert instr interiorringn intersection intersects interval isclosed isempty isnull isring issimple is_free_lock is_used_lock last_day last_insert_id lcase least left length linefromtext linefromwkb linestring linestringfromtext linestringfromwkb ln load_file localtime localtimestamp locate log log10 log2 lower lpad ltrim makedate maketime make_set master_pos_wait max mbrcontains mbrdisjoint mbrequal mbrintersects mbroverlaps mbrtouches mbrwithin md5 microsecond mid min minute mlinefromtext mlinefromwkb mod month monthname mpointfromtext mpointfromwkb mpolyfromtext mpolyfromwkb multilinestring multilinestringfromtext multilinestringfromwkb multipoint multipointfromtext multipointfromwkb multipolygon multipolygonfromtext multipolygonfromwkb name_const now nullif numgeometries numinteriorrings numpoints oct octet_length old_password ord overlaps password period_add period_diff pi point pointfromtext pointfromwkb pointn pointonsurface polyfromtext polyfromwkb polygon polygonfromtext polygonfromwkb position pow power quarter quote radians rand related release_lock repeat replace reverse right round row_count rpad rtrim schema second sec_to_time session_user sha sha1 sign sin sleep soundex space sqrt srid startpoint std stddev stddev_pop stddev_samp strcmp str_to_date subdate substr substring substring_index subtime sum symdifference sysdate system_user tan time timediff timestamp timestampadd timestampdiff time_format time_to_sec touches to_days trim truncate ucase uncompress uncompressed_length unhex unique_users unix_timestamp updatexml upper user utc_date utc_time utc_timestamp uuid variance var_pop var_samp version week weekday weekofyear within x y year yearweek";
var cTypes = "bigint binary bit blob bool boolean char character date datetime dec decimal double enum float float4 float8 geometry geometrycollection int int1 int2 int3 int4 int8 integer linestring long longblob longtext mediumblob mediumint mediumtext middleint multilinestring multipoint multipolygon nchar numeric point polygon real serial set smallint text time timestamp tinyblob tinyint tinytext varbinary varchar year";
var cAttributes = "archive ascii auto_increment bdb berkeleydb binary blackhole csv default example federated heap innobase innodb isam maria memory merge mrg_isam mrg_myisam myisam national ndb ndbcluster precision undefined unicode unsigned varying zerofill";
CodeMirror.defineMIME("text/x-mysql", {
name: "mysql",
keywords: keywords(cKeywords),
functions: keywords(cFunctions),
types: keywords(cTypes),
attributes: keywords(cAttributes)
});
}());

View File

@ -20,6 +20,11 @@ var only_once_elements = new Array();
*/
var ajax_message_init = false;
/**
* @var codemirror_editor object containing CodeMirror editor
*/
var codemirror_editor = false;
/**
* Add a hidden field to the form to indicate that this will be an
* Ajax request (only if this hidden field does not exist)
@ -719,15 +724,31 @@ function setSelectOptions(the_form, the_select, do_check)
return true;
} // end of the 'setSelectOptions()' function
/**
* Sets current value for query box.
*/
function setQuery(query) {
if (codemirror_editor) {
codemirror_editor.setValue(query);
} else {
document.sqlform.sql_query.value = query;
}
}
/**
* Create quick sql statements.
*
*/
function insertQuery(queryType) {
if (queryType == "clear") {
setQuery('');
return;
}
var myQuery = document.sqlform.sql_query;
var myListBox = document.sqlform.dummy;
var query = "";
var myListBox = document.sqlform.dummy;
var table = document.sqlform.table.value;
if (myListBox.options.length > 0) {
@ -758,7 +779,7 @@ function insertQuery(queryType) {
} else if(queryType == "delete") {
query = "DELETE FROM `" + table + "` WHERE 1";
}
document.sqlform.sql_query.value = query;
setQuery(query);
sql_box_locked = false;
}
}
@ -785,8 +806,11 @@ function insertValueQuery() {
}
}
/* CodeMirror support */
if (codemirror_editor) {
codemirror_editor.replaceSelection(chaineAj);
//IE support
if (document.selection) {
} else if (document.selection) {
myQuery.focus();
sel = document.selection.createRange();
sel.text = chaineAj;
@ -1147,11 +1171,7 @@ $(document).ready(function(){
});
$('.sqlbutton').click(function(evt){
if (evt.target.id == 'clear') {
$('#sqlquery').val('');
} else {
insertQuery(evt.target.id);
}
insertQuery(evt.target.id);
return false;
});
@ -2370,3 +2390,13 @@ $(document).ready(function() {
}); // end $.PMA_confirm()
}); //end of Drop Table Ajax action
}) // end of $(document).ready() for Drop Table
/**
* Attach CodeMirror2 editor to SQL edit area.
*/
$(document).ready(function() {
var elm = $('#sqlquery');
if (elm.length > 0) {
codemirror_editor = CodeMirror.fromTextArea(elm[0], {lineNumbers: true, matchBrackets: true, indentUnit: 4, mode: "text/x-mysql"});
}
})

View File

@ -66,7 +66,7 @@ function appendInlineAnchor() {
if (disp_mode == 'vertical') {
// there can be one or two tr containing this class, depending
// on the ModifyDeleteAtLeft and ModifyDeleteAtRight cfg parameters
// on the RowActionLinks cfg parameter
$('#table_results tr')
.find('.edit_row_anchor')
.removeClass('edit_row_anchor')
@ -365,7 +365,7 @@ $(document).ready(function() {
$("#sqlqueryresults").html(data);
$("#sqlqueryresults").trigger('appendAnchor');
PMA_init_slider();
PMA_ajaxRemoveMessage($msgbox);
}) // end $.post()
})// end Paginate results table
@ -388,7 +388,7 @@ $(document).ready(function() {
$("#sqlqueryresults").html(data);
$("#sqlqueryresults").trigger('appendAnchor');
PMA_init_slider();
PMA_ajaxRemoveMessage($msgbox);
PMA_ajaxRemoveMessage($msgbox);
}) // end $.post()
} else {
$the_form.submit();
@ -456,7 +456,7 @@ $(document).ready(function() {
$edit_td.removeClass('inline_edit_anchor').addClass('inline_edit_active').parent('tr').addClass('noclick');
// Adding submit and hide buttons to inline edit <td>.
// For "hide" button the original data to be restored is
// For "hide" button the original data to be restored is
// kept in the jQuery data element 'original_data' inside the <td>.
// Looping through all columns or rows, to find the required data and then storing it in an array.
@ -840,7 +840,7 @@ $(document).ready(function() {
*/
var relation_fields = {};
/**
* @var relational_display string 'K' if relational key, 'D' if relational display column
* @var relational_display string 'K' if relational key, 'D' if relational display column
*/
var relational_display = $("#relational_display_K").attr('checked') ? 'K' : 'D';
/**
@ -858,7 +858,7 @@ $(document).ready(function() {
var sql_query = 'UPDATE `' + window.parent.table + '` SET ';
var need_to_post = false;
var new_clause = '';
var prev_index = -1;
@ -930,7 +930,7 @@ $(document).ready(function() {
}
})
/*
/*
* update the where_clause, remove the last appended ' AND '
* */
@ -1004,10 +1004,10 @@ $(document).ready(function() {
/**
* Visually put back the row in the state it was before entering Inline edit
* Visually put back the row in the state it was before entering Inline edit
*
* (when called in the situation where no posting was done, the data
* parameter is empty)
* parameter is empty)
*/
function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {

View File

@ -259,7 +259,7 @@ class PMA_File
* @uses curl_setopt_array()
* @uses PMA_File::$_error_message
* @uses $_FILES
* @param string $key the md5 hash of the column name
* @param string $key the md5 hash of the column name
* @param string $rownumber
* @return boolean success
*/
@ -378,7 +378,7 @@ class PMA_File
* @uses $_REQUEST
* @uses PMA_File::setLocalSelectedFile()
* @uses is_string()
* @param string $key the md5 hash of the column name
* @param string $key the md5 hash of the column name
* @param string $rownumber
* @return boolean success
*/
@ -462,7 +462,7 @@ class PMA_File
* @access public
* @uses PMA_File::setUploadedFromTblChangeRequest()
* @uses PMA_File::setSelectedFromTblChangeRequest()
* @param string $key the md5 hash of the column name
* @param string $key the md5 hash of the column name
* @param string $rownumber
* @return boolean success
*/
@ -820,7 +820,7 @@ class PMA_File
echo '<hr />';
if ($GLOBALS['charset_conversion']) {
$result = PMA_convert_string($this->getCharset(), $GLOBALS['charset'], $result);
$result = PMA_convert_string($this->getCharset(), 'utf-8', $result);
} else {
/**
* Skip possible byte order marks (I do not think we need more

View File

@ -78,7 +78,7 @@ function PMA_auth_fails()
}
// Defines the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
header('Content-Type: text/html; charset=utf-8');
/* HTML header */
$page_title = __('Access denied');
require './libraries/header_meta_style.inc.php';

View File

@ -110,7 +110,6 @@ function PMA_get_blowfish_secret() {
* @uses $GLOBALS['pma_auth_server']
* @uses $GLOBALS['text_dir']
* @uses $GLOBALS['pmaThemeImage']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['target']
* @uses $GLOBALS['db']
* @uses $GLOBALS['table']
@ -162,7 +161,7 @@ function PMA_auth()
$cell_align = ($GLOBALS['text_dir'] == 'ltr') ? 'left' : 'right';
// Defines the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
header('Content-Type: text/html; charset=utf-8');
// Defines the "item" image depending on text direction
$item_img = $GLOBALS['pmaThemeImage'] . 'item_' . $GLOBALS['text_dir'] . '.png';

View File

@ -46,7 +46,7 @@ function PMA_auth()
}
// Defines the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
header('Content-Type: text/html; charset=utf-8');
/* HTML header */
$page_title = __('Access denied');
require './libraries/header_meta_style.inc.php';

View File

@ -2249,20 +2249,14 @@ $cfg['CharTextareaRows'] = 2;
$cfg['LimitChars'] = 50;
/**
* show edit/delete links on left side of browse
* (or at the top with vertical browse)
* Where to show the edit/inline_edit/delete links in browse mode
* Possible values are 'left', 'right', 'both' and 'none';
* which will be interpreted as 'top', 'bottom', 'both' and 'none'
* respectively for vertical display mode
*
* @global boolean $cfg['ModifyDeleteAtLeft']
* @global string $cfg['RowActionLinks']
*/
$cfg['ModifyDeleteAtLeft'] = true;
/**
* show edit/delete links on right side of browse
* (or at the bottom with vertical browse)
*
* @global boolean $cfg['ModifyDeleteAtRight']
*/
$cfg['ModifyDeleteAtRight'] = false;
$cfg['RowActionLinks'] = 'left';
/**
* default display direction (horizontal|vertical|horizontalflipped)

View File

@ -44,6 +44,7 @@ $cfg_db['LeftFrameDBSeparator'] = 'short_string';
$cfg_db['LeftFrameTableSeparator'] = 'short_string';
$cfg_db['NavigationBarIconic'] = array(true => __('Yes'), false => __('No'), 'both' => __('Both'));
$cfg_db['Order'] = array('ASC', 'DESC', 'SMART');
$cfg_db['RowActionLinks'] = array('none' => __('Nowhere'), 'left' => __('Left'), 'right' => __('Right'), 'both' => __('Both'));
$cfg_db['ProtectBinary'] = array(false, 'blob', 'all');
$cfg_db['DefaultDisplay'] = array('horizontal', 'vertical', 'horizontalflipped');
$cfg_db['CharEditing'] = array('input', 'textarea');

View File

@ -314,9 +314,8 @@ $strConfigMcryptDisableWarning_desc = __('Disable the default warning that is di
$strConfigMcryptDisableWarning_name = __('mcrypt warning');
$strConfigMemoryLimit_desc = __('The number of bytes a script is allowed to allocate, eg. [kbd]32M[/kbd] ([kbd]0[/kbd] for no limit)');
$strConfigMemoryLimit_name = __('Memory limit');
$strConfigModifyDeleteAtLeft_desc = __('These are Edit, Inline edit, Copy and Delete links');
$strConfigModifyDeleteAtLeft_name = __('Show table row links on left side');
$strConfigModifyDeleteAtRight_name = __('Show table row links on right side');
$strConfigRowActionLinks_desc = __('These are Edit, Inline edit, Copy and Delete links');
$strConfigRowActionLinks_name = __('Where to show the table row links');
$strConfigNaturalOrder_desc = __('Use natural order for sorting table and database names');
$strConfigNaturalOrder_name = __('Natural order');
$strConfigNavigationBarIconic_desc = __('Use only icons, only text or both');

View File

@ -199,8 +199,7 @@ $forms['Main_frame']['Browse'] = array(
'BrowseMarkerEnable',
'RepeatCells',
'LimitChars',
'ModifyDeleteAtLeft',
'ModifyDeleteAtRight',
'RowActionLinks',
'DefaultDisplay',
'RememberSorting');
$forms['Main_frame']['Edit'] = array(

View File

@ -109,8 +109,7 @@ $forms['Main_frame']['Browse'] = array(
'BrowseMarkerEnable',
'RepeatCells',
'LimitChars',
'ModifyDeleteAtLeft',
'ModifyDeleteAtRight',
'RowActionLinks',
'DefaultDisplay',
'RememberSorting');
$forms['Main_frame']['Edit'] = array(

View File

@ -82,7 +82,6 @@ function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows
* and charset names to ISO charset from information_schema.CHARACTER_SETS
*
* @uses $GLOBALS['cfg']['IconvExtraParams']
* @uses $GLOBALS['charset'] as target charset
* @uses PMA_DBI_fetch_value() to get server_language
* @uses preg_match() to filter server_language
* @uses in_array()
@ -135,20 +134,20 @@ function PMA_DBI_convert_message($message) {
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
require_once './libraries/iconv_wrapper.lib.php';
$message = PMA_aix_iconv_wrapper($encodings[$server_language],
$GLOBALS['charset'] . $GLOBALS['cfg']['IconvExtraParams'], $message);
'utf-8' . $GLOBALS['cfg']['IconvExtraParams'], $message);
} else {
$message = iconv($encodings[$server_language],
$GLOBALS['charset'] . $GLOBALS['cfg']['IconvExtraParams'], $message);
'utf-8' . $GLOBALS['cfg']['IconvExtraParams'], $message);
}
} elseif (function_exists('recode_string')) {
$message = recode_string($encodings[$server_language] . '..' . $GLOBALS['charset'],
$message = recode_string($encodings[$server_language] . '..' . 'utf-8',
$message);
} elseif (function_exists('libiconv')) {
$message = libiconv($encodings[$server_language], $GLOBALS['charset'], $message);
$message = libiconv($encodings[$server_language], 'utf-8', $message);
} elseif (function_exists('mb_convert_encoding')) {
// do not try unsupported charsets
if (! in_array($server_language, array('ukrainian', 'greek', 'serbian'))) {
$message = mb_convert_encoding($message, $GLOBALS['charset'],
$message = mb_convert_encoding($message, 'utf-8',
$encodings[$server_language]);
}
}
@ -919,7 +918,6 @@ function PMA_DBI_get_variable($var, $type = PMA_DBI_GETVAR_SESSION, $link = null
* @uses $GLOBALS['collation_connection']
* @uses $GLOBALS['available_languages']
* @uses $GLOBALS['mysql_charset_map']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['lang']
* @uses $GLOBALS['cfg']['Lang']
* @uses defined()

View File

@ -285,7 +285,7 @@ if(isset($_GET['sql_query'])) {
echo '<option value="' . $temp_charset . '"';
if(isset($_GET['charset_of_file']) && ($_GET['charset_of_file'] != $temp_charset)) {
echo '';
} elseif ((empty($cfg['Export']['charset']) && $temp_charset == $charset)
} elseif ((empty($cfg['Export']['charset']) && $temp_charset == 'utf-8')
|| $temp_charset == $cfg['Export']['charset']) {
echo ' selected="selected"';
}

View File

@ -190,7 +190,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
echo '<select id="charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
echo '<option value="' . htmlentities($temp_charset) . '"';
if ((empty($cfg['Import']['charset']) && $temp_charset == $charset)
if ((empty($cfg['Import']['charset']) && $temp_charset == 'utf-8')
|| $temp_charset == $cfg['Import']['charset']) {
echo ' selected="selected"';
}

View File

@ -661,7 +661,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// ... at the left column of the result table header if possible
// and required
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& $is_display['text_btn'] == '1') {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 0;
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
@ -677,7 +678,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
}
// ... elseif no button, displays empty(ies) col(s) if required
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 0;
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
@ -691,6 +692,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
} // end vertical mode
}
// ... elseif display an empty column if the actions links are disabled to match the rest of the table
elseif ($GLOBALS['cfg']['RowActionLinks'] == 'none' && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
echo '<td></td>';
}
// 2. Displays the fields' name
// 2.0 If sorting links should be used, checks if the query is a "JOIN"
// statement (see 2.1.3)
@ -912,9 +919,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// 3. Displays the needed checkboxes at the right
// column of the result table header if possible and required...
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
&& $is_display['text_btn'] == '1') {
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
&& $is_display['text_btn'] == '1') {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 1;
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
@ -933,7 +940,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// ... elseif no button, displays empty columns if required
// (unless coming from Browse mode print view)
elseif ($GLOBALS['cfg']['ModifyDeleteAtRight']
elseif (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
&& (!$GLOBALS['is_header_sent'])) {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 4 : 1;
@ -1249,13 +1256,20 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} // end if (1.2.2)
// 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
if (! isset($js_conf)) {
$js_conf = '';
}
echo PMA_generateCheckboxAndLinks('left', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf);
} else if (($GLOBALS['cfg']['RowActionLinks'] == 'none')
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
if (! isset($js_conf)) {
$js_conf = '';
}
echo PMA_generateCheckboxAndLinks('none', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf);
} // end if (1.3)
} // end if (1)
@ -1465,13 +1479,13 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
} // end for (2)
// 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
if (! isset($js_conf)) {
$js_conf = '';
}
echo PMA_generateCheckboxAndLinks('right', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'r', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf);
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
if (! isset($js_conf)) {
$js_conf = '';
}
echo PMA_generateCheckboxAndLinks('right', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, 'r', $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf);
} // end if (3)
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
@ -1551,15 +1565,19 @@ function PMA_displayVerticalTable()
global $vertical_display;
// Displays "multi row delete" link at top if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] != 'right')
&& is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if ($GLOBALS['cfg']['RowActionLinks'] == 'none') {
// if we are not showing the RowActionLinks, then we need to show the Multi-Row-Action checkboxes
echo '<th></th>' . "\n";
}
echo $vertical_display['textbtn'];
$foo_counter = 0;
foreach ($vertical_display['row_delete'] as $val) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
echo str_replace('[%_PMA_CHECKBOX_DIR_%]', '_left', $val);
$foo_counter++;
} // end while
@ -1567,7 +1585,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "edit" link at top if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -1585,7 +1604,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "copy" link at top if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -1603,7 +1623,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "delete" link at top if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -1640,7 +1661,8 @@ function PMA_displayVerticalTable()
} // end while
// Displays "multi row delete" link at bottom if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
echo $vertical_display['textbtn'];
$foo_counter = 0;
@ -1656,7 +1678,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "edit" link at bottom if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['edit']) && (count($vertical_display['edit']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -1674,7 +1697,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "copy" link at bottom if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['copy']) && (count($vertical_display['copy']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -1692,7 +1716,8 @@ function PMA_displayVerticalTable()
} // end if
// Displays "delete" link at bottom if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) {
if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both')
&& is_array($vertical_display['delete']) && (count($vertical_display['delete']) > 0 || !empty($vertical_display['textbtn']))) {
echo '<tr>' . "\n";
if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) {
echo $vertical_display['textbtn'];
@ -2680,6 +2705,8 @@ function PMA_generateCheckboxAndLinks($position, $del_url, $is_display, $row_no,
$ret .= PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html, '');
$ret .= PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix='_right', '', '', '');
} else { // $position == 'none'
$ret .= PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix='_left', '', '', '');
}
return $ret;
}

View File

@ -63,7 +63,7 @@ function PMA_exportFooter() {
* @access public
*/
function PMA_exportHeader() {
global $charset, $charset_of_file;
global $charset_of_file;
return PMA_exportOutputHandler('<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
@ -71,7 +71,7 @@ xmlns="http://www.w3.org/TR/REC-html40">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=' . (isset($charset_of_file) ? $charset_of_file : $charset) . '" />
<meta http-equiv="Content-type" content="text/html;charset=' . (isset($charset_of_file) ? $charset_of_file : 'utf-8') . '" />
</head>
<body>');
}

View File

@ -68,7 +68,7 @@ function PMA_exportFooter() {
* @access public
*/
function PMA_exportHeader() {
$GLOBALS['ods_buffer'] .= '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?' . '>'
$GLOBALS['ods_buffer'] .= '<?xml version="1.0" encoding="utf-8"?' . '>'
. '<office:document-content '. $GLOBALS['OpenDocumentNS'] . 'office:version="1.0">'
. '<office:automatic-styles>'
. '<number:date-style style:name="N37" number:automatic-order="true">'

View File

@ -100,7 +100,7 @@ function PMA_exportFooter() {
* @access public
*/
function PMA_exportHeader() {
$GLOBALS['odt_buffer'] .= '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?' . '>'
$GLOBALS['odt_buffer'] .= '<?xml version="1.0" encoding="utf-8"?' . '>'
. '<office:document-content '. $GLOBALS['OpenDocumentNS'] . 'office:version="1.0">'
. '<office:body>'
. '<office:text>';
@ -236,7 +236,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
*
* @access public
*/
// @@@ Table structure
// @@@ Table structure
function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = false, $do_comments = false, $do_mime = false, $dates = false, $dummy)
{
global $cfgRelation;

View File

@ -183,9 +183,9 @@ if (! isset($sql_backquotes)) {
}
/**
* Exports routines (procedures and functions)
* Exports routines (procedures and functions)
*
* @param string $db
* @param string $db
*
* @return bool Whether it suceeded
*/
@ -389,7 +389,7 @@ function PMA_exportHeader()
$set_names = $mysql_charset_map[$GLOBALS['charset_of_file']];
} else {
// by default we use the connection charset
$set_names = $mysql_charset_map[$GLOBALS['charset']];
$set_names = $mysql_charset_map['utf-8'];
}
$head .= $crlf
. '/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;' . $crlf

View File

@ -3,7 +3,7 @@
/**
* Set of functions used to build XML dumps of tables
*
* @todo
* @todo
* @package phpMyAdmin-Export-XML
*/
if (! defined('PHPMYADMIN')) {
@ -24,7 +24,7 @@ if (isset($plugin_list)) {
),
'options_text' => __('Options')
);
/* Export structure */
$plugin_list['xml']['options'][] =
array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options (all are recommended)'));
@ -39,7 +39,7 @@ if (isset($plugin_list)) {
$plugin_list['xml']['options'][] =
array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views'));
$plugin_list['xml']['options'][] = array('type' => 'end_group');
/* Data */
$plugin_list['xml']['options'][] =
array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'));
@ -68,7 +68,7 @@ function PMA_exportComment($text) {
*/
function PMA_exportFooter() {
$foot = '</pma_xml_export>';
return PMA_exportOutputHandler($foot);
}
@ -86,14 +86,14 @@ function PMA_exportHeader() {
global $db;
global $table;
global $tables;
$export_struct = isset($GLOBALS[$what . '_export_struc']) ? true : false;
$export_data = isset($GLOBALS[$what . '_export_contents']) ? true : false;
if ($GLOBALS['output_charset_conversion']) {
$charset = $GLOBALS['charset_of_file'];
} else {
$charset = $GLOBALS['charset'];
$charset = 'utf-8';
}
$head = '<?xml version="1.0" encoding="' . $charset . '"?>' . $crlf
@ -111,53 +111,53 @@ function PMA_exportHeader() {
. '- ' . __('Server version') . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 3) . $crlf
. '- ' . __('PHP Version') . ': ' . phpversion() . $crlf
. '-->' . $crlf . $crlf;
$head .= '<pma_xml_export version="1.0"' . (($export_struct) ? ' xmlns:pma="http://www.phpmyadmin.net/some_doc_url/"' : '') . '>' . $crlf;
if ($export_struct) {
$result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.$db.'\' LIMIT 1');
$db_collation = $result[0]['DEFAULT_COLLATION_NAME'];
$db_charset = $result[0]['DEFAULT_CHARACTER_SET_NAME'];
$head .= ' <!--' . $crlf;
$head .= ' - Structure schemas' . $crlf;
$head .= ' -->' . $crlf;
$head .= ' <pma:structure_schemas>' . $crlf;
$head .= ' <pma:database name="' . $db . '" collation="' . $db_collation . '" charset="' . $db_charset . '">' . $crlf;
if (count($tables) == 0) {
$tables[] = $table;
}
foreach ($tables as $table) {
// Export tables and views
$result = PMA_DBI_fetch_result('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), 0);
$tbl = $result[$table][1];
$is_view = PMA_isView($db, $table);
if ($is_view) {
$type = 'view';
} else {
$type = 'table';
}
if ($is_view && ! isset($GLOBALS[$what . '_export_views'])) {
continue;
}
if (! $is_view && ! isset($GLOBALS[$what . '_export_tables'])) {
continue;
}
$head .= ' <pma:' . $type . ' name="' . $table . '">' . $crlf;
$tbl = " " . $tbl;
$tbl = str_replace("\n", "\n ", $tbl);
$head .= $tbl . ';' . $crlf;
$head .= ' </pma:' . $type . '>' . $crlf;
if (isset($GLOBALS[$what . '_export_triggers']) && $GLOBALS[$what . '_export_triggers']) {
// Export triggers
$triggers = PMA_DBI_get_triggers($db, $table);
@ -165,78 +165,78 @@ function PMA_exportHeader() {
foreach ($triggers as $trigger) {
$code = $trigger['create'];
$head .= ' <pma:trigger name="' . $trigger['name'] . '">' . $crlf;
// Do some formatting
$code = substr(rtrim($code), 0, -3);
$code = " " . $code;
$code = str_replace("\n", "\n ", $code);
$head .= $code . $crlf;
$head .= ' </pma:trigger>' . $crlf;
}
unset($trigger);
unset($triggers);
}
}
}
if (isset($GLOBALS[$what . '_export_functions']) && $GLOBALS[$what . '_export_functions']) {
// Export functions
$functions = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($functions) {
foreach ($functions as $function) {
$head .= ' <pma:function name="' . $function . '">' . $crlf;
// Do some formatting
$sql = PMA_DBI_get_definition($db, 'FUNCTION', $function);
$sql = rtrim($sql);
$sql = " " . $sql;
$sql = str_replace("\n", "\n ", $sql);
$head .= $sql . $crlf;
$head .= ' </pma:function>' . $crlf;
}
unset($create_func);
unset($function);
unset($functions);
}
}
if (isset($GLOBALS[$what . '_export_procedures']) && $GLOBALS[$what . '_export_procedures']) {
// Export procedures
$procedures = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
if ($procedures) {
foreach ($procedures as $procedure) {
$head .= ' <pma:procedure name="' . $procedure . '">' . $crlf;
// Do some formatting
$sql = PMA_DBI_get_definition($db, 'PROCEDURE', $procedure);
$sql = rtrim($sql);
$sql = " " . $sql;
$sql = str_replace("\n", "\n ", $sql);
$head .= $sql . $crlf;
$head .= ' </pma:procedure>' . $crlf;
}
unset($create_proc);
unset($procedure);
unset($procedures);
}
}
unset($result);
$head .= ' </pma:database>' . $crlf;
$head .= ' </pma:structure_schemas>' . $crlf;
if ($export_data) {
$head .= $crlf;
}
}
return PMA_exportOutputHandler($head);
}
@ -252,13 +252,13 @@ function PMA_exportHeader() {
function PMA_exportDBHeader($db) {
global $crlf;
global $what;
if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
$head = ' <!--' . $crlf
. ' - ' . __('Database') . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf
. ' -->' . $crlf
. ' <database name="' . $db . '">' . $crlf;
return PMA_exportOutputHandler($head);
}
else
@ -279,7 +279,7 @@ function PMA_exportDBHeader($db) {
function PMA_exportDBFooter($db) {
global $crlf;
global $what;
if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
return PMA_exportOutputHandler(' </database>' . $crlf);
}
@ -318,21 +318,21 @@ function PMA_exportDBCreate($db) {
*/
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
global $what;
if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
$columns_cnt = PMA_DBI_num_fields($result);
for ($i = 0; $i < $columns_cnt; $i++) {
$columns[$i] = stripslashes(str_replace(' ', '_', PMA_DBI_field_name($result, $i)));
}
unset($i);
$buffer = ' <!-- ' . __('Table') . ' ' . $table . ' -->' . $crlf;
if (!PMA_exportOutputHandler($buffer)) {
return FALSE;
}
while ($record = PMA_DBI_fetch_row($result)) {
$buffer = ' <table name="' . htmlspecialchars($table) . '">' . $crlf;
for ($i = 0; $i < $columns_cnt; $i++) {
@ -344,7 +344,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
. '</column>' . $crlf;
}
$buffer .= ' </table>' . $crlf;
if (!PMA_exportOutputHandler($buffer)) {
return FALSE;
}

View File

@ -30,6 +30,6 @@ header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-ch
header('Pragma: no-cache'); // HTTP/1.0
if (!defined('IS_TRANSFORMATION_WRAPPER')) {
// Define the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
header('Content-Type: text/html; charset=utf-8');
}
?>

View File

@ -28,14 +28,14 @@ if ($GLOBALS['text_dir'] == 'ltr') {
}
// removes the bug with the horizontal scrollbar in IE (it's allways shown, if need it or not)
// xml declaration moves IE into quirks mode, making much trouble with CSS
/* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
/* echo '<?xml version="1.0" encoding="utf-8"?>'; */
?>
<!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="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title><?php

View File

@ -43,7 +43,7 @@ if ($text_dir == 'ltr') {
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][1]; ?>" lang="<?php echo $available_languages[$lang][1]; ?>" dir="<?php echo $text_dir; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title><?php echo __('SQL result'); ?> - phpMyAdmin <?php echo PMA_VERSION ?></title>

View File

@ -39,6 +39,8 @@ if (isset($GLOBALS['db'])) {
$params['db'] = $GLOBALS['db'];
}
$GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
/**
* Here we add a timestamp when loading the file, so that users who

View File

@ -131,11 +131,11 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
$my_die = array();
}
$my_die[] = array('sql' => $import_run_buffer['full'], 'error' => PMA_DBI_getError());
if ($cfg['VerboseMultiSubmit']) {
$msg .= __('Error');
}
if (!$cfg['IgnoreMultiSubmitErrors']) {
$error = TRUE;
return;
@ -156,12 +156,12 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
if (!$sql_query_disabled) {
$sql_query .= $msg . "\n";
}
// If a 'USE <db>' SQL-clause was found and the query succeeded, set our current $db to the new one
if ($result != FALSE) {
list($db, $reload) = PMA_lookForUse($import_run_buffer['sql'], $db, $reload);
}
if ($result != FALSE && preg_match('@^[\s]*(DROP|CREATE)[\s]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@im', $import_run_buffer['sql'])) {
$reload = TRUE;
}
@ -206,16 +206,16 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
}
/**
* Looks for the presence of USE to possibly change current db
* Looks for the presence of USE to possibly change current db
*
* @param string buffer to examine
* @param string current db
* @param boolean reload
* @return array (current or new db, whether to reload)
* @param string buffer to examine
* @param string current db
* @param boolean reload
* @return array (current or new db, whether to reload)
* @access public
*/
function PMA_lookForUse($buffer, $db, $reload)
{
{
if (preg_match('@^[\s]*USE[[:space:]]*([\S]+)@i', $buffer, $match)) {
$db = trim($match[1]);
$db = trim($db,';'); // for example, USE abc;
@ -241,7 +241,7 @@ function PMA_lookForUse($buffer, $db, $reload)
function PMA_importGetNextChunk($size = 32768)
{
global $compression, $import_handle, $charset_conversion, $charset_of_file,
$charset, $read_multiply;
$read_multiply;
// Add some progression while reading large amount of data
if ($read_multiply <= 8) {
@ -298,7 +298,7 @@ function PMA_importGetNextChunk($size = 32768)
$GLOBALS['offset'] += $size;
if ($charset_conversion) {
return PMA_convert_string($charset_of_file, $charset, $result);
return PMA_convert_string($charset_of_file, 'utf-8', $result);
} else {
/**
* Skip possible byte order marks (I do not think we need more
@ -328,9 +328,9 @@ function PMA_importGetNextChunk($size = 32768)
* The column number (1-26) is converted to the responding ASCII character (A-Z) and returned.
*
* If the column number is bigger than 26 (= num of letters in alfabet),
* an extra character needs to be added. To find this extra character, the number is divided by 26
* and this value is passed to another instance of the same function (hence recursion).
* In that new instance the number is evaluated again, and if it is still bigger than 26, it is divided again
* an extra character needs to be added. To find this extra character, the number is divided by 26
* and this value is passed to another instance of the same function (hence recursion).
* In that new instance the number is evaluated again, and if it is still bigger than 26, it is divided again
* and passed to another instance of the same function. This continues until the number is smaller than 26.
* Then the last called function returns the corresponding ASCII character to the function that called it.
* Each time a called function ends an extra character is added to the column name.
@ -489,10 +489,10 @@ function PMA_getDecimalSize(&$cell) {
$curr_size = strlen((string)$cell);
$decPos = strpos($cell, ".");
$decPrecision = ($curr_size - 1) - $decPos;
$m = $curr_size - 1;
$d = $decPrecision;
return array($m, $d, ($m . "," . $d));
}
@ -525,7 +525,7 @@ function PMA_getDecimalSize(&$cell) {
*/
function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type, &$cell) {
$curr_size = strlen((string)$cell);
/**
* If the cell is NULL, don't treat it as a varchar
*/
@ -551,7 +551,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
*/
elseif ($last_cumulative_type == DECIMAL) {
$oldM = PMA_getM($last_cumulative_size);
if ($curr_size >= $oldM) {
return $curr_size;
} else {
@ -581,7 +581,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
/**
* TODO: Handle this MUCH more elegantly
*/
return -1;
}
}
@ -595,7 +595,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
if ($last_cumulative_type == VARCHAR) {
/* Convert $last_cumulative_size from varchar to decimal format */
$size = PMA_getDecimalSize($cell);
if ($size[M] >= $last_cumulative_size) {
return $size[M];
} else {
@ -607,10 +607,10 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
*/
elseif ($last_cumulative_type == DECIMAL) {
$size = PMA_getDecimalSize($cell);
$oldM = PMA_getM($last_cumulative_size);
$oldD = PMA_getD($last_cumulative_size);
/* New val if M or D is greater than current largest */
if ($size[M] > $oldM || $size[D] > $oldD) {
/* Take the largest of both types */
@ -625,7 +625,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
elseif ($last_cumulative_type == BIGINT || $last_cumulative_type == INT) {
/* Convert $last_cumulative_size from int to decimal format */
$size = PMA_getDecimalSize($cell);
if ($size[M] >= $last_cumulative_size) {
return $size[FULL];
} else {
@ -638,7 +638,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
elseif (! isset($last_cumulative_type) || $last_cumulative_type == NONE) {
/* First row of the column */
$size = PMA_getDecimalSize($cell);
return $size[FULL];
}
/**
@ -648,7 +648,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
/**
* TODO: Handle this MUCH more elegantly
*/
return -1;
}
}
@ -674,7 +674,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
$oldD = PMA_getD($last_cumulative_size);
$oldInt = $oldM - $oldD;
$newInt = strlen((string)$cell);
/* See which has the larger integer length */
if ($oldInt >= $newInt) {
/* Use old decimal size */
@ -707,7 +707,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
/**
* TODO: Handle this MUCH more elegantly
*/
return -1;
}
}
@ -718,7 +718,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
/**
* TODO: Handle this MUCH more elegantly
*/
return -1;
}
}
@ -747,7 +747,7 @@ function PMA_detectType($last_cumulative_type, &$cell) {
* If numeric, determine if decimal, int or bigint
* Else, we call it varchar for simplicity
*/
if (! strcmp('NULL', $cell)) {
if ($last_cumulative_type === NULL || $last_cumulative_type == NONE) {
return NONE;
@ -807,7 +807,7 @@ function PMA_analyzeTable(&$table) {
for ($i = 0; $i < $numCols; ++$i) {
$sizes[$i] = 0;
}
/* Initialize $types to NONE */
for ($i = 0; $i < $numCols; ++$i) {
$types[$i] = NONE;
@ -816,7 +816,7 @@ function PMA_analyzeTable(&$table) {
/* Temp vars */
$curr_type = NONE;
$curr_size = 0;
/* If the passed array is not of the correct form, do not process it */
if (is_array($table) && ! is_array($table[TBL_NAME]) && is_array($table[COL_NAMES]) && is_array($table[ROWS])) {
/* Analyze each column */
@ -827,7 +827,7 @@ function PMA_analyzeTable(&$table) {
$curr_type = PMA_detectType($types[$i], $table[ROWS][$j][$i]);
/* Determine size of the current cell */
$sizes[$i] = PMA_detectSize($sizes[$i], $types[$i], $curr_type, $table[ROWS][$j][$i]);
/**
* If a type for this column has already been declared,
* only alter it if it was a number and a varchar was found
@ -851,7 +851,7 @@ function PMA_analyzeTable(&$table) {
}
}
}
/* Check to ensure that all types are valid */
$len = count($types);
for ($n = 0; $n < $len; ++$n) {
@ -860,7 +860,7 @@ function PMA_analyzeTable(&$table) {
$sizes[$n] = '10';
}
}
return array($types, $sizes);
}
else
@ -868,7 +868,7 @@ function PMA_analyzeTable(&$table) {
/**
* TODO: Handle this better
*/
return false;
}
}
@ -913,38 +913,38 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
} else {
$collation = "utf8_general_ci";
}
if (isset($options['db_charset']) && ! is_null($options['db_charset'])) {
$charset = $options['db_charset'];
} else {
$charset = "utf8";
}
if (isset($options['create_db'])) {
$create_db = $options['create_db'];
} else {
$create_db = true;
}
/* Create SQL code to handle the database */
$sql = array();
if ($create_db) {
$sql[] = "CREATE DATABASE IF NOT EXISTS " . PMA_backquote($db_name) . " DEFAULT CHARACTER SET " . $charset . " COLLATE " . $collation;
}
/**
* The calling plug-in should include this statement, if necessary, in the $additional_sql parameter
*
* $sql[] = "USE " . PMA_backquote($db_name);
*/
/* Execute the SQL statements create above */
$sql_len = count($sql);
for ($i = 0; $i < $sql_len; ++$i) {
PMA_importRunQuery($sql[$i], $sql[$i]);
}
/* No longer needed */
unset($sql);
@ -952,7 +952,7 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
if ($additional_sql != NULL) {
/* Clean the SQL first */
$additional_sql_len = count($additional_sql);
/**
* Only match tables for now, because CREATE IF NOT EXISTS
* syntax is lacking or nonexisting for views, triggers,
@ -966,7 +966,7 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
*/
$pattern = '/CREATE .*(TABLE)/';
$replacement = 'CREATE \\1 IF NOT EXISTS';
/* Change CREATE statements to CREATE IF NOT EXISTS to support inserting into existing structures */
for ($i = 0; $i < $additional_sql_len; ++$i) {
$additional_sql[$i] = preg_replace($pattern, $replacement, $additional_sql[$i]);
@ -977,12 +977,12 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
if ($analyses != NULL) {
$type_array = array(NONE => "NULL", VARCHAR => "varchar", INT => "int", DECIMAL => "decimal", BIGINT => "bigint");
/* TODO: Do more checking here to make sure they really are matched */
if (count($tables) != count($analyses)) {
exit();
}
/* Create SQL code to create the tables */
$tempSQLStr = "";
$num_tables = count($tables);
@ -994,15 +994,15 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
if ((int)$size == 0) {
$size = 10;
}
$tempSQLStr .= PMA_backquote($tables[$i][COL_NAMES][$j]) . " " . $type_array[$analyses[$i][TYPES][$j]] . "(" . $size . ")";
if ($j != (count($tables[$i][COL_NAMES]) - 1)) {
$tempSQLStr .= ", ";
}
}
$tempSQLStr .= ") ENGINE=MyISAM DEFAULT CHARACTER SET " . $charset . " COLLATE " . $collation . ";";
/**
* Each SQL statement is executed immediately
* after it is formed so that we don't have
@ -1011,7 +1011,7 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
PMA_importRunQuery($tempSQLStr, $tempSQLStr);
}
}
/**
* Create the SQL statements to insert all the data
*
@ -1023,65 +1023,65 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
for ($i = 0; $i < $num_tables; ++$i) {
$num_cols = count($tables[$i][COL_NAMES]);
$num_rows = count($tables[$i][ROWS]);
$tempSQLStr = "INSERT INTO " . PMA_backquote($db_name) . '.' . PMA_backquote($tables[$i][TBL_NAME]) . " (";
for ($m = 0; $m < $num_cols; ++$m) {
$tempSQLStr .= PMA_backquote($tables[$i][COL_NAMES][$m]);
if ($m != ($num_cols - 1)) {
$tempSQLStr .= ", ";
}
}
$tempSQLStr .= ") VALUES ";
for ($j = 0; $j < $num_rows; ++$j) {
$tempSQLStr .= "(";
for ($k = 0; $k < $num_cols; ++$k) {
if ($analyses != NULL) {
$is_varchar = ($analyses[$i][TYPES][$col_count] === VARCHAR);
} else {
$is_varchar = !is_numeric($tables[$i][ROWS][$j][$k]);
}
/* Don't put quotes around NULL fields */
if (! strcmp($tables[$i][ROWS][$j][$k], 'NULL')) {
$is_varchar = false;
}
$tempSQLStr .= (($is_varchar) ? "'" : "");
$tempSQLStr .= PMA_sqlAddslashes((string)$tables[$i][ROWS][$j][$k]);
$tempSQLStr .= (($is_varchar) ? "'" : "");
if ($k != ($num_cols - 1)) {
$tempSQLStr .= ", ";
}
if ($col_count == ($num_cols - 1)) {
$col_count = 0;
} else {
$col_count++;
}
/* Delete the cell after we are done with it */
unset($tables[$i][ROWS][$j][$k]);
}
$tempSQLStr .= ")";
if ($j != ($num_rows - 1)) {
$tempSQLStr .= ",\n ";
}
$col_count = 0;
/* Delete the row after we are done with it */
unset($tables[$i][ROWS][$j]);
}
$tempSQLStr .= ";";
/**
* Each SQL statement is executed immediately
* after it is formed so that we don't have
@ -1089,32 +1089,32 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
*/
PMA_importRunQuery($tempSQLStr, $tempSQLStr);
}
/* No longer needed */
unset($tempSQLStr);
/**
* A work in progress
*/
/* Add the viewable structures from $additional_sql to $tables so they are also displayed */
$view_pattern = '@VIEW `[^`]+`\.`([^`]+)@';
$table_pattern = '@CREATE TABLE IF NOT EXISTS `([^`]+)`@';
/* Check a third pattern to make sure its not a "USE `db_name`;" statement */
$regs = array();
$inTables = false;
$additional_sql_len = count($additional_sql);
for ($i = 0; $i < $additional_sql_len; ++$i) {
preg_match($view_pattern, $additional_sql[$i], $regs);
if (count($regs) == 0) {
preg_match($table_pattern, $additional_sql[$i], $regs);
}
if (count($regs)) {
for ($n = 0; $n < $num_tables; ++$n) {
if (!strcmp($regs[1], $tables[$n][TBL_NAME])) {
@ -1122,21 +1122,21 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
break;
}
}
if (!$inTables) {
$tables[] = array(TBL_NAME => $regs[1]);
}
}
/* Reset the array */
$regs = array();
$inTables = false;
}
$params = array('db' => (string)$db_name);
$db_url = 'db_structure.php' . PMA_generate_common_url($params);
$db_ops_url = 'db_operations.php' . PMA_generate_common_url($params);
$message = '<br /><br />';
$message .= '<strong>' . __('The following structures have either been created or altered. Here you can:') . '</strong><br />';
$message .= '<ul><li>' . __('View a structure`s contents by clicking on its name') . '</li>';
@ -1148,11 +1148,11 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
$db_name,
$db_ops_url,
__('Edit') . ' ' . PMA_backquote($db_name) . ' ' . __('settings'));
$message .= '<ul>';
unset($params);
$num_tables = count($tables);
for ($i = 0; $i < $num_tables; ++$i)
{
@ -1160,9 +1160,9 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
$tbl_url = 'sql.php' . PMA_generate_common_url($params);
$tbl_struct_url = 'tbl_structure.php' . PMA_generate_common_url($params);
$tbl_ops_url = 'tbl_operations.php' . PMA_generate_common_url($params);
unset($params);
if (! PMA_isView($db_name, $tables[$i][TBL_NAME])) {
$message .= sprintf('<li><a href="%s" title="%s">%s</a> (<a href="%s" title="%s">' . __('Structure') . '</a>) (<a href="%s" title="%s">' . __('Options') . '</a>)</li>',
$tbl_url,
@ -1179,12 +1179,12 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = NULL, &$additional_sql =
$tables[$i][TBL_NAME]);
}
}
$message .= '</ul></ul>';
global $import_notice;
$import_notice = $message;
unset($tables);
}

View File

@ -186,22 +186,14 @@ class PMA_Export_Relation_Schema
* @param string type Schema Type
* @param string error_message the error mesage
* @global array the PMA configuration array
* @global integer the current server id
* @global string the current language
* @global string the charset to convert to
* @global string the current database name
* @global string the current charset
* @global string the current text direction
* @global string a localized string
* @global string an other localized string
* @access public
* @return void
*/
function dieSchema($pageNumber, $type = '', $error_message = '')
{
global $cfg;
global $server, $lang, $convcharset, $db;
global $charset, $text_dir;
global $db;
require_once './libraries/header.inc.php';
echo "<p><strong>" . __("SCHEMA ERROR: ") . $type ."</strong></p>" . "\n";

View File

@ -478,9 +478,6 @@ if (! function_exists('__')) {
die('Bad invocation!');
}
/* We use only utf-8 */
$charset = 'utf-8';
/* l10n: Text direction, use either ltr or rtl */
$GLOBALS['text_dir'] = __('ltr');

View File

@ -464,7 +464,6 @@ function PMA_sqlQueryFormBookmark()
* @uses $GLOBALS['cfg']['BZipDump']
* @uses $GLOBALS['cfg']['UploadDir']
* @uses $GLOBALS['cfg']['AvailableCharsets']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['max_upload_size']
* @uses PMA_supportedDecompressions()
* @uses PMA_getFileSelectOptions()

View File

@ -28,7 +28,7 @@ $GLOBALS['PMA_allow_mbstr'] = @function_exists('mb_strlen');
$GLOBALS['PMA_allow_ctype'] = @extension_loaded('ctype');
if ($GLOBALS['PMA_allow_mbstr']) {
mb_internal_encoding($GLOBALS['charset']);
mb_internal_encoding('utf-8');
}
/**

View File

@ -95,7 +95,7 @@ $is_backup = ($action != 'tbl_create.php' && $action != 'tbl_addfield.php');
$header_cells = array();
$content_cells = array();
$header_cells[] = __('Column');
$header_cells[] = __('Name');
$header_cells[] = __('Type')
. ($GLOBALS['cfg']['ReplaceHelpImg']
? PMA_showMySQLDocu('SQL-Syntax', 'data-types')

View File

@ -168,8 +168,8 @@ if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
echo ' <li id="li_select_mysql_charset">';
echo ' ' . __('MySQL charset') . ': '
. ' <span xml:lang="en" dir="ltr">'
. ' ' . $mysql_charsets_descriptions[$mysql_charset_map[strtolower($charset)]] . "\n"
. ' (' . $mysql_charset_map[strtolower($charset)] . ')' . "\n"
. ' ' . $mysql_charsets_descriptions[$mysql_charset_map['utf-8']] . "\n"
. ' (' . $mysql_charset_map['utf-8'] . ')' . "\n"
. ' </span>' . "\n"
. ' </li>' . "\n";
echo ' </ul>';

View File

@ -11,7 +11,6 @@
* @uses $GLOBALS['available_languages']
* @uses $GLOBALS['lang']
* @uses $GLOBALS['text_dir']
* @uses $GLOBALS['charset']
* @uses $GLOBALS['pmaThemeImage']
* @uses $GLOBALS['cfg']['LeftFrameLight']
* @uses $GLOBALS['cfg']['ShowTooltip']
@ -118,7 +117,7 @@ require_once './libraries/header_http.inc.php';
* Displays the frame
*/
// xml declaration moves IE into quirks mode, making much trouble with CSS
/* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
/* echo '<?xml version="1.0" encoding="utf-8"?>'; */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -131,16 +130,17 @@ require_once './libraries/header_http.inc.php';
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type"
content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base target="frame_content" />
<link rel="stylesheet" type="text/css"
href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
<script src="./js/jquery/jquery-1.6.1.js" type="text/javascript"></script>
<script src="./js/jquery/jquery-ui-1.8.custom.js" type="text/javascript"></script>
<script type="text/javascript" src="js/navigation.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="js/messages.php"></script>
<?php
echo PMA_includeJS('jquery/jquery-1.6.1.js');
echo PMA_includeJS('jquery/jquery-ui-1.8.custom.js');
echo PMA_includeJS('navigation.js');
echo PMA_includeJS('functions.js');
echo PMA_includeJS('messages.php');
?>
<script type="text/javascript">
// <![CDATA[
var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';

View File

@ -22,7 +22,7 @@ $hidden = "hidden";
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][1]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="pmd/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="pmd/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css" />

View File

@ -12,11 +12,7 @@ require_once 'pmd_common.php';
?>
<html>
<head>
<?php if(0){ ?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link rel="stylesheet" type="text/css" href="./libraries/pmd/styles/default/style1.css">
<?php } ?>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./libraries/pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
<title>Designer</title>
</head>

View File

@ -91,7 +91,7 @@ if (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) &&
function PMD_return_new($b,$ret)
{
global $db,$T1,$F1,$T2,$F2;
header("Content-Type: text/xml; charset=utf-8");//utf-8 .$_GLOBALS['charset']
header("Content-Type: text/xml; charset=utf-8");
header("Cache-Control: no-cache");
die('<root act="relation_new" return="'.$ret.'" b="'.$b.
'" DB1="'.urlencode($db).

599
po/af.po

File diff suppressed because it is too large Load Diff

611
po/ar.po

File diff suppressed because it is too large Load Diff

599
po/az.po

File diff suppressed because it is too large Load Diff

607
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

609
po/bg.po

File diff suppressed because it is too large Load Diff

611
po/bn.po

File diff suppressed because it is too large Load Diff

599
po/bs.po

File diff suppressed because it is too large Load Diff

629
po/ca.po

File diff suppressed because it is too large Load Diff

629
po/cs.po

File diff suppressed because it is too large Load Diff

603
po/cy.po

File diff suppressed because it is too large Load Diff

607
po/da.po

File diff suppressed because it is too large Load Diff

629
po/de.po

File diff suppressed because it is too large Load Diff

633
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

619
po/es.po

File diff suppressed because it is too large Load Diff

599
po/et.po

File diff suppressed because it is too large Load Diff

599
po/eu.po

File diff suppressed because it is too large Load Diff

615
po/fa.po

File diff suppressed because it is too large Load Diff

622
po/fi.po

File diff suppressed because it is too large Load Diff

636
po/fr.po

File diff suppressed because it is too large Load Diff

626
po/gl.po

File diff suppressed because it is too large Load Diff

599
po/he.po

File diff suppressed because it is too large Load Diff

617
po/hi.po

File diff suppressed because it is too large Load Diff

611
po/hr.po

File diff suppressed because it is too large Load Diff

635
po/hu.po

File diff suppressed because it is too large Load Diff

607
po/id.po

File diff suppressed because it is too large Load Diff

625
po/it.po

File diff suppressed because it is too large Load Diff

622
po/ja.po

File diff suppressed because it is too large Load Diff

634
po/ka.po

File diff suppressed because it is too large Load Diff

607
po/ko.po

File diff suppressed because it is too large Load Diff

627
po/lt.po

File diff suppressed because it is too large Load Diff

603
po/lv.po

File diff suppressed because it is too large Load Diff

599
po/mk.po

File diff suppressed because it is too large Load Diff

599
po/ml.po

File diff suppressed because it is too large Load Diff

611
po/mn.po

File diff suppressed because it is too large Load Diff

599
po/ms.po

File diff suppressed because it is too large Load Diff

622
po/nb.po

File diff suppressed because it is too large Load Diff

621
po/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

634
po/pl.po

File diff suppressed because it is too large Load Diff

607
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

607
po/ro.po

File diff suppressed because it is too large Load Diff

782
po/ru.po

File diff suppressed because it is too large Load Diff

613
po/si.po

File diff suppressed because it is too large Load Diff

639
po/sk.po

File diff suppressed because it is too large Load Diff

639
po/sl.po

File diff suppressed because it is too large Load Diff

599
po/sq.po

File diff suppressed because it is too large Load Diff

607
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

625
po/sv.po

File diff suppressed because it is too large Load Diff

599
po/ta.po

File diff suppressed because it is too large Load Diff

601
po/te.po

File diff suppressed because it is too large Load Diff

603
po/th.po

File diff suppressed because it is too large Load Diff

666
po/tr.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More