Merge remote branch 'phpmyadmin/master'
This commit is contained in:
commit
459b57ca57
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,3 +29,5 @@ locale
|
||||
sources
|
||||
# API documentation
|
||||
apidoc
|
||||
# Demo server
|
||||
revision-info.php
|
||||
|
||||
34
ChangeLog
34
ChangeLog
@ -1,7 +1,36 @@
|
||||
phpMyAdmin - ChangeLog
|
||||
======================
|
||||
|
||||
3.4.0.0 (not yet released)
|
||||
3.5.0.0 (not yet released)
|
||||
+ rfe #2021981 [interface] Add support for mass prefix change.
|
||||
+ "up to date" message on main page when current version is up to date
|
||||
+ Update to jQuery 1.6.1
|
||||
+ Patch #3256122 [search] Show/hide db search results
|
||||
+ Patch #3302354 Add gettext wrappers around a message
|
||||
+ Remove deprecated function PMA_DBI_get_fields
|
||||
|
||||
3.4.2.0 (not yet released)
|
||||
- bug #3301249 [interface] Iconic table operations does not remove inline edit label
|
||||
- bug #3303869 [interface] Unnecessary scrolling on Databases page
|
||||
- patch #3303813 [setup] Define a label that was missing
|
||||
- bug #3305606 [interface] Show all button wraps on privileges page
|
||||
- bug #3305517 [config] Config for export compression not used
|
||||
- bug #3305883 [interface] Table is dropped regardless of confirmation
|
||||
- [auth] Fixed error handling for signon auth method.
|
||||
- bug #3276001 [core] Avoid caching of index.php.
|
||||
- bug #3306958 [interface] Unnecessary Details slider
|
||||
|
||||
3.4.1.0 (2011-05-20)
|
||||
- bug #3301108 [interface] Synchronize and already configured host
|
||||
- bug #3302457 Inline edit and $cfg['PropertiesIconic']
|
||||
- Patch #3302313 Show a translated label
|
||||
- bug #3300981 [navi] Table filter is case sensitive
|
||||
- bug #3285929 [privileges] Revert temporary fix
|
||||
- bug #3302872 [synchronize] Synchronize and user name
|
||||
- bug #3302733 [core] Some browsers report an insecure https connection
|
||||
- [security] Make redirector require valid token
|
||||
|
||||
3.4.0.0 (2011-05-11)
|
||||
+ rfe #2890226 [view] Enable VIEW rename
|
||||
+ rfe #838637 [privileges] Export a user's privileges
|
||||
- [core] Updated mootools to fix some glitches with Safari.
|
||||
@ -158,6 +187,9 @@
|
||||
|
||||
3.3.11.0 (not yet released)
|
||||
|
||||
3.3.10.1 (2011-05-20)
|
||||
- [security] XSS on Tracking page
|
||||
|
||||
3.3.10.0 (2011-03-19)
|
||||
- patch #3147400 [structure] Aria table size printed as unknown,
|
||||
thanks to erickoh75 - erickoh75
|
||||
|
||||
@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
|
||||
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>phpMyAdmin 3.4.0-rc3-dev - Documentation</title>
|
||||
<title>phpMyAdmin 3.5.0-dev - Documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="docs.css" />
|
||||
</head>
|
||||
|
||||
@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
|
||||
<div id="header">
|
||||
<h1>
|
||||
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
|
||||
3.4.0-rc3-dev
|
||||
3.5.0-dev
|
||||
Documentation
|
||||
</h1>
|
||||
</div>
|
||||
@ -1054,6 +1054,29 @@ ALTER TABLE `pma_column_comments`
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt id="recent">
|
||||
<span id="cfg_Servers_recent">$cfg['Servers'][$i]['recent']</span> string
|
||||
</dt>
|
||||
<dd>
|
||||
Since release 3.5.0 you can show recently used tables in the left navigation frame.
|
||||
It helps you to jump across table directly, without the need to select the database,
|
||||
and then select the table. Using
|
||||
<a href="#cfg_LeftRecentTable" class="configrule">$cfg['LeftRecentTable']</a>
|
||||
you can configure the maximum number of recent tables shown. When you select a table
|
||||
from the list, it will jump to the page specified in
|
||||
<a href="#cfg_LeftDefaultTabTable" class="configrule">$cfg['LeftDefaultTabTable']</a>.<br/><br/>
|
||||
|
||||
Without configuring the storage, you can still access the recently used tables,
|
||||
but it will disappear after you logout.<br/><br/>
|
||||
|
||||
To allow the usage of this functionality:
|
||||
|
||||
<ul>
|
||||
<li>set up <a href="#pmadb">pmadb</a> and the phpMyAdmin configuration storage</li>
|
||||
<li>put the table name in <tt>$cfg['Servers'][$i]['recent']</tt> (e.g. 'pma_recent')</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt id="tracking">
|
||||
<span id="cfg_Servers_tracking">$cfg['Servers'][$i]['tracking']</span> string
|
||||
</dt>
|
||||
@ -1280,6 +1303,8 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
||||
</dd>
|
||||
<dt><span id="cfg_Servers_SignonSession">$cfg['Servers'][$i]['SignonSession']</span> string</dt>
|
||||
<dd>Name of session which will be used for signon authentication method.
|
||||
You should use something different than <code>phpMyAdmin</code>, because
|
||||
this is session which phpMyAdmin uses internally.
|
||||
</dd>
|
||||
<dt><span id="cfg_Servers_SignonURL">$cfg['Servers'][$i]['SignonURL']</span> string</dt>
|
||||
<dd>URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol.
|
||||
@ -1467,6 +1492,10 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
||||
<dd>Defines how many sublevels should be displayed when splitting
|
||||
up tables by the above separator.</dd>
|
||||
|
||||
<dt id="cfg_LeftRecentTable">$cfg['LeftRecentTable'] integer</dt>
|
||||
<dd>The maximum number of recently used tables shown in the left navigation
|
||||
frame. Set this to 0 (zero) to disable the listing of recent tables.</dd>
|
||||
|
||||
<dt id="cfg_ShowTooltip">$cfg['ShowTooltip'] boolean</dt>
|
||||
<dd>Defines whether to display table comment as tool-tip in left frame or
|
||||
not.</dd>
|
||||
|
||||
2
README
2
README
@ -1,7 +1,7 @@
|
||||
phpMyAdmin - Readme
|
||||
===================
|
||||
|
||||
Version 3.4.0-rc3-dev
|
||||
Version 3.5.0-dev
|
||||
|
||||
A set of PHP-scripts to manage MySQL over the web.
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE
|
||||
|
||||
$override_total = TRUE;
|
||||
|
||||
if (!isset($pos)) {
|
||||
if (! isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
|
||||
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
|
||||
// $cfg['Servers'][$i]['history'] = 'pma_history';
|
||||
// $cfg['Servers'][$i]['recent'] = 'pma_recent';
|
||||
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
|
||||
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
|
||||
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
if (!isset($selected_tbl)) {
|
||||
if (! isset($selected_tbl)) {
|
||||
require_once './libraries/header.inc.php';
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||
if ($zerofill) {
|
||||
$attribute = 'UNSIGNED ZEROFILL';
|
||||
}
|
||||
if (!isset($row['Default'])) {
|
||||
if (! isset($row['Default'])) {
|
||||
if ($row['Null'] != 'NO') {
|
||||
$row['Default'] = '<i>NULL</i>';
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
||||
$move = false;
|
||||
}
|
||||
|
||||
if (!isset($newname) || !strlen($newname)) {
|
||||
if (! isset($newname) || ! strlen($newname)) {
|
||||
$message = PMA_Message::error(__('The database name is empty!'));
|
||||
} else {
|
||||
$sql_query = ''; // in case target db exists
|
||||
@ -561,7 +561,7 @@ echo __('Remove database');
|
||||
. '</form></div>' . "\n";
|
||||
|
||||
if ($num_tables > 0
|
||||
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
&& ! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
$message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'));
|
||||
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
|
||||
$message->addParam('</a>', false);
|
||||
|
||||
@ -52,7 +52,7 @@ if ($cfg['SkipLockedTables'] == true) {
|
||||
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||
if ($result != false && PMA_DBI_num_rows($result) > 0) {
|
||||
while ($tmp = PMA_DBI_fetch_row($result)) {
|
||||
if (!isset($sot_cache[$tmp[0]])) {
|
||||
if (! isset($sot_cache[$tmp[0]])) {
|
||||
$sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\';');
|
||||
$sts_tmp = PMA_DBI_fetch_assoc($sts_result);
|
||||
$tables[] = $sts_tmp;
|
||||
|
||||
12
db_qbe.php
12
db_qbe.php
@ -105,7 +105,7 @@ if (0 == $tbl_result_cnt) {
|
||||
|
||||
// The tables list gets from MySQL
|
||||
while (list($tbl) = PMA_DBI_fetch_row($tbl_result)) {
|
||||
$fld_results = PMA_DBI_get_fields($db, $tbl);
|
||||
$fld_results = PMA_DBI_get_columns($db, $tbl, true);
|
||||
|
||||
if (empty($tbl_names[$tbl]) && !empty($_REQUEST['TableList'])) {
|
||||
$tbl_names[$tbl] = '';
|
||||
@ -339,7 +339,7 @@ for ($x = 0; $x < $col; $x++) {
|
||||
if (isset($criteria[$x])) {
|
||||
$tmp_criteria = $criteria[$x];
|
||||
}
|
||||
if ((empty($prev_criteria) || !isset($prev_criteria[$x]))
|
||||
if ((empty($prev_criteria) || ! isset($prev_criteria[$x]))
|
||||
|| $prev_criteria[$x] != htmlspecialchars($tmp_criteria)) {
|
||||
$curCriteria[$z] = $tmp_criteria;
|
||||
} else {
|
||||
@ -497,7 +497,7 @@ for ($y = 0; $y <= $row; $y++) {
|
||||
|
||||
echo "\n";
|
||||
$or = 'Or' . $y;
|
||||
if (!isset(${$or})) {
|
||||
if (! isset(${$or})) {
|
||||
${$or} = '';
|
||||
}
|
||||
if (!empty(${$or}) && isset(${$or}[$x])) {
|
||||
@ -667,7 +667,7 @@ foreach ($tbl_names as $key => $val) {
|
||||
<?php
|
||||
// 1. SELECT
|
||||
$last_select = 0;
|
||||
if (!isset($qry_select)) {
|
||||
if (! isset($qry_select)) {
|
||||
$qry_select = '';
|
||||
}
|
||||
for ($x = 0; $x < $col; $x++) {
|
||||
@ -892,7 +892,7 @@ if ($criteria_cnt > 1) {
|
||||
$qry_where = '(' . $qry_where . ')';
|
||||
}
|
||||
// OR rows ${'cur' . $or}[$x]
|
||||
if (!isset($curAndOrRow)) {
|
||||
if (! isset($curAndOrRow)) {
|
||||
$curAndOrRow = array();
|
||||
}
|
||||
for ($y = 0; $y <= $row; $y++) {
|
||||
@ -929,7 +929,7 @@ if (!empty($qry_where) && $qry_where != '()') {
|
||||
|
||||
// 4. ORDER BY
|
||||
$last_orderby = 0;
|
||||
if (!isset($qry_orderby)) {
|
||||
if (! isset($qry_orderby)) {
|
||||
$qry_orderby = '';
|
||||
}
|
||||
for ($x = 0; $x < $col; $x++) {
|
||||
|
||||
@ -518,6 +518,12 @@ if (!$db_is_information_schema) {
|
||||
. __('Repair table') . '</option>' . "\n";
|
||||
echo ' <option value="analyze_tbl" >'
|
||||
. __('Analyze table') . '</option>' . "\n";
|
||||
echo ' <option value="add_prefix_tbl" >'
|
||||
. __('Add prefix to table') . '</option>' . "\n";
|
||||
echo ' <option value="replace_prefix_tbl" >'
|
||||
. __('Replace table prefix') . '</option>' . "\n";
|
||||
echo ' <option value="copy_tbl_change_prefix" >'
|
||||
. __('Copy table with prefix') . '</option>' . "\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
@ -21,7 +21,7 @@ $export_list = PMA_getPlugins('./libraries/export/', array('export_type' => $exp
|
||||
$type = $what;
|
||||
|
||||
// Check export type
|
||||
if (!isset($export_list[$type])) {
|
||||
if (! isset($export_list[$type])) {
|
||||
die('Bad type!');
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ if ($export_type == 'server') {
|
||||
// Walk over databases
|
||||
foreach ($GLOBALS['pma']->databases as $current_db) {
|
||||
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
|
||||
|| !isset($tmp_select)) {
|
||||
|| ! isset($tmp_select)) {
|
||||
if (!PMA_exportDBHeader($current_db)) {
|
||||
break 2;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ if ($import_file != 'none' && !$error) {
|
||||
$error = TRUE;
|
||||
}
|
||||
} elseif (!$error) {
|
||||
if (!isset($import_text) || empty($import_text)) {
|
||||
if (! isset($import_text) || empty($import_text)) {
|
||||
$message = PMA_Message::error(__('No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See [a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a].'));
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
|
||||
|
||||
|
||||
// start output
|
||||
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
|
||||
include ('./libraries/header_http.inc.php');
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
@ -153,7 +153,7 @@ header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
|
||||
// ]]>
|
||||
</script>
|
||||
<?php
|
||||
echo PMA_includeJS('jquery/jquery-1.4.4.js');
|
||||
echo PMA_includeJS('jquery/jquery-1.6.1.js');
|
||||
echo PMA_includeJS('update-location.js');
|
||||
echo PMA_includeJS('common.js');
|
||||
?>
|
||||
|
||||
75
js/config.js
75
js/config.js
@ -1,3 +1,4 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Functions used in configuration forms and on user preferences pages
|
||||
*/
|
||||
@ -14,9 +15,9 @@ var PMA_messages = {};
|
||||
* @param {Element} field
|
||||
*/
|
||||
function getFieldType(field) {
|
||||
field = $(field);
|
||||
var tagName = field.attr('tagName');
|
||||
if (tagName == 'INPUT') {
|
||||
field = $(field);
|
||||
var tagName = field.prop('tagName');
|
||||
if (tagName == 'INPUT') {
|
||||
return field.attr('type');
|
||||
} else if (tagName == 'SELECT') {
|
||||
return 'select';
|
||||
@ -40,7 +41,7 @@ function getFieldType(field) {
|
||||
* @param {String|Boolean} [value]
|
||||
*/
|
||||
function setFieldValue(field, field_type, value) {
|
||||
field = $(field);
|
||||
field = $(field);
|
||||
switch (field_type) {
|
||||
case 'text':
|
||||
field.attr('value', (value != undefined ? value : field.attr('defaultValue')));
|
||||
@ -50,14 +51,14 @@ function setFieldValue(field, field_type, value) {
|
||||
break;
|
||||
case 'select':
|
||||
var options = field.attr('options');
|
||||
var i, imax = options.length;
|
||||
var i, imax = options.length;
|
||||
if (value == undefined) {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = options[i].defaultSelected;
|
||||
options[i].selected = options[i].defaultSelected;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = (value.indexOf(options[i].value) != -1);
|
||||
options[i].selected = (value.indexOf(options[i].value) != -1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -78,14 +79,14 @@ function setFieldValue(field, field_type, value) {
|
||||
* @type Boolean|String|String[]
|
||||
*/
|
||||
function getFieldValue(field, field_type) {
|
||||
field = $(field);
|
||||
field = $(field);
|
||||
switch (field_type) {
|
||||
case 'text':
|
||||
return field.attr('value');
|
||||
return field.prop('value');
|
||||
case 'checkbox':
|
||||
return field.attr('checked');
|
||||
return field.prop('checked');
|
||||
case 'select':
|
||||
var options = field.attr('options');
|
||||
var options = field.prop('options');
|
||||
var i, imax = options.length, items = [];
|
||||
for (i = 0; i < imax; i++) {
|
||||
if (options[i].selected) {
|
||||
@ -354,7 +355,7 @@ function displayErrors(error_list) {
|
||||
* @param {Object} errors
|
||||
*/
|
||||
function validate_fieldset(fieldset, isKeyUp, errors) {
|
||||
fieldset = $(fieldset);
|
||||
fieldset = $(fieldset);
|
||||
if (fieldset.length && typeof validators._fieldset[fieldset.attr('id')] != 'undefined') {
|
||||
var fieldset_errors = validators._fieldset[fieldset.attr('id')].apply(fieldset[0], [isKeyUp]);
|
||||
for (var field_id in fieldset_errors) {
|
||||
@ -377,8 +378,8 @@ function validate_fieldset(fieldset, isKeyUp, errors) {
|
||||
* @param {Object} errors
|
||||
*/
|
||||
function validate_field(field, isKeyUp, errors) {
|
||||
field = $(field);
|
||||
var field_id = field.attr('id');
|
||||
field = $(field);
|
||||
var field_id = field.attr('id');
|
||||
errors[field_id] = [];
|
||||
var functions = getFieldValidators(field_id, isKeyUp);
|
||||
for (var i = 0; i < functions.length; i++) {
|
||||
@ -389,7 +390,7 @@ function validate_field(field, isKeyUp, errors) {
|
||||
var result = functions[i][0].apply(field[0], args);
|
||||
if (result !== true) {
|
||||
if (typeof result == 'string') {
|
||||
result = [result];
|
||||
result = [result];
|
||||
}
|
||||
$.merge(errors[field_id], result);
|
||||
}
|
||||
@ -403,7 +404,7 @@ function validate_field(field, isKeyUp, errors) {
|
||||
* @param {boolean} isKeyUp
|
||||
*/
|
||||
function validate_field_and_fieldset(field, isKeyUp) {
|
||||
field = $(field);
|
||||
field = $(field);
|
||||
var errors = {};
|
||||
validate_field(field, isKeyUp, errors);
|
||||
validate_fieldset(field.closest('fieldset'), isKeyUp, errors);
|
||||
@ -416,7 +417,7 @@ function validate_field_and_fieldset(field, isKeyUp) {
|
||||
* @param {Element} field
|
||||
*/
|
||||
function markField(field) {
|
||||
field = $(field);
|
||||
field = $(field);
|
||||
var type = getFieldType(field);
|
||||
var isDefault = checkFieldDefault(field, type);
|
||||
|
||||
@ -439,7 +440,7 @@ function setRestoreDefaultBtn(field, display) {
|
||||
|
||||
$(function() {
|
||||
// register validators and mark custom values
|
||||
var elements = $('input[id], select[id], textarea[id]');
|
||||
var elements = $('input[id], select[id], textarea[id]');
|
||||
$('input[id], select[id], textarea[id]').each(function(){
|
||||
markField(this);
|
||||
var el = $(this);
|
||||
@ -450,35 +451,35 @@ $(function() {
|
||||
var tagName = el.attr('tagName');
|
||||
// text fields can be validated after each change
|
||||
if (tagName == 'INPUT' && el.attr('type') == 'text') {
|
||||
el.keyup(function() {
|
||||
el.keyup(function() {
|
||||
validate_field_and_fieldset(el, true);
|
||||
markField(el);
|
||||
});
|
||||
}
|
||||
// disable textarea spellcheck
|
||||
if (tagName == 'TEXTAREA') {
|
||||
el.attr('spellcheck', false);
|
||||
el.attr('spellcheck', false);
|
||||
}
|
||||
});
|
||||
|
||||
// check whether we've refreshed a page and browser remembered modified
|
||||
// form values
|
||||
var check_page_refresh = $('#check_page_refresh');
|
||||
if (check_page_refresh.length == 0 || check_page_refresh.val() == '1') {
|
||||
// run all field validators
|
||||
var errors = {};
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
validate_field(elements[i], false, errors);
|
||||
}
|
||||
// run all fieldset validators
|
||||
$('fieldset').each(function(){
|
||||
validate_fieldset(this, false, errors);
|
||||
});
|
||||
// check whether we've refreshed a page and browser remembered modified
|
||||
// form values
|
||||
var check_page_refresh = $('#check_page_refresh');
|
||||
if (check_page_refresh.length == 0 || check_page_refresh.val() == '1') {
|
||||
// run all field validators
|
||||
var errors = {};
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
validate_field(elements[i], false, errors);
|
||||
}
|
||||
// run all fieldset validators
|
||||
$('fieldset').each(function(){
|
||||
validate_fieldset(this, false, errors);
|
||||
});
|
||||
|
||||
displayErrors(errors);
|
||||
} else if (check_page_refresh) {
|
||||
check_page_refresh.val('1');
|
||||
}
|
||||
displayErrors(errors);
|
||||
} else if (check_page_refresh) {
|
||||
check_page_refresh.val('1');
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
|
||||
@ -20,7 +20,7 @@ function loadResult(result_path , table_name , link , ajaxEnable){
|
||||
if(ajaxEnable)
|
||||
{
|
||||
/** Hides the results shown by the delete criteria */
|
||||
//PMA_ajaxShowMessage(PMA_messages['strBrowsing']);
|
||||
PMA_ajaxShowMessage(PMA_messages['strBrowsing']);
|
||||
$('#sqlqueryform').hide();
|
||||
$('#togglequerybox').hide();
|
||||
/** Load the browse results to the page */
|
||||
@ -51,14 +51,14 @@ function deleteResult(result_path , msg , ajaxEnable){
|
||||
/** Load the deleted option to the page*/
|
||||
$('#browse-results').load(result_path + " '"+'#result_query' + "'");
|
||||
$('#sqlqueryform').load(result_path + " '"+'#sqlqueryform' + "'");
|
||||
$('#togglequerybox').html(PMA_messages['strHideQueryBox']);
|
||||
$('#togglequerybox').html(PMA_messages['strShowQueryBox']);
|
||||
|
||||
/** Refresh the search results after the deletion */
|
||||
document.getElementById('buttonGo'). click();
|
||||
//PMA_ajaxShowMessage(PMA_messages['strDeleting']);
|
||||
PMA_ajaxShowMessage(PMA_messages['strDeleting']);
|
||||
/** Show the results of the deletion option */
|
||||
$('#browse-results').show();
|
||||
$('#sqlqueryform').show();
|
||||
$('#sqlqueryform').hide();
|
||||
$('#togglequerybox').show();
|
||||
}
|
||||
else
|
||||
@ -89,6 +89,31 @@ $(document).ready(function() {
|
||||
$('#sqlqueryform').hide();
|
||||
$('#togglequerybox').hide();
|
||||
});
|
||||
/**
|
||||
*Prepare a div containing a link for toggle the search results
|
||||
*/
|
||||
$('<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>')
|
||||
.insertAfter('#searchresults')
|
||||
/** don't show it until we have results on-screen */
|
||||
.hide();
|
||||
|
||||
$('<br class="clearfloat" />').insertAfter("#togglesearchresultsdiv").show();
|
||||
/** Changing the displayed text according to the hide/show criteria in search result forms*/
|
||||
|
||||
$('#togglesearchresultlink')
|
||||
.html(PMA_messages['strHideSearchResults'])
|
||||
.bind('click', function() {
|
||||
var $link = $(this);
|
||||
$('#searchresults').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchResults']) {
|
||||
$link.text(PMA_messages['strShowSearchResults']);
|
||||
} else {
|
||||
$link.text(PMA_messages['strHideSearchResults']);
|
||||
}
|
||||
/** avoid default click action */
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* Prepare a div containing a link for toggle the search form, otherwise it's incorrectly displayed
|
||||
* after a couple of clicks
|
||||
@ -101,7 +126,7 @@ $(document).ready(function() {
|
||||
/** Changing the displayed text according to the hide/show criteria in search form*/
|
||||
$("#togglequerybox").hide();
|
||||
$("#togglequerybox").bind('click', function() {
|
||||
var $link = $(this)
|
||||
var $link = $(this);
|
||||
$('#sqlqueryform').slideToggle("medium");
|
||||
if ($link.text() == PMA_messages['strHideQueryBox']) {
|
||||
$link.text(PMA_messages['strShowQueryBox']);
|
||||
@ -110,7 +135,7 @@ $(document).ready(function() {
|
||||
}
|
||||
/** avoid default click action */
|
||||
return false;
|
||||
})
|
||||
});
|
||||
|
||||
/** don't show it until we have results on-screen */
|
||||
|
||||
@ -149,6 +174,16 @@ $(document).ready(function() {
|
||||
// found results
|
||||
$("#searchresults").html(response);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
|
||||
$('#togglesearchresultlink')
|
||||
// always start with the Show message
|
||||
.text(PMA_messages['strHideSearchResults'])
|
||||
$('#togglesearchresultsdiv')
|
||||
// now it's time to show the div containing the link
|
||||
.show();
|
||||
$('#searchresults').show();
|
||||
|
||||
|
||||
$('#db_search_form')
|
||||
// workaround for Chrome problem (bug #3168569)
|
||||
.slideToggle()
|
||||
|
||||
134
js/functions.js
134
js/functions.js
@ -90,19 +90,23 @@ function parseVersionString (str) {
|
||||
* Indicates current available version on main page.
|
||||
*/
|
||||
function PMA_current_version() {
|
||||
var current = parseVersionString('3.4.0'/*pmaversion*/);
|
||||
var current = parseVersionString(pmaversion);
|
||||
var latest = parseVersionString(PMA_latest_version);
|
||||
$('#li_pma_version').append(PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version);
|
||||
var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version;
|
||||
if (latest > current) {
|
||||
var message = $.sprintf(PMA_messages['strNewerVersion'], PMA_latest_version, PMA_latest_date);
|
||||
if (Math.floor(latest / 10000) == Math.floor(current / 10000)) {
|
||||
/* Security update */
|
||||
klass = 'warning';
|
||||
klass = 'error';
|
||||
} else {
|
||||
klass = 'notice';
|
||||
}
|
||||
$('#maincontainer').after('<div class="' + klass + '">' + message + '</div>');
|
||||
}
|
||||
if (latest == current) {
|
||||
version_information_message = ' (' + PMA_messages['strUpToDate'] + ')';
|
||||
}
|
||||
$('#li_pma_version').append(version_information_message);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -606,7 +610,7 @@ $(document).ready(function() {
|
||||
*/
|
||||
$('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) {
|
||||
// do not trigger when clicked on anchor
|
||||
if ($(e.target).is('a, a *')) {
|
||||
if ($(e.target).is('a, img, a *')) {
|
||||
return;
|
||||
}
|
||||
// XXX: FF fires two click events for <label> (label and checkbox), so we need to handle this differently
|
||||
@ -743,21 +747,19 @@ function insertQuery(queryType) {
|
||||
valDis += "[value-" + NbSelect + "]";
|
||||
editDis += myListBox.options[i].value + "=[value-" + NbSelect + "]";
|
||||
}
|
||||
if (queryType == "selectall") {
|
||||
query = "SELECT * FROM `" + table + "` WHERE 1";
|
||||
} else if (queryType == "select") {
|
||||
query = "SELECT " + chaineAj + " FROM `" + table + "` WHERE 1";
|
||||
} else if (queryType == "insert") {
|
||||
query = "INSERT INTO `" + table + "`(" + chaineAj + ") VALUES (" + valDis + ")";
|
||||
} else if (queryType == "update") {
|
||||
query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
|
||||
} else if(queryType == "delete") {
|
||||
query = "DELETE FROM `" + table + "` WHERE 1";
|
||||
} else if(queryType == "clear") {
|
||||
query = '';
|
||||
}
|
||||
document.sqlform.sql_query.value = query;
|
||||
sql_box_locked = false;
|
||||
if (queryType == "selectall") {
|
||||
query = "SELECT * FROM `" + table + "` WHERE 1";
|
||||
} else if (queryType == "select") {
|
||||
query = "SELECT " + chaineAj + " FROM `" + table + "` WHERE 1";
|
||||
} else if (queryType == "insert") {
|
||||
query = "INSERT INTO `" + table + "`(" + chaineAj + ") VALUES (" + valDis + ")";
|
||||
} else if (queryType == "update") {
|
||||
query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
|
||||
} else if(queryType == "delete") {
|
||||
query = "DELETE FROM `" + table + "` WHERE 1";
|
||||
}
|
||||
document.sqlform.sql_query.value = query;
|
||||
sql_box_locked = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1118,7 +1120,7 @@ function changeMIMEType(db, table, reference, mime_type)
|
||||
* Jquery Coding for inline editing SQL_QUERY
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
$(".inline_edit").click( function(){
|
||||
$(".inline_edit_sql").click( function(){
|
||||
var db = $(this).prev().find("input[name='db']").val();
|
||||
var table = $(this).prev().find("input[name='table']").val();
|
||||
var token = $(this).prev().find("input[name='token']").val();
|
||||
@ -1145,7 +1147,11 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$('.sqlbutton').click(function(evt){
|
||||
insertQuery(evt.target.id);
|
||||
if (evt.target.id == 'clear') {
|
||||
$('#sqlquery').val('');
|
||||
} else {
|
||||
insertQuery(evt.target.id);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -1189,7 +1195,12 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
|
||||
$('#sqlquery').focus();
|
||||
$('#sqlquery').focus().keydown(function (e) {
|
||||
if (e.ctrlKey && e.keyCode == 13) {
|
||||
$("#sqlqueryform").submit();
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#input_username')) {
|
||||
if ($('#input_username').val() == '') {
|
||||
$('#input_username').focus();
|
||||
@ -1269,7 +1280,7 @@ function PMA_ajaxShowMessage(message, timeout) {
|
||||
.hide();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return $("#loading");
|
||||
}
|
||||
|
||||
@ -1442,7 +1453,7 @@ $(document).ready(function() {
|
||||
open: PMA_verifyTypeOfAllColumns,
|
||||
buttons : button_options
|
||||
}); // end dialog options
|
||||
}
|
||||
}
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
}) // end $.get()
|
||||
|
||||
@ -1583,7 +1594,7 @@ $(document).ready(function() {
|
||||
$("#create_table_div").html(data);
|
||||
}
|
||||
PMA_verifyTypeOfAllColumns();
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
}) //end $.post()
|
||||
|
||||
}) // end create table form (add fields)
|
||||
@ -1733,7 +1744,7 @@ $(document).ready(function() {
|
||||
.dialog({
|
||||
title: PMA_messages['strChangePassword'],
|
||||
width: 600,
|
||||
close: function(ev,ui) {$(this).remove();},
|
||||
close: function(ev,ui) {$(this).remove();},
|
||||
buttons : button_options,
|
||||
beforeClose: function(ev,ui){ $('#change_password_anchor.dialog_active').removeClass('dialog_active').addClass('ajax')}
|
||||
})
|
||||
@ -1772,7 +1783,7 @@ $(document).ready(function() {
|
||||
$("#change_password_dialog").hide().remove();
|
||||
$("#edit_user_dialog").dialog("close").remove();
|
||||
$('#change_password_anchor.dialog_active').removeClass('dialog_active').addClass('ajax');
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
}
|
||||
else {
|
||||
PMA_ajaxShowMessage(data.error);
|
||||
@ -2276,5 +2287,74 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#update_recent_tables').ready(function() {
|
||||
if (window.parent.frame_navigation != undefined
|
||||
&& window.parent.frame_navigation.PMA_reloadRecentTable != undefined)
|
||||
{
|
||||
window.parent.frame_navigation.PMA_reloadRecentTable();
|
||||
}
|
||||
});
|
||||
|
||||
}) // end of $(document).ready()
|
||||
|
||||
/**
|
||||
* Attach Ajax event handlers for Drop Table.
|
||||
*
|
||||
* @uses $.PMA_confirm()
|
||||
* @uses PMA_ajaxShowMessage()
|
||||
* @uses window.parent.refreshNavigation()
|
||||
* @uses window.parent.refreshMain()
|
||||
* @see $cfg['AjaxEnable']
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#drop_tbl_anchor").live('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
//context is top.frame_content, so we need to use window.parent.db to access the db var
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = PMA_messages['strDropTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP TABLE ' + window.parent.table;
|
||||
|
||||
$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
|
||||
//Database deleted successfully, refresh both the frames
|
||||
window.parent.refreshNavigation();
|
||||
window.parent.refreshMain();
|
||||
}) // end $.get()
|
||||
}); // end $.PMA_confirm()
|
||||
}); //end of Drop Table Ajax action
|
||||
}) // end of $(document).ready() for Drop Table
|
||||
|
||||
/**
|
||||
* Attach Ajax event handlers for Truncate Table.
|
||||
*
|
||||
* @uses $.PMA_confirm()
|
||||
* @uses PMA_ajaxShowMessage()
|
||||
* @uses window.parent.refreshNavigation()
|
||||
* @uses window.parent.refreshMain()
|
||||
* @see $cfg['AjaxEnable']
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#truncate_tbl_anchor").live('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
//context is top.frame_content, so we need to use window.parent.db to access the db var
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = PMA_messages['strTruncateTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'TRUNCATE TABLE ' + window.parent.table;
|
||||
|
||||
$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
|
||||
//Database deleted successfully, refresh both the frames
|
||||
window.parent.refreshNavigation();
|
||||
window.parent.refreshMain();
|
||||
}) // end $.get()
|
||||
}); // end $.PMA_confirm()
|
||||
}); //end of Drop Table Ajax action
|
||||
}) // end of $(document).ready() for Drop Table
|
||||
|
||||
@ -16,7 +16,7 @@ function changePluginOpts() {
|
||||
var selected_plugin_name = $("#plugins option:selected").attr("value");
|
||||
$("#" + selected_plugin_name + "_options").fadeIn('slow');
|
||||
if(selected_plugin_name == "csv") {
|
||||
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
|
||||
$("#import_notification").text(PMA_messages['strImportCSV']);
|
||||
} else {
|
||||
$("#import_notification").text("");
|
||||
}
|
||||
|
||||
5169
js/jquery/jquery-1.4.4.js → js/jquery/jquery-1.6.1.js
vendored
5169
js/jquery/jquery-1.4.4.js → js/jquery/jquery-1.6.1.js
vendored
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,8 @@ $js_messages['strNoDropDatabases'] = __('"DROP DATABASE" statements are disabled
|
||||
/* For confirmations */
|
||||
$js_messages['strDoYouReally'] = __('Do you really want to ');
|
||||
$js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!');
|
||||
$js_messages['strDropTableStrongWarning'] = __('You are about to DESTROY a complete table!');
|
||||
$js_messages['strTruncateTableStrongWarning'] = __('You are about to TRUNCATE a complete table!');
|
||||
$js_messages['strDroppingEvent'] = __('Dropping Event');
|
||||
$js_messages['strDroppingProcedure'] = __('Dropping Procedure');
|
||||
$js_messages['strDeleteTrackingData'] = __('Delete tracking data for this table');
|
||||
@ -79,13 +81,19 @@ $js_messages['strNo'] = __('No');
|
||||
|
||||
/* For db_search.js */
|
||||
$js_messages['strSearching'] = __('Searching');
|
||||
//$js_messages['strBrowsing'] = __('Browsing');
|
||||
//$js_messages['strDeleting'] = __('Deleting');
|
||||
$js_messages['strHideSearchResults'] = __('Hide search results');
|
||||
$js_messages['strShowSearchResults'] = __('Show search results');
|
||||
$js_messages['strBrowsing'] = __('Browsing');
|
||||
$js_messages['strDeleting'] = __('Deleting');
|
||||
|
||||
/* For import.js */
|
||||
$js_messages['strImportCSV'] = __('Note: If the file contains multiple tables, they will be combined into one');
|
||||
|
||||
/* For sql.js */
|
||||
$js_messages['strHideQueryBox'] = __('Hide query box');
|
||||
$js_messages['strShowQueryBox'] = __('Show query box');
|
||||
$js_messages['strInlineEdit'] = __('Inline Edit');
|
||||
$js_messages['strEdit'] = __('Edit');
|
||||
$js_messages['strSave'] = __('Save');
|
||||
$js_messages['strHide'] = __('Hide');
|
||||
|
||||
@ -103,6 +111,7 @@ $js_messages['strSelectReferencedKey'] = __('Select referenced key');
|
||||
$js_messages['strSelectForeignKey'] = __('Select Foreign Key');
|
||||
$js_messages['strPleaseSelectPrimaryOrUniqueKey'] = __('Please select the primary key or a unique key');
|
||||
$js_messages['strChangeDisplay'] = __('Choose column to display');
|
||||
$js_messages['strLeavingDesigner'] = __('You haven\'t saved the changes in the layout. They will be lost if you don\'t save them.Do you want to continue?');
|
||||
|
||||
/* Visual query builder (pmd/scripts/move.js) */
|
||||
$js_messages['strAddOption'] = __('Add an option for column ');
|
||||
@ -119,6 +128,7 @@ $js_messages['strMore'] = __('More');
|
||||
$js_messages['strNewerVersion'] = __('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.');
|
||||
/* l10n: Latest available phpMyAdmin version */
|
||||
$js_messages['strLatestAvailable'] = __(', latest stable version:');
|
||||
$js_messages['strUpToDate'] = __('up to date');
|
||||
|
||||
echo "var PMA_messages = new Array();\n";
|
||||
foreach ($js_messages as $name => $js_message) {
|
||||
|
||||
@ -145,9 +145,11 @@ function PMA_setCookie(name, value, expires, path, domain, secure) {
|
||||
*
|
||||
*/
|
||||
function fast_filter(value){
|
||||
lowercase_value = value.toLowerCase();
|
||||
$("#subel0 a[class!='tableicon']").each(function(idx,elem){
|
||||
$elem = $(elem);
|
||||
if (value && $elem.html().indexOf(value) == -1) {
|
||||
// .indexOf is case sensitive so convert to lowercase to compare
|
||||
if (value && $elem.html().toLowerCase().indexOf(lowercase_value) == -1) {
|
||||
$elem.parent().hide();
|
||||
} else {
|
||||
$elem.parent().show();
|
||||
@ -165,6 +167,19 @@ function clear_fast_filter() {
|
||||
elm.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the recent tables list.
|
||||
*/
|
||||
function PMA_reloadRecentTable() {
|
||||
$.get('navigation.php',
|
||||
{ 'token' : window.parent.token, 'ajax_request' : true, 'recent_table' : true },
|
||||
function (data) {
|
||||
if (data.success == true) {
|
||||
$('#recentTable').html(data.options);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Performed on load */
|
||||
$(document).ready(function(){
|
||||
/* Display filter */
|
||||
@ -177,4 +192,14 @@ $(document).ready(function(){
|
||||
$('#clear_fast_filter').click(clear_fast_filter);
|
||||
$('#fast_filter').focus(function (evt) {evt.target.select();});
|
||||
$('#fast_filter').keyup(function (evt) {fast_filter(evt.target.value);});
|
||||
|
||||
/* Jump to recent table */
|
||||
$('#recentTable').change(function() {
|
||||
if (this.value != '') {
|
||||
var arr = this.value.split('.');
|
||||
window.parent.setDb(arr[0]);
|
||||
window.parent.setTable(arr[1]);
|
||||
window.parent.refreshMain($('#LeftDefaultTabTable')[0].value);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
148
js/sql.js
148
js/sql.js
@ -7,13 +7,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var $data_a;
|
||||
|
||||
/**
|
||||
* decode a string URL_encoded
|
||||
*
|
||||
* @param string str
|
||||
* @return string the URL-decoded string
|
||||
*/
|
||||
var data_vt;
|
||||
function PMA_urldecode(str) {
|
||||
return decodeURIComponent(str.replace(/\+/g, '%20'));
|
||||
}
|
||||
@ -81,10 +82,16 @@ function appendInlineAnchor() {
|
||||
|
||||
$cloned_tr.find('td')
|
||||
.addClass('inline_edit_anchor')
|
||||
.find('a').attr('href', '#')
|
||||
.find('span')
|
||||
.text(' ' + PMA_messages['strInlineEdit'])
|
||||
.prepend($img_object);
|
||||
.find('a').attr('href', '#');
|
||||
var $edit_span = $cloned_tr.find('span:contains("' + PMA_messages['strEdit'] + '")');
|
||||
var $span = $cloned_tr.find('a').find('span');
|
||||
if ($edit_span.length > 0) {
|
||||
$span.text(' ' + PMA_messages['strInlineEdit']);
|
||||
$span.prepend($img_object);
|
||||
} else {
|
||||
$span.text('');
|
||||
$span.append($img_object);
|
||||
}
|
||||
|
||||
$cloned_tr.insertAfter($this_tr);
|
||||
});
|
||||
@ -109,19 +116,27 @@ function appendInlineAnchor() {
|
||||
if ($img_object.length != 0) {
|
||||
var img_src = $img_object.attr('src').replace(/b_edit/,'b_inline_edit');
|
||||
$img_object.attr('src', img_src);
|
||||
$cloned_anchor
|
||||
.find('a').attr('href', '#')
|
||||
.find('span')
|
||||
.text(' ' + PMA_messages['strInlineEdit']);
|
||||
$cloned_anchor
|
||||
.find('span')
|
||||
.first()
|
||||
.prepend($img_object);
|
||||
$cloned_anchor.find('a').attr('href', '#');
|
||||
var $edit_span = $cloned_anchor.find('span:contains("' + PMA_messages['strEdit'] + '")');
|
||||
var $span = $cloned_anchor.find('a').find('span');
|
||||
if ($edit_span.length > 0) {
|
||||
$span.text(' ' + PMA_messages['strInlineEdit']);
|
||||
$span.prepend($img_object);
|
||||
} else {
|
||||
$span.text('');
|
||||
$span.append($img_object);
|
||||
}
|
||||
} else {
|
||||
// Only text is displayed. See $cfg['PropertiesIconic']
|
||||
$cloned_anchor.find('a').attr('href', '#');
|
||||
$cloned_anchor.find('a span').text(PMA_messages['strInlineEdit']);
|
||||
|
||||
// the link was too big so <input type="image"> is there
|
||||
$img_object = $cloned_anchor.find('input:image').attr('title', PMA_messages['strInlineEdit']);
|
||||
var img_src = $img_object.attr('src').replace(/b_edit/,'b_inline_edit');
|
||||
$img_object.attr('src', img_src);
|
||||
if ($img_object.length > 0) {
|
||||
var img_src = $img_object.attr('src').replace(/b_edit/,'b_inline_edit');
|
||||
$img_object.attr('src', img_src);
|
||||
}
|
||||
$cloned_anchor
|
||||
.find('.clickprevimage')
|
||||
.text(' ' + PMA_messages['strInlineEdit']);
|
||||
@ -248,10 +263,15 @@ $(document).ready(function() {
|
||||
*/
|
||||
$("#sqlqueryform.ajax").live('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
$form = $(this);
|
||||
if (! checkSqlQuery($form[0])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove any div containing a previous error message
|
||||
$('.error').remove();
|
||||
|
||||
$form = $(this);
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
@ -441,24 +461,58 @@ $(document).ready(function() {
|
||||
// Looping through all columns or rows, to find the required data and then storing it in an array.
|
||||
|
||||
var $this_children = $edit_td.children('span.nowrap').children('a').children('span.nowrap');
|
||||
if (disp_mode != 'vertical') {
|
||||
$this_children.empty();
|
||||
$this_children.text(PMA_messages['strSave']);
|
||||
// Keep the original data preserved.
|
||||
$data_a = $edit_td.children('span.nowrap').children('a').clone();
|
||||
|
||||
// Change the inline edit to save.
|
||||
var $img_object = $this_children.find('img');
|
||||
|
||||
// If texts are displayed. See $cfg['PropertiesIconic']
|
||||
if ($this_children.parent('a').find('span:contains("' + PMA_messages['strInlineEdit'] + '")').length > 0) {
|
||||
$this_children.text(' ' + PMA_messages['strSave']);
|
||||
} else {
|
||||
// vertical
|
||||
data_vt = $this_children.html();
|
||||
$this_children.text(PMA_messages['strSave']);
|
||||
$this_children.empty();
|
||||
}
|
||||
|
||||
var hide_link = '<br /><br /><a id="hide">' + PMA_messages['strHide'] + '</a>';
|
||||
if (disp_mode != 'vertical') {
|
||||
$edit_td.append(hide_link);
|
||||
$('#table_results tbody tr td a#hide').click(function() {
|
||||
$this_children = $(this).siblings('span.nowrap').children('a').children('span.nowrap');
|
||||
$this_children.empty();
|
||||
$this_children.text(PMA_messages['strInlineEdit']);
|
||||
// If icons are displayed. See $cfg['PropertiesIconic']
|
||||
if ($img_object.length > 0) {
|
||||
$img_object.attr('title', PMA_messages['strSave']);
|
||||
var img_src = $img_object.attr('src').replace(/b_inline_edit/,'b_save');
|
||||
$img_object.attr('src', img_src);
|
||||
$this_children.prepend($img_object);
|
||||
}
|
||||
|
||||
// Clone the save link and change it to create the hide link.
|
||||
var $hide_a = $edit_td.children('span.nowrap').children('a').clone().attr('id', 'hide');
|
||||
var $hide_span = $hide_a.find('span');
|
||||
var $img_object = $hide_a.find('span img');
|
||||
|
||||
// If texts are displayed. See $cfg['PropertiesIconic']
|
||||
if ($hide_a.find('span:contains("' + PMA_messages['strSave'] + '")').length > 0) {
|
||||
$hide_span.text(' ' + PMA_messages['strHide']);
|
||||
} else {
|
||||
$hide_span.empty();
|
||||
}
|
||||
|
||||
// If icons are displayed. See $cfg['PropertiesIconic']
|
||||
if ($img_object.length > 0) {
|
||||
$img_object.attr('title', PMA_messages['strHide']);
|
||||
var img_src = $img_object.attr('src').replace(/b_save/,'b_close');
|
||||
$img_object.attr('src', img_src);
|
||||
$hide_span.prepend($img_object);
|
||||
}
|
||||
|
||||
// Add hide icon and/or text.
|
||||
$edit_td.children('span.nowrap').append($('<br /><br />')).append($hide_a);
|
||||
|
||||
if (disp_mode != 'vertical') {
|
||||
$('#table_results tbody tr td span a#hide').click(function() {
|
||||
var $this_hide = $(this).parents('td');
|
||||
|
||||
var $this_span = $this_hide.find('span');
|
||||
$this_span.find('a, br').remove();
|
||||
$this_span.append($data_a.clone());
|
||||
|
||||
var $this_hide = $(this).parent();
|
||||
$this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor");
|
||||
$this_hide.parent().removeClass("hover noclick");
|
||||
$this_hide.siblings().removeClass("hover");
|
||||
@ -483,14 +537,15 @@ $(document).ready(function() {
|
||||
var txt = '';
|
||||
var rows = $edit_td.parent().siblings().length;
|
||||
|
||||
$edit_td.append(hide_link);
|
||||
$('#table_results tbody tr td a#hide').click(function() {
|
||||
var pos = $(this).parent().index();
|
||||
var $chg_submit = $(this).parent().children('span.nowrap').children('a').children('span.nowrap');
|
||||
$chg_submit.empty();
|
||||
$chg_submit.append(data_vt);
|
||||
$('#table_results tbody tr td span a#hide').click(function() {
|
||||
var $hide_a = $(this);
|
||||
var pos = $hide_a.parents('td').index();
|
||||
|
||||
var $this_row = $(this).parents('tr');
|
||||
var $this_span = $hide_a.parent();
|
||||
$this_span.find('a, br').remove();
|
||||
$this_span.append($data_a.clone());
|
||||
|
||||
var $this_row = $this_span.parents('tr');
|
||||
// changing inline_edit_active to inline_edit_anchor
|
||||
$this_row.siblings("tr:eq(3) td:eq(" + pos + ")").removeClass("inline_edit_active").addClass("inline_edit_anchor");
|
||||
|
||||
@ -956,19 +1011,10 @@ $(document).ready(function() {
|
||||
*/
|
||||
function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {
|
||||
|
||||
// deleting the hide button
|
||||
// remove <br><br><a> tags
|
||||
for ( var i = 0; i <= 2; i++) {
|
||||
$del_hide.next().remove();
|
||||
}
|
||||
if(disp_mode != 'vertical'){
|
||||
$chg_submit.empty();
|
||||
$chg_submit.html('<span class="nowrap"></span>');
|
||||
$chg_submit.children('span.nowrap').text(PMA_messages['strInlineEdit']);
|
||||
} else {
|
||||
$chg_submit.children('span.nowrap').empty();
|
||||
$chg_submit.children('span.nowrap').append(data_vt);
|
||||
}
|
||||
// deleting the hide button. remove <br><br><a> tags
|
||||
$del_hide.find('a, br').remove();
|
||||
// append inline edit button.
|
||||
$del_hide.append($data_a.clone());
|
||||
|
||||
// changing inline_edit_active to inline_edit_anchor
|
||||
$this_td.removeClass('inline_edit_active').addClass('inline_edit_anchor');
|
||||
@ -978,7 +1024,7 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
|
||||
if(disp_mode != 'vertical') {
|
||||
$this_td.parent('tr').removeClass('hover').find('td').removeClass('hover');
|
||||
} else {
|
||||
$this_td.parents('tbody').find('tr').find('td:eq(' + $this_td.index() + ')').removeClass('marked');
|
||||
$this_td.parents('tbody').find('tr').find('td:eq(' + $this_td.index() + ')').removeClass('marked hover');
|
||||
}
|
||||
|
||||
$input_siblings.each(function() {
|
||||
|
||||
@ -96,7 +96,7 @@ class PMA_Config
|
||||
*/
|
||||
function checkSystem()
|
||||
{
|
||||
$this->set('PMA_VERSION', '3.4.0-rc3-dev');
|
||||
$this->set('PMA_VERSION', '3.5.0-dev');
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@ -148,7 +148,7 @@ class PMA_Config
|
||||
{
|
||||
if (PMA_getenv('HTTP_USER_AGENT')) {
|
||||
$HTTP_USER_AGENT = PMA_getenv('HTTP_USER_AGENT');
|
||||
} elseif (!isset($HTTP_USER_AGENT)) {
|
||||
} elseif (! isset($HTTP_USER_AGENT)) {
|
||||
$HTTP_USER_AGENT = '';
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ class PMA_Config
|
||||
if ($server > 0 && !defined('PMA_MINIMUM_COMMON')) {
|
||||
$config_mtime = max($this->default_source_mtime, $this->source_mtime);
|
||||
// cache user preferences, use database only when needed
|
||||
if (!isset($_SESSION['cache'][$cache_key]['userprefs'])
|
||||
if (! isset($_SESSION['cache'][$cache_key]['userprefs'])
|
||||
|| $_SESSION['cache'][$cache_key]['config_mtime'] < $config_mtime) {
|
||||
// load required libraries
|
||||
require_once './libraries/user_preferences.lib.php';
|
||||
@ -451,7 +451,7 @@ class PMA_Config
|
||||
$_SESSION['cache'][$cache_key]['userprefs_type'] = $prefs['type'];
|
||||
$_SESSION['cache'][$cache_key]['config_mtime'] = $config_mtime;
|
||||
}
|
||||
} else if ($server == 0 || !isset($_SESSION['cache'][$cache_key]['userprefs'])) {
|
||||
} else if ($server == 0 || ! isset($_SESSION['cache'][$cache_key]['userprefs'])) {
|
||||
$this->set('user_preferences', false);
|
||||
return;
|
||||
}
|
||||
@ -476,7 +476,7 @@ class PMA_Config
|
||||
// save theme
|
||||
$tmanager = $_SESSION['PMA_Theme_Manager'];
|
||||
if ($tmanager->getThemeCookie() || isset($_REQUEST['set_theme'])) {
|
||||
if ((!isset($config_data['ThemeDefault']) && $tmanager->theme->getId() != 'original')
|
||||
if ((! isset($config_data['ThemeDefault']) && $tmanager->theme->getId() != 'original')
|
||||
|| isset($config_data['ThemeDefault']) && $config_data['ThemeDefault'] != $tmanager->theme->getId()) {
|
||||
// new theme was set in common.inc.php
|
||||
$this->setUserValue(null, 'ThemeDefault', $tmanager->theme->getId(), 'original');
|
||||
@ -491,14 +491,14 @@ class PMA_Config
|
||||
}
|
||||
|
||||
// save font size
|
||||
if ((!isset($config_data['fontsize']) && $org_fontsize != '82%')
|
||||
if ((! isset($config_data['fontsize']) && $org_fontsize != '82%')
|
||||
|| isset($config_data['fontsize']) && $org_fontsize != $config_data['fontsize']) {
|
||||
$this->setUserValue(null, 'fontsize', $org_fontsize, '82%');
|
||||
}
|
||||
|
||||
// save language
|
||||
if (isset($_COOKIE['pma_lang']) || isset($_POST['lang'])) {
|
||||
if ((!isset($config_data['lang']) && $GLOBALS['lang'] != 'en')
|
||||
if ((! isset($config_data['lang']) && $GLOBALS['lang'] != 'en')
|
||||
|| isset($config_data['lang']) && $GLOBALS['lang'] != $config_data['lang']) {
|
||||
$this->setUserValue(null, 'lang', $GLOBALS['lang'], 'en');
|
||||
}
|
||||
@ -511,7 +511,7 @@ class PMA_Config
|
||||
|
||||
// save connection collation
|
||||
if (isset($_COOKIE['pma_collation_connection']) || isset($_POST['collation_connection'])) {
|
||||
if ((!isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != 'utf8_general_ci')
|
||||
if ((! isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != 'utf8_general_ci')
|
||||
|| isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != $config_data['collation_connection']) {
|
||||
$this->setUserValue(null, 'collation_connection', $GLOBALS['collation_connection'], 'utf8_general_ci');
|
||||
}
|
||||
@ -678,7 +678,7 @@ class PMA_Config
|
||||
*/
|
||||
function set($setting, $value)
|
||||
{
|
||||
if (!isset($this->settings[$setting]) || $this->settings[$setting] != $value) {
|
||||
if (! isset($this->settings[$setting]) || $this->settings[$setting] != $value) {
|
||||
$this->settings[$setting] = $value;
|
||||
$this->set_mtime = time();
|
||||
}
|
||||
|
||||
@ -47,15 +47,15 @@ class PMA_Error extends PMA_Message
|
||||
*/
|
||||
static public $errorlevel = array (
|
||||
E_ERROR => 'error',
|
||||
E_WARNING => 'warning',
|
||||
E_WARNING => 'error',
|
||||
E_PARSE => 'error',
|
||||
E_NOTICE => 'notice',
|
||||
E_CORE_ERROR => 'error',
|
||||
E_CORE_WARNING => 'warning',
|
||||
E_CORE_WARNING => 'error',
|
||||
E_COMPILE_ERROR => 'error',
|
||||
E_COMPILE_WARNING => 'warning',
|
||||
E_COMPILE_WARNING => 'error',
|
||||
E_USER_ERROR => 'error',
|
||||
E_USER_WARNING => 'warning',
|
||||
E_USER_WARNING => 'error',
|
||||
E_USER_NOTICE => 'notice',
|
||||
E_STRICT => 'notice',
|
||||
E_DEPRECATED => 'notice',
|
||||
|
||||
@ -498,7 +498,7 @@ require_once './libraries/List.class.php';
|
||||
if (isset($tmp_mydbs[$tmp_db]) && $tmp_mydbs[$tmp_db] == 1) {
|
||||
$dblist[] = $tmp_db;
|
||||
$tmp_mydbs[$tmp_db] = 0;
|
||||
} elseif (!isset($dblist[$tmp_db])) {
|
||||
} elseif (! isset($dblist[$tmp_db])) {
|
||||
foreach ($tmp_mydbs as $tmp_matchpattern => $tmp_value) {
|
||||
// fixed bad regexp
|
||||
// TODO: db names may contain characters
|
||||
|
||||
200
libraries/RecentTable.class.php
Normal file
200
libraries/RecentTable.class.php
Normal file
@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
*
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
|
||||
require_once './libraries/Message.class.php';
|
||||
|
||||
/**
|
||||
* Handles the recently used tables.
|
||||
*
|
||||
* @TODO Change the release version in table pma_recent (#recent in Documentation.html)
|
||||
*
|
||||
* @package phpMyAdmin
|
||||
*/
|
||||
class RecentTable
|
||||
{
|
||||
/**
|
||||
* Defines the internal PMA table which contains recent tables.
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $pma_table;
|
||||
|
||||
/**
|
||||
* Reference to session variable containing recently used tables.
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $tables;
|
||||
|
||||
/**
|
||||
* RecentTable instance.
|
||||
*
|
||||
* @var RecentTable
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (strlen($GLOBALS['cfg']['Server']['pmadb']) &&
|
||||
strlen($GLOBALS['cfg']['Server']['recent'])) {
|
||||
$this->pma_table = PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) .".".
|
||||
PMA_backquote($GLOBALS['cfg']['Server']['recent']);
|
||||
}
|
||||
if (! isset($_SESSION['tmp_user_values']['recent_tables'])) {
|
||||
$_SESSION['tmp_user_values']['recent_tables'] =
|
||||
isset($this->pma_table) ? $this->getFromDb() : array();
|
||||
}
|
||||
$this->tables =& $_SESSION['tmp_user_values']['recent_tables'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns class instance.
|
||||
*
|
||||
* @return RecentTable
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(self::$_instance)) {
|
||||
self::$_instance = new RecentTable();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns recently used tables from phpMyAdmin database.
|
||||
*
|
||||
* @uses $pma_table
|
||||
* @uses PMA_query_as_controluser()
|
||||
* @uses PMA_DBI_fetch_array()
|
||||
* @uses json_decode()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFromDb()
|
||||
{
|
||||
// Read from phpMyAdmin database, if recent tables is not in session
|
||||
$sql_query =
|
||||
" SELECT `tables` FROM " . $this->pma_table .
|
||||
" WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'";
|
||||
|
||||
$row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query));
|
||||
if (isset($row[0])) {
|
||||
return json_decode($row[0]);
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save recent tables into phpMyAdmin database.
|
||||
*
|
||||
* @uses PMA_DBI_try_query()
|
||||
* @uses json_decode()
|
||||
* @uses PMA_Message
|
||||
*
|
||||
* @return true|PMA_Message
|
||||
*/
|
||||
public function saveToDb()
|
||||
{
|
||||
$username = $GLOBALS['cfg']['Server']['user'];
|
||||
$sql_query =
|
||||
" REPLACE INTO " . $this->pma_table . " (`username`, `tables`)" .
|
||||
" VALUES ('" . $username . "', '" . PMA_sqlAddslashes(json_encode($this->tables)) . "')";
|
||||
|
||||
$success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']);
|
||||
|
||||
if (!$success) {
|
||||
$message = PMA_Message::error(__('Could not save recent table'));
|
||||
$message->addMessage('<br /><br />');
|
||||
$message->addMessage(PMA_Message::rawError(PMA_DBI_getError($GLOBALS['controllink'])));
|
||||
return $message;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trim recent table according to the LeftRecentTable configuration.
|
||||
*
|
||||
* @return boolean True if trimming occurred
|
||||
*/
|
||||
public function trim()
|
||||
{
|
||||
$max = max($GLOBALS['cfg']['LeftRecentTable'], 0);
|
||||
$trimming_occured = count($this->tables) > $max;
|
||||
while (count($this->tables) > $max) {
|
||||
array_pop($this->tables);
|
||||
}
|
||||
return $trimming_occured;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return options for HTML select.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHtmlSelectOption()
|
||||
{
|
||||
// trim and save, in case where the configuration is changed
|
||||
if ($this->trim() && isset($this->pma_table)) {
|
||||
$this->saveToDb();
|
||||
}
|
||||
|
||||
$html = '<option value="">(' . __('Recent tables') . ') ...</option>';
|
||||
if (count($this->tables)) {
|
||||
foreach ($this->tables as $table) {
|
||||
$html .= '<option value="' . $table . '">' . $table . '</option>';
|
||||
}
|
||||
} else {
|
||||
$html .= '<option value="">' . __('There are no recent tables') . '</option>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML select.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHtmlSelect()
|
||||
{
|
||||
$html = '<input type="hidden" id="LeftDefaultTabTable" value="' .
|
||||
$GLOBALS['cfg']['LeftDefaultTabTable'] . '" />';
|
||||
$html .= '<select id="recentTable">';
|
||||
$html .= $this->getHtmlSelectOption();
|
||||
$html .= '</select>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add recently used tables.
|
||||
*
|
||||
* @param string $db Database name where the table is located
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return true|PMA_Message True if success, PMA_Message if not
|
||||
*/
|
||||
public function add($db, $table)
|
||||
{
|
||||
$table_str = $db . '.' . $table;
|
||||
|
||||
// add only if this is new table
|
||||
if (! isset($this->tables[0]) || $this->tables[0] != $table_str) {
|
||||
array_unshift($this->tables, $table_str);
|
||||
$this->tables = array_merge(array_unique($this->tables));
|
||||
$this->trim();
|
||||
if (isset($this->pma_table)) {
|
||||
return $this->saveToDb();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -889,7 +889,7 @@ class PMA_Table
|
||||
} else {
|
||||
// we are copying
|
||||
// Create new entries as duplicates from old PMA DBs
|
||||
if ($what != 'dataonly' && !isset($maintain_relations)) {
|
||||
if ($what != 'dataonly' && ! isset($maintain_relations)) {
|
||||
if ($GLOBALS['cfgRelation']['commwork']) {
|
||||
// Get all comments and MIME-Types for current table
|
||||
$comments_copy_query = 'SELECT
|
||||
|
||||
@ -464,6 +464,51 @@ class PMA_Tracker
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes tracking data of a table.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param string $dbname name of database
|
||||
* @param string $tablename name of table
|
||||
* @param string $version version
|
||||
* @param string $type type of data(DDL || DML)
|
||||
* @param string || array $new_data the new tracking data
|
||||
*
|
||||
* @return bool result of change
|
||||
*/
|
||||
static public function changeTrackingData($dbname, $tablename, $version, $type, $new_data)
|
||||
{
|
||||
if ($type == 'DDL')
|
||||
$save_to = 'schema_sql';
|
||||
elseif ($type == 'DML')
|
||||
$save_to = 'data_sql';
|
||||
else
|
||||
return false;
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
$new_data_processed = '';
|
||||
if (is_array($new_data)) {
|
||||
foreach ($new_data as $data) {
|
||||
$new_data_processed .= '# log ' . $date . ' ' . $data['username'] . PMA_sqlAddslashes($data['statement']) . "\n";
|
||||
}
|
||||
} else {
|
||||
$new_data_processed = $new_data;
|
||||
}
|
||||
|
||||
$sql_query =
|
||||
" UPDATE " . self::$pma_table .
|
||||
" SET `" . $save_to . "` = '" . $new_data_processed . "' " .
|
||||
" WHERE `db_name` = '" . PMA_sqlAddslashes($dbname) . "' " .
|
||||
" AND `table_name` = '" . PMA_sqlAddslashes($tablename) . "' " .
|
||||
" AND `version` = '" . PMA_sqlAddslashes($version) . "' ";
|
||||
|
||||
$result = PMA_query_as_controluser($sql_query);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates tracking of a table.
|
||||
*
|
||||
|
||||
@ -202,18 +202,35 @@ function PMA_auth_set_user()
|
||||
*/
|
||||
function PMA_auth_fails()
|
||||
{
|
||||
if (! empty($GLOBALS['login_without_password_is_forbidden'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Login without a password is forbidden by configuration (see AllowNoPassword)');
|
||||
} elseif (! empty($GLOBALS['allowDeny_forbidden'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Access denied');
|
||||
} elseif (! empty($GLOBALS['no_activity'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = sprintf(__('No activity within %s seconds; please log in again'), $GLOBALS['cfg']['LoginCookieValidity']);
|
||||
} elseif (PMA_DBI_getError()) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = PMA_sanitize(PMA_DBI_getError());
|
||||
} elseif (isset($php_errormsg)) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = $php_errormsg;
|
||||
} else {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Cannot log in to the MySQL server');
|
||||
/* Session name */
|
||||
$session_name = $GLOBALS['cfg']['Server']['SignonSession'];
|
||||
|
||||
/* Does session exist? */
|
||||
if (isset($_COOKIE[$session_name])) {
|
||||
/* End current session */
|
||||
$old_session = session_name();
|
||||
$old_id = session_id();
|
||||
session_write_close();
|
||||
|
||||
/* Load single signon session */
|
||||
session_name($session_name);
|
||||
session_id($_COOKIE[$session_name]);
|
||||
session_start();
|
||||
|
||||
/* Set error message */
|
||||
if (! empty($GLOBALS['login_without_password_is_forbidden'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Login without a password is forbidden by configuration (see AllowNoPassword)');
|
||||
} elseif (! empty($GLOBALS['allowDeny_forbidden'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Access denied');
|
||||
} elseif (! empty($GLOBALS['no_activity'])) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = sprintf(__('No activity within %s seconds; please log in again'), $GLOBALS['cfg']['LoginCookieValidity']);
|
||||
} elseif (PMA_DBI_getError()) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = PMA_sanitize(PMA_DBI_getError());
|
||||
} elseif (isset($php_errormsg)) {
|
||||
$_SESSION['PMA_single_signon_error_message'] = $php_errormsg;
|
||||
} else {
|
||||
$_SESSION['PMA_single_signon_error_message'] = __('Cannot log in to the MySQL server');
|
||||
}
|
||||
}
|
||||
PMA_auth();
|
||||
} // end of the 'PMA_auth_fails()' function
|
||||
|
||||
@ -104,7 +104,7 @@ function PMA_chart_results($data, &$chartSettings)
|
||||
// default for muti series
|
||||
$chartSettings['multi'] = false;
|
||||
|
||||
if (!isset($data[0])) {
|
||||
if (! isset($data[0])) {
|
||||
// empty data
|
||||
return __('No data found for the chart.');
|
||||
}
|
||||
@ -192,7 +192,7 @@ function PMA_chart_results($data, &$chartSettings)
|
||||
// the value os for this serie
|
||||
$chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]] = (int)$row[$yAxisKey];
|
||||
}
|
||||
else if (!isset($chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]])) {
|
||||
else if (! isset($chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]])) {
|
||||
// if the value for this serie is not set, set it to 0
|
||||
$chartData[$yAxisKey][$seriesLabelsValue][$row[$xAxisKey]] = 0;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ function PMA_analyseShowGrant()
|
||||
|
||||
/**
|
||||
* @todo collect $GLOBALS['db_to_create'] into an array, to display a
|
||||
* drop-down in the "Create new database" dialog
|
||||
* drop-down in the "Create database" dialog
|
||||
*/
|
||||
// we don't break, we want all possible databases
|
||||
//break;
|
||||
|
||||
@ -477,8 +477,6 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
|
||||
'media_type', 'custom_type', 'bs_reference',
|
||||
/* for changing BLOB repository file MIME type */
|
||||
'bs_db', 'bs_table', 'bs_ref', 'bs_new_mime_type',
|
||||
/* URL redirector */
|
||||
'url'
|
||||
);
|
||||
/**
|
||||
* Require cleanup functions
|
||||
@ -541,7 +539,7 @@ $_REQUEST['js_frame'] = PMA_ifSetOr($_REQUEST['js_frame'], '');
|
||||
* @global array $js_include
|
||||
*/
|
||||
$GLOBALS['js_include'] = array();
|
||||
$GLOBALS['js_include'][] = 'jquery/jquery-1.4.4.js';
|
||||
$GLOBALS['js_include'][] = 'jquery/jquery-1.6.1.js';
|
||||
$GLOBALS['js_include'][] = 'update-location.js';
|
||||
|
||||
/**
|
||||
@ -608,7 +606,7 @@ $GLOBALS['server'] = 0;
|
||||
* @todo merge into PMA_Config
|
||||
*/
|
||||
// Do we have some server?
|
||||
if (!isset($cfg['Servers']) || count($cfg['Servers']) == 0) {
|
||||
if (! isset($cfg['Servers']) || count($cfg['Servers']) == 0) {
|
||||
// No server => create one with defaults
|
||||
$cfg['Servers'] = array(1 => $default_server);
|
||||
} else {
|
||||
@ -664,7 +662,7 @@ if (! isset($_SESSION['PMA_Theme_Manager'])) {
|
||||
}
|
||||
|
||||
// for the theme per server feature
|
||||
if (isset($_REQUEST['server']) && !isset($_REQUEST['set_theme'])) {
|
||||
if (isset($_REQUEST['server']) && ! isset($_REQUEST['set_theme'])) {
|
||||
$GLOBALS['server'] = $_REQUEST['server'];
|
||||
$tmp = $_SESSION['PMA_Theme_Manager']->getThemeCookie();
|
||||
if (empty($tmp)) {
|
||||
|
||||
@ -9,14 +9,9 @@
|
||||
/**
|
||||
* Exponential expression / raise number into power
|
||||
*
|
||||
* @uses function_exists()
|
||||
* @uses bcpow()
|
||||
* @uses gmp_pow()
|
||||
* @uses gmp_strval()
|
||||
* @uses pow()
|
||||
* @param number $base
|
||||
* @param number $exp
|
||||
* @param string pow function use, or false for auto-detect
|
||||
* @param string $base
|
||||
* @param string $exp
|
||||
* @param mixed $use_function pow function to use, or false for auto-detect
|
||||
* @return mixed string or float
|
||||
*/
|
||||
function PMA_pow($base, $exp, $use_function = false)
|
||||
@ -69,12 +64,11 @@ function PMA_pow($base, $exp, $use_function = false)
|
||||
*
|
||||
* @uses $GLOBALS['pmaThemeImage']
|
||||
* @uses $GLOBALS['cfg']['PropertiesIconic']
|
||||
* @uses htmlspecialchars()
|
||||
* @param string $icon name of icon file
|
||||
* @param string $alternate alternate text
|
||||
* @param boolean $container include in container
|
||||
* @param boolean $$force_text whether to force alternate text to be displayed
|
||||
* @return html img tag
|
||||
* @param string $icon name of icon file
|
||||
* @param string $alternate alternate text
|
||||
* @param boolean $container include in container
|
||||
* @param boolean $force_text whether to force alternate text to be displayed
|
||||
* @return html img tag
|
||||
*/
|
||||
function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = false)
|
||||
{
|
||||
@ -127,9 +121,7 @@ function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = f
|
||||
* Displays the maximum size for an upload
|
||||
*
|
||||
* @uses PMA_formatByteDown()
|
||||
* @uses sprintf()
|
||||
* @param integer the size
|
||||
*
|
||||
* @param integer $max_upload_size the size
|
||||
* @return string the message
|
||||
*
|
||||
* @access public
|
||||
@ -146,8 +138,7 @@ function PMA_displayMaximumUploadSize($max_upload_size)
|
||||
* Generates a hidden field which should indicate to the browser
|
||||
* the maximum size for upload
|
||||
*
|
||||
* @param integer the size
|
||||
*
|
||||
* @param integer $max_size the size
|
||||
* @return string the INPUT field
|
||||
*
|
||||
* @access public
|
||||
@ -161,15 +152,13 @@ function PMA_displayMaximumUploadSize($max_upload_size)
|
||||
* Add slashes before "'" and "\" characters so a value containing them can
|
||||
* be used in a sql comparison.
|
||||
*
|
||||
* @uses str_replace()
|
||||
* @param string the string to slash
|
||||
* @param boolean whether the string will be used in a 'LIKE' clause
|
||||
* (it then requires two more escaped sequences) or not
|
||||
* @param boolean whether to treat cr/lfs as escape-worthy entities
|
||||
* (converts \n to \\n, \r to \\r)
|
||||
*
|
||||
* @param boolean whether this function is used as part of the
|
||||
* "Create PHP code" dialog
|
||||
* @param string $a_string the string to slash
|
||||
* @param bool $is_like whether the string will be used in a 'LIKE' clause
|
||||
* (it then requires two more escaped sequences) or not
|
||||
* @param bool $crlf whether to treat cr/lfs as escape-worthy entities
|
||||
* (converts \n to \\n, \r to \\r)
|
||||
* @param bool $php_code whether this function is used as part of the
|
||||
* "Create PHP code" dialog
|
||||
*
|
||||
* @return string the slashed string
|
||||
*
|
||||
@ -204,9 +193,7 @@ function PMA_sqlAddslashes($a_string = '', $is_like = false, $crlf = false, $php
|
||||
* database, table and field names.
|
||||
* Note: This function does not escape backslashes!
|
||||
*
|
||||
* @uses str_replace()
|
||||
* @param string the string to escape
|
||||
*
|
||||
* @param string $name the string to escape
|
||||
* @return string the escaped string
|
||||
*
|
||||
* @access public
|
||||
@ -223,7 +210,6 @@ function PMA_escape_mysql_wildcards($name)
|
||||
* removes slashes before "_" and "%" characters
|
||||
* Note: This function does not unescape backslashes!
|
||||
*
|
||||
* @uses str_replace()
|
||||
* @param string $name the string to escape
|
||||
* @return string the escaped string
|
||||
* @access public
|
||||
@ -241,8 +227,6 @@ function PMA_unescape_mysql_wildcards($name)
|
||||
*
|
||||
* checks if the sting is quoted and removes this quotes
|
||||
*
|
||||
* @uses str_replace()
|
||||
* @uses substr()
|
||||
* @param string $quoted_string string to remove quotes from
|
||||
* @param string $quote type of quote to remove
|
||||
* @return string unqoted string
|
||||
@ -279,10 +263,9 @@ function PMA_unQuote($quoted_string, $quote = null)
|
||||
* @uses PMA_SQP_isError()
|
||||
* @uses PMA_SQP_formatHtml()
|
||||
* @uses PMA_SQP_formatNone()
|
||||
* @uses is_array()
|
||||
* @param mixed pre-parsed SQL structure
|
||||
*
|
||||
* @return string the formatted sql
|
||||
* @param mixed $parsed_sql pre-parsed SQL structure
|
||||
* @param string $unparsed_sql
|
||||
* @return string the formatted sql
|
||||
*
|
||||
* @global array the configuration array
|
||||
* @global boolean whether the current statement is a multiple one or not
|
||||
@ -301,7 +284,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
|
||||
return htmlspecialchars($parsed_sql['raw']);
|
||||
}
|
||||
// then check for an array
|
||||
if (!is_array($parsed_sql)) {
|
||||
if (! is_array($parsed_sql)) {
|
||||
// We don't so just return the input directly
|
||||
// This is intended to be used for when the SQL Parser is turned off
|
||||
$formatted_sql = '<pre>' . "\n"
|
||||
@ -342,12 +325,11 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '')
|
||||
* @uses $cfg['ReplaceHelpImg']
|
||||
* @uses $GLOBALS['pmaThemeImage']
|
||||
* @uses PMA_MYSQL_INT_VERSION
|
||||
* @uses strtolower()
|
||||
* @uses str_replace()
|
||||
* @param string chapter of "HTML, one page per chapter" documentation
|
||||
* @param string contains name of page/anchor that is being linked
|
||||
* @param bool whether to use big icon (like in left frame)
|
||||
* @param string anchor to page part
|
||||
* @param string $chapter chapter of "HTML, one page per chapter" documentation
|
||||
* @param string $link contains name of page/anchor that is being linked
|
||||
* @param bool $big_icon whether to use big icon (like in left frame)
|
||||
* @param string $anchor anchor to page part
|
||||
* @param bool $just_open whether only the opening <a> tag should be returned
|
||||
*
|
||||
* @return string the html link
|
||||
*
|
||||
@ -434,8 +416,7 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
|
||||
/**
|
||||
* Displays a link to the phpMyAdmin documentation
|
||||
*
|
||||
* @param string anchor in documentation
|
||||
*
|
||||
* @param string $anchor anchor in documentation
|
||||
* @return string the html link
|
||||
*
|
||||
* @access public
|
||||
@ -451,9 +432,8 @@ function PMA_showDocu($anchor) {
|
||||
/**
|
||||
* Displays a link to the PHP documentation
|
||||
*
|
||||
* @param string anchor in documentation
|
||||
*
|
||||
* @return string the html link
|
||||
* @param string $target anchor in documentation
|
||||
* @return string the html link
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
@ -471,7 +451,9 @@ function PMA_showPHPDocu($target) {
|
||||
* returns HTML for a footnote marker and add the messsage to the footnotes
|
||||
*
|
||||
* @uses $GLOBALS['footnotes']
|
||||
* @param string the error message
|
||||
* @param string $message the error message
|
||||
* @param bool $bbcode
|
||||
* @param string $type
|
||||
* @return string html code for a footnote marker
|
||||
* @access public
|
||||
*/
|
||||
@ -532,25 +514,11 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
|
||||
* @uses PMA_SQP_isError()
|
||||
* @uses PMA_SQP_parse()
|
||||
* @uses PMA_SQP_getErrorString()
|
||||
* @uses strtolower()
|
||||
* @uses urlencode()
|
||||
* @uses str_replace()
|
||||
* @uses nl2br()
|
||||
* @uses substr()
|
||||
* @uses preg_replace()
|
||||
* @uses preg_match()
|
||||
* @uses explode()
|
||||
* @uses implode()
|
||||
* @uses is_array()
|
||||
* @uses function_exists()
|
||||
* @uses htmlspecialchars()
|
||||
* @uses trim()
|
||||
* @uses strstr()
|
||||
* @param string the error message
|
||||
* @param string the sql query that failed
|
||||
* @param boolean whether to show a "modify" link or not
|
||||
* @param string the "back" link url (full path is not required)
|
||||
* @param boolean EXIT the page?
|
||||
* @param string $error_message the error message
|
||||
* @param string $the_query the sql query that failed
|
||||
* @param bool $is_modify_link whether to show a "modify" link or not
|
||||
* @param string $back_url the "back" link url (full path is not required)
|
||||
* @param bool $exit EXIT the page?
|
||||
*
|
||||
* @global string the curent table
|
||||
* @global string the current db
|
||||
@ -663,7 +631,7 @@ function PMA_mysqlDie($error_message = '', $the_query = '',
|
||||
if ($exit) {
|
||||
/**
|
||||
* If in an Ajax request
|
||||
* - avoid displaying a Back link
|
||||
* - avoid displaying a Back link
|
||||
* - use PMA_ajaxResponse() to transmit the message and exit
|
||||
*/
|
||||
if($GLOBALS['is_ajax_request'] == true) {
|
||||
@ -781,12 +749,12 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
|
||||
$group_name = $parts[$i] . $sep;
|
||||
$group_name_full .= $group_name;
|
||||
|
||||
if (!isset($group[$group_name])) {
|
||||
if (! isset($group[$group_name])) {
|
||||
$group[$group_name] = array();
|
||||
$group[$group_name]['is' . $sep . 'group'] = true;
|
||||
$group[$group_name]['tab' . $sep . 'count'] = 1;
|
||||
$group[$group_name]['tab' . $sep . 'group'] = $group_name_full;
|
||||
} elseif (!isset($group[$group_name]['is' . $sep . 'group'])) {
|
||||
} elseif (! isset($group[$group_name]['is' . $sep . 'group'])) {
|
||||
$table = $group[$group_name];
|
||||
$group[$group_name] = array();
|
||||
$group[$group_name][$group_name] = $table;
|
||||
@ -801,7 +769,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
if (!isset($table_groups[$table_name])) {
|
||||
if (! isset($table_groups[$table_name])) {
|
||||
$table_groups[$table_name] = array();
|
||||
}
|
||||
$group =& $table_groups;
|
||||
@ -963,7 +931,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
* in a string. In some special cases on sql.php, buffering has to be disabled
|
||||
* and hence we check with $GLOBALS['buffer_message']
|
||||
*/
|
||||
if( $GLOBALS['is_ajax_request'] == true && !isset($GLOBALS['buffer_message']) ) {
|
||||
if( $GLOBALS['is_ajax_request'] == true && ! isset($GLOBALS['buffer_message']) ) {
|
||||
ob_start();
|
||||
}
|
||||
global $cfg;
|
||||
@ -1255,7 +1223,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
|
||||
// in the tools div, only display the Inline link when not in ajax
|
||||
// mode because 1) it currently does not work and 2) we would
|
||||
// have two similar mechanisms on the page for the same goal
|
||||
// have two similar mechanisms on the page for the same goal
|
||||
if ($is_select || $GLOBALS['is_ajax_request'] === false) {
|
||||
// see in js/functions.js the jQuery code attached to id inline_edit
|
||||
// document.write conflicts with jQuery, hence used $().append()
|
||||
@ -1263,7 +1231,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
"//<![CDATA[\n" .
|
||||
"$('.tools form').last().after('[<a href=\"#\" title=\"" .
|
||||
PMA_escapeJsString(__('Inline edit of this query')) .
|
||||
"\" class=\"inline_edit\">" .
|
||||
"\" class=\"inline_edit_sql\">" .
|
||||
PMA_escapeJsString(__('Inline')) .
|
||||
"</a>]');\n" .
|
||||
"//]]>\n" .
|
||||
@ -1280,7 +1248,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
|
||||
// If we are in an Ajax request, we have most probably been called in
|
||||
// PMA_ajaxResponse(). Hence, collect the buffer contents and return it
|
||||
// to PMA_ajaxResponse(), which will encode it for JSON.
|
||||
if( $GLOBALS['is_ajax_request'] == true && !isset($GLOBALS['buffer_message']) ) {
|
||||
if( $GLOBALS['is_ajax_request'] == true && ! isset($GLOBALS['buffer_message']) ) {
|
||||
$buffer_contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $buffer_contents;
|
||||
@ -1377,25 +1345,22 @@ function PMA_profilingResults($profiling_results, $show_chart = false)
|
||||
/**
|
||||
* Formats $value to byte view
|
||||
*
|
||||
* @param double the value to format
|
||||
* @param integer the sensitiveness
|
||||
* @param integer the number of decimals to retain
|
||||
* @param double $value the value to format
|
||||
* @param int $limes the sensitiveness
|
||||
* @param int $comma the number of decimals to retain
|
||||
*
|
||||
* @return array the formatted value and its unit
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @version 1.2 - 18 July 2002
|
||||
*/
|
||||
function PMA_formatByteDown($value, $limes = 6, $comma = 0)
|
||||
{
|
||||
/* l10n: shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa+ */
|
||||
$byteUnits = array(__('B'), __('KiB'), __('MiB'), __('GiB'), __('TiB'), __('PiB'), __('EiB'));
|
||||
|
||||
$dh = PMA_pow(10, $comma);
|
||||
$li = PMA_pow(10, $limes);
|
||||
$return_value = $value;
|
||||
$unit = $byteUnits[0];
|
||||
$dh = PMA_pow(10, $comma);
|
||||
$li = PMA_pow(10, $limes);
|
||||
$unit = $byteUnits[0];
|
||||
|
||||
for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) {
|
||||
if (isset($byteUnits[$d]) && $value >= $li * PMA_pow(10, $ex)) {
|
||||
@ -1421,6 +1386,9 @@ function PMA_formatByteDown($value, $limes = 6, $comma = 0)
|
||||
|
||||
/**
|
||||
* Changes thousands and decimal separators to locale specific values.
|
||||
*
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
function PMA_localizeNumber($value)
|
||||
{
|
||||
@ -1535,7 +1503,7 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
|
||||
/**
|
||||
* Returns the number of bytes when a formatted size is given
|
||||
*
|
||||
* @param string $size the size expression (for example 8MB)
|
||||
* @param string $formatted_size the size expression (for example 8MB)
|
||||
* @uses PMA_pow()
|
||||
* @return integer The numerical part of the expression (for example 8)
|
||||
*/
|
||||
@ -1556,8 +1524,8 @@ function PMA_extractValueFromFormattedSize($formatted_size)
|
||||
/**
|
||||
* Writes localised date
|
||||
*
|
||||
* @param string the current timestamp
|
||||
*
|
||||
* @param string $timestamp the current timestamp
|
||||
* @param string $format format
|
||||
* @return string the formatted date
|
||||
*
|
||||
* @access public
|
||||
@ -1767,12 +1735,14 @@ function PMA_generate_html_tabs($tabs, $url_params)
|
||||
* Displays a link, or a button if the link's URL is too large, to
|
||||
* accommodate some browsers' limitations
|
||||
*
|
||||
* @param string the URL
|
||||
* @param string the link message
|
||||
* @param string $url the URL
|
||||
* @param string $message the link message
|
||||
* @param mixed $tag_params string: js confirmation
|
||||
* array: additional tag params (f.e. style="")
|
||||
* @param boolean $new_form we set this to false when we are already in
|
||||
* a form, to avoid generating nested forms
|
||||
* @param boolean $strip_img
|
||||
* @param string $target
|
||||
*
|
||||
* @return string the results to be echoed or saved in an array
|
||||
*/
|
||||
@ -1902,13 +1872,12 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
|
||||
*
|
||||
* @uses sprintf()
|
||||
* @uses floor()
|
||||
* @param int the timespan
|
||||
* @param int $seconds the timespan
|
||||
*
|
||||
* @return string the formatted value
|
||||
*/
|
||||
function PMA_timespanFormat($seconds)
|
||||
{
|
||||
$return_string = '';
|
||||
$days = floor($seconds / 86400);
|
||||
if ($days > 0) {
|
||||
$seconds -= $days * 86400;
|
||||
@ -1933,8 +1902,8 @@ function PMA_timespanFormat($seconds)
|
||||
*
|
||||
* @todo add a multibyte safe function PMA_STR_split()
|
||||
* @uses strlen
|
||||
* @param string The string
|
||||
* @param string The Separator (defaults to "<br />\n")
|
||||
* @param string $string The string
|
||||
* @param string $Separator The Separator (defaults to "<br />\n")
|
||||
*
|
||||
* @access public
|
||||
* @return string The flipped string
|
||||
@ -1985,13 +1954,11 @@ function PMA_flipstring($string, $Separator = "<br />\n")
|
||||
* @uses PMA_getenv()
|
||||
* @uses header_meta_style.inc.php
|
||||
* @uses $GLOBALS['PMA_PHP_SELF']
|
||||
* basename
|
||||
* @param array The names of the parameters needed by the calling
|
||||
* script.
|
||||
* @param boolean Stop the execution?
|
||||
* @param array $params The names of the parameters needed by the calling script.
|
||||
* @param bool $die Stop the execution?
|
||||
* (Set this manually to false in the calling script
|
||||
* until you know all needed parameters to check).
|
||||
* @param boolean Whether to include this list in checking for special params.
|
||||
* @param bool $request Whether to include this list in checking for special params.
|
||||
* @global string path to current script
|
||||
* @global boolean flag whether any special variable was required
|
||||
*
|
||||
@ -2001,7 +1968,7 @@ function PMA_checkParameters($params, $die = true, $request = true)
|
||||
{
|
||||
global $checked_special;
|
||||
|
||||
if (!isset($checked_special)) {
|
||||
if (! isset($checked_special)) {
|
||||
$checked_special = false;
|
||||
}
|
||||
|
||||
@ -2014,7 +1981,7 @@ function PMA_checkParameters($params, $die = true, $request = true)
|
||||
$checked_special = true;
|
||||
}
|
||||
|
||||
if (!isset($GLOBALS[$param])) {
|
||||
if (! isset($GLOBALS[$param])) {
|
||||
$error_message .= $reported_script_name
|
||||
. ': Missing parameter: ' . $param
|
||||
. PMA_showDocu('faqmissingparameters')
|
||||
@ -2112,7 +2079,7 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
|
||||
. PMA_backquote($meta->orgname) . ' ';
|
||||
} // end if... else...
|
||||
|
||||
if (!isset($row[$i]) || is_null($row[$i])) {
|
||||
if (! isset($row[$i]) || is_null($row[$i])) {
|
||||
$condition .= 'IS NULL AND';
|
||||
} else {
|
||||
// timestamp is numeric on some MySQL 4.1
|
||||
@ -2171,11 +2138,12 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
|
||||
* @uses PMA_USR_BROWSER_AGENT
|
||||
* @uses $GLOBALS['pmaThemeImage']
|
||||
* @uses $GLOBALS['cfg']['PropertiesIconic']
|
||||
* @param string name of button element
|
||||
* @param string class of button element
|
||||
* @param string name of image element
|
||||
* @param string text to display
|
||||
* @param string image to display
|
||||
* @param string $button_name name of button element
|
||||
* @param string $button_class class of button element
|
||||
* @param string $image_name name of image element
|
||||
* @param string $text text to display
|
||||
* @param string $image image to display
|
||||
* @param string $value
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
@ -2211,24 +2179,19 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text,
|
||||
/**
|
||||
* Generate a pagination selector for browsing resultsets
|
||||
*
|
||||
* @uses range()
|
||||
* @param string Number of rows in the pagination set
|
||||
* @param string current page number
|
||||
* @param string number of total pages
|
||||
* @param string If the number of pages is lower than this
|
||||
* variable, no pages will be omitted in
|
||||
* pagination
|
||||
* @param string How many rows at the beginning should always
|
||||
* be shown?
|
||||
* @param string How many rows at the end should always
|
||||
* be shown?
|
||||
* @param string Percentage of calculation page offsets to
|
||||
* hop to a next page
|
||||
* @param string Near the current page, how many pages should
|
||||
* be considered "nearby" and displayed as
|
||||
* well?
|
||||
* @param string The prompt to display (sometimes empty)
|
||||
* @param int $rows Number of rows in the pagination set
|
||||
* @param int $pageNow current page number
|
||||
* @param int $nbTotalPage number of total pages
|
||||
* @param int $showAll If the number of pages is lower than this
|
||||
* variable, no pages will be omitted in pagination
|
||||
* @param int $sliceStart How many rows at the beginning should always be shown?
|
||||
* @param int $sliceEnd How many rows at the end should always be shown?
|
||||
* @param int $percent Percentage of calculation page offsets to hop to a next page
|
||||
* @param int $range Near the current page, how many pages should
|
||||
* be considered "nearby" and displayed as well?
|
||||
* @param string $prompt The prompt to display (sometimes empty)
|
||||
*
|
||||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1,
|
||||
@ -2434,8 +2397,8 @@ function PMA_userDir($dir)
|
||||
*/
|
||||
function PMA_getDbLink($database = null)
|
||||
{
|
||||
if (!strlen($database)) {
|
||||
if (!strlen($GLOBALS['db'])) {
|
||||
if (! strlen($database)) {
|
||||
if (! strlen($GLOBALS['db'])) {
|
||||
return '';
|
||||
}
|
||||
$database = $GLOBALS['db'];
|
||||
@ -2795,14 +2758,13 @@ function PMA_replace_binary_contents($content) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* If the string starts with a \r\n pair (0x0d0a) add an extra \n
|
||||
*
|
||||
* @uses strpos()
|
||||
* @param string $string
|
||||
* @return string with the chars replaced
|
||||
*/
|
||||
|
||||
function PMA_duplicateFirstNewline($string){
|
||||
function PMA_duplicateFirstNewline($string) {
|
||||
$first_occurence = strpos($string, "\r\n");
|
||||
if ($first_occurence === 0){
|
||||
$string = "\n".$string;
|
||||
@ -2811,41 +2773,40 @@ function PMA_duplicateFirstNewline($string){
|
||||
}
|
||||
|
||||
/**
|
||||
* get the action word corresponding to a script name
|
||||
* Get the action word corresponding to a script name
|
||||
* in order to display it as a title in navigation panel
|
||||
*
|
||||
* @uses $GLOBALS
|
||||
* @param string a valid value for $cfg['LeftDefaultTabTable']
|
||||
* or $cfg['DefaultTabTable']
|
||||
* or $cfg['DefaultTabDatabase']
|
||||
* @param string $target a valid value for $cfg['LeftDefaultTabTable'], $cfg['DefaultTabTable']
|
||||
* or $cfg['DefaultTabDatabase']
|
||||
* @return array
|
||||
*/
|
||||
function PMA_getTitleForTarget($target) {
|
||||
$mapping = array(
|
||||
// Values for $cfg['DefaultTabTable']
|
||||
'tbl_structure.php' => __('Structure'),
|
||||
'tbl_sql.php' => __('SQL'),
|
||||
'tbl_select.php' =>__('Search'),
|
||||
'tbl_change.php' =>__('Insert'),
|
||||
'sql.php' => __('Browse'),
|
||||
|
||||
$mapping = array(
|
||||
// Values for $cfg['DefaultTabTable']
|
||||
'tbl_structure.php' => __('Structure'),
|
||||
'tbl_sql.php' => __('SQL'),
|
||||
'tbl_select.php' =>__('Search'),
|
||||
'tbl_change.php' =>__('Insert'),
|
||||
'sql.php' => __('Browse'),
|
||||
|
||||
// Values for $cfg['DefaultTabDatabase']
|
||||
'db_structure.php' => __('Structure'),
|
||||
'db_sql.php' => __('SQL'),
|
||||
'db_search.php' => __('Search'),
|
||||
'db_operations.php' => __('Operations'),
|
||||
);
|
||||
// Values for $cfg['DefaultTabDatabase']
|
||||
'db_structure.php' => __('Structure'),
|
||||
'db_sql.php' => __('SQL'),
|
||||
'db_search.php' => __('Search'),
|
||||
'db_operations.php' => __('Operations'),
|
||||
);
|
||||
return $mapping[$target];
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats user string, expading @VARIABLES@, accepting strftime format string.
|
||||
*
|
||||
* @param string Text where to do expansion.
|
||||
* @param function Function to call for escaping variable values.
|
||||
* @param array Array with overrides for default parameters (obtained from GLOBALS).
|
||||
* @param string $string Text where to do expansion.
|
||||
* @param function $escape Function to call for escaping variable values.
|
||||
* @param array $updates Array with overrides for default parameters (obtained from GLOBALS).
|
||||
* @return string
|
||||
*/
|
||||
function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
|
||||
function PMA_expandUserString($string, $escape = null, $updates = array()) {
|
||||
/* Content */
|
||||
$vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '';
|
||||
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
|
||||
@ -2911,12 +2872,10 @@ function PMA_expandUserString($string, $escape = NULL, $updates = array()) {
|
||||
* function that generates a json output for an ajax request and ends script
|
||||
* execution
|
||||
*
|
||||
* @param boolean success whether the ajax request was successfull
|
||||
* @param string message string containing the html of the message
|
||||
* @param array extra_data optional - any other data as part of the json request
|
||||
* @param bool $message message string containing the html of the message
|
||||
* @param bool $success success whether the ajax request was successfull
|
||||
* @param array $extra_data extra_data optional - any other data as part of the json request
|
||||
*
|
||||
* @uses header()
|
||||
* @uses json_encode()
|
||||
*/
|
||||
function PMA_ajaxResponse($message, $success = true, $extra_data = array())
|
||||
{
|
||||
@ -2960,9 +2919,10 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
|
||||
|
||||
/**
|
||||
* Display the form used to browse anywhere on the local server for the file to import
|
||||
*
|
||||
* @param $max_upload_size
|
||||
*/
|
||||
function PMA_browseUploadFile($max_upload_size) {
|
||||
$uid = uniqid("");
|
||||
echo '<label for="radio_import_file">' . __("Browse your computer:") . '</label>';
|
||||
echo '<div id="upload_form_status" style="display: none;"></div>';
|
||||
echo '<div id="upload_form_status_info" style="display: none;"></div>';
|
||||
@ -2974,6 +2934,9 @@ function PMA_browseUploadFile($max_upload_size) {
|
||||
|
||||
/**
|
||||
* Display the form used to select a file to import from the server upload directory
|
||||
*
|
||||
* @param $import_list
|
||||
* @param $uploaddir
|
||||
*/
|
||||
function PMA_selectUploadFile($import_list, $uploaddir) {
|
||||
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
|
||||
|
||||
@ -338,6 +338,13 @@ $cfg['Servers'][$i]['history'] = '';
|
||||
*/
|
||||
$cfg['Servers'][$i]['designer_coords'] = '';
|
||||
|
||||
/**
|
||||
* table to store recently used tables
|
||||
* - leave blank for no "persistent" recently used tables
|
||||
* SUGGESTED: 'pma_recent'
|
||||
*/
|
||||
$cfg['Servers'][$i]['recent'] = '';
|
||||
|
||||
/**
|
||||
* table to store SQL tracking
|
||||
* - leave blank for no SQL tracking
|
||||
@ -794,6 +801,13 @@ $cfg['LeftLogoLink'] = 'main.php';
|
||||
*/
|
||||
$cfg['LeftLogoLinkWindow'] = 'main';
|
||||
|
||||
/**
|
||||
* number of recently used tables displayed in the navigation frame
|
||||
*
|
||||
* @global integer $cfg['LeftRecentTable']
|
||||
*/
|
||||
$cfg['LeftRecentTable'] = 10;
|
||||
|
||||
/**
|
||||
* display a JavaScript table filter in the left frame
|
||||
* when more then x tables are present
|
||||
|
||||
@ -159,6 +159,7 @@ $cfg_db['_validators'] = array(
|
||||
'Import/skip_queries' => 'validate_non_negative_number',
|
||||
'InsertRows' => 'validate_positive_number',
|
||||
'LeftFrameTableLevel' => 'validate_positive_number',
|
||||
'LeftRecentTable' => 'validate_non_negative_number',
|
||||
'LimitChars' => 'validate_positive_number',
|
||||
'LoginCookieValidity' => 'validate_positive_number',
|
||||
'LoginCookieStore' => 'validate_non_negative_number',
|
||||
|
||||
@ -127,6 +127,7 @@ $strConfigExport_sql_hex_for_blob_name = __('Use hexadecimal for BLOB');
|
||||
$strConfigExport_sql_if_not_exists_name = sprintf(__('Add %s'), 'IF NOT EXISTS');
|
||||
$strConfigExport_sql_ignore_name = __('Use ignore inserts');
|
||||
$strConfigExport_sql_include_comments_name = __('Comments');
|
||||
$strConfigExport_sql_insert_syntax_name = __('Syntax to use when inserting data');
|
||||
$strConfigExport_sql_max_query_size_name = __('Maximal length of created query');
|
||||
$strConfigExport_sql_mime_name = __('MIME type');
|
||||
$strConfigExport_sql_procedure_function_name = sprintf(__('Add %s'), 'CREATE PROCEDURE / FUNCTION / EVENT');
|
||||
@ -282,6 +283,8 @@ $strConfigLeftLogoLinkWindow_desc = __('Open the linked page in the main window
|
||||
$strConfigLeftLogoLinkWindow_name = __('Logo link target');
|
||||
$strConfigLeftPointerEnable_desc = __('Highlight server under the mouse cursor');
|
||||
$strConfigLeftPointerEnable_name = __('Enable highlighting');
|
||||
$strConfigLeftRecentTable_desc = __('Maximum number of recently used tables; set 0 to disable');
|
||||
$strConfigLeftRecentTable_name = __('Recently used tables');
|
||||
$strConfigLightTabs_desc = __('Use less graphically intense tabs');
|
||||
$strConfigLightTabs_name = __('Light tabs');
|
||||
$strConfigLimitChars_desc = __('Maximum number of characters shown in any non-numeric column on browse view');
|
||||
@ -400,6 +403,8 @@ $strConfigServers_pmadb_desc = __('Database used for relations, bookmarks, and P
|
||||
$strConfigServers_pmadb_name = __('Database name');
|
||||
$strConfigServers_port_desc = __('Port on which MySQL server is listening, leave empty for default');
|
||||
$strConfigServers_port_name = __('Server port');
|
||||
$strConfigServers_recent_desc = __('Leave blank for no "persistent" recently used tables across sessions, suggested: [kbd]pma_recent[/kbd]');
|
||||
$strConfigServers_recent_name = __('Recently used table');
|
||||
$strConfigServers_relation_desc = __('Leave blank for no [a@http://wiki.phpmyadmin.net/pma/relation]relation-links[/a] support, suggested: [kbd]pma_relation[/kbd]');
|
||||
$strConfigServers_relation_name = __('Relation table');
|
||||
$strConfigServers_ShowDatabasesCommand_desc = __('SQL command to fetch available databases');
|
||||
|
||||
@ -73,6 +73,7 @@ $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array(
|
||||
'table_info' => 'pma_table_info',
|
||||
'column_info' => 'pma_column_info',
|
||||
'history' => 'pma_history',
|
||||
'recent' => 'pma_recent',
|
||||
'tracking' => 'pma_tracking',
|
||||
'table_coords' => 'pma_table_coords',
|
||||
'pdf_pages' => 'pma_pdf_pages',
|
||||
@ -162,7 +163,8 @@ $forms['Left_frame']['Left_frame'] = array(
|
||||
'LeftDisplayLogo',
|
||||
'LeftLogoLink',
|
||||
'LeftLogoLinkWindow',
|
||||
'LeftPointerEnable');
|
||||
'LeftPointerEnable',
|
||||
'LeftRecentTable');
|
||||
$forms['Left_frame']['Left_servers'] = array(
|
||||
'LeftDisplayServers',
|
||||
'DisplayServersList');
|
||||
|
||||
@ -77,7 +77,8 @@ $forms['Left_frame']['Left_frame'] = array(
|
||||
'LeftDisplayLogo',
|
||||
'LeftLogoLink',
|
||||
'LeftLogoLinkWindow',
|
||||
'LeftPointerEnable');
|
||||
'LeftPointerEnable',
|
||||
'LeftRecentTable');
|
||||
$forms['Left_frame']['Left_databases'] = array(
|
||||
'DisplayDatabasesList',
|
||||
'LeftFrameDBTree',
|
||||
|
||||
@ -386,7 +386,7 @@ function PMA_array_merge_recursive()
|
||||
break;
|
||||
case 2 :
|
||||
$args = func_get_args();
|
||||
if (!is_array($args[0]) || !is_array($args[1])) {
|
||||
if (! is_array($args[0]) || ! is_array($args[1])) {
|
||||
return $args[1];
|
||||
}
|
||||
foreach ($args[1] as $key2 => $value2) {
|
||||
@ -603,7 +603,7 @@ function PMA_array_read($path, $array, $default = null)
|
||||
$keys = explode('/', $path);
|
||||
$value =& $array;
|
||||
foreach ($keys as $key) {
|
||||
if (!isset($value[$key])) {
|
||||
if (! isset($value[$key])) {
|
||||
return $default;
|
||||
}
|
||||
$value =& $value[$key];
|
||||
@ -624,7 +624,7 @@ function PMA_array_write($path, &$array, $value)
|
||||
$last_key = array_pop($keys);
|
||||
$a =& $array;
|
||||
foreach ($keys as $key) {
|
||||
if (!isset($a[$key])) {
|
||||
if (! isset($a[$key])) {
|
||||
$a[$key] = array();
|
||||
}
|
||||
$a =& $a[$key];
|
||||
@ -650,7 +650,7 @@ function PMA_array_remove($path, &$array)
|
||||
$found = true;
|
||||
// go as deep as required or possible
|
||||
foreach ($keys as $key) {
|
||||
if (!isset($path[$depth][$key])) {
|
||||
if (! isset($path[$depth][$key])) {
|
||||
$found = false;
|
||||
break;
|
||||
}
|
||||
@ -665,7 +665,7 @@ function PMA_array_remove($path, &$array)
|
||||
|
||||
// remove empty nested arrays
|
||||
for (; $depth >= 0; $depth--) {
|
||||
if (!isset($path[$depth+1]) || count($path[$depth+1]) == 0) {
|
||||
if (! isset($path[$depth+1]) || count($path[$depth+1]) == 0) {
|
||||
unset($path[$depth][$keys[$depth]]);
|
||||
} else {
|
||||
break;
|
||||
@ -681,12 +681,12 @@ function PMA_array_remove($path, &$array)
|
||||
* @return string URL for a link.
|
||||
*/
|
||||
function PMA_linkURL($url) {
|
||||
if (!preg_match('#^https?://#', $url)) {
|
||||
if (!preg_match('#^https?://#', $url) || defined('PMA_SETUP')) {
|
||||
return $url;
|
||||
} elseif (defined('PMA_SETUP')) {
|
||||
return '../url.php?url=' . $url;
|
||||
} else {
|
||||
return './url.php?url=' . $url;
|
||||
$params = array();
|
||||
$params['url'] = $url;
|
||||
return './url.php' . PMA_generate_common_url($params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ function PMA_usort_comparison_callback($a, $b)
|
||||
$sorter = 'strcasecmp';
|
||||
}
|
||||
/* No sorting when key is not present */
|
||||
if (!isset($a[$GLOBALS['callback_sort_by']]) || ! isset($b[$GLOBALS['callback_sort_by']])) {
|
||||
if (! isset($a[$GLOBALS['callback_sort_by']]) || ! isset($b[$GLOBALS['callback_sort_by']])) {
|
||||
return 0;
|
||||
}
|
||||
// produces f.e.:
|
||||
@ -774,29 +774,6 @@ function PMA_DBI_get_columns_full($database = null, $table = null,
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo should only return columns names, for more info use PMA_DBI_get_columns_full()
|
||||
*
|
||||
* @deprecated by PMA_DBI_get_columns() or PMA_DBI_get_columns_full()
|
||||
* @param string $database name of database
|
||||
* @param string $table name of table to retrieve columns from
|
||||
* @param mixed $link mysql link resource
|
||||
* @return array column info
|
||||
*/
|
||||
function PMA_DBI_get_fields($database, $table, $link = null)
|
||||
{
|
||||
// here we use a try_query because when coming from
|
||||
// tbl_create + tbl_properties.inc.php, the table does not exist
|
||||
$fields = PMA_DBI_fetch_result(
|
||||
'SHOW FULL COLUMNS
|
||||
FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table),
|
||||
null, null, $link);
|
||||
if (! is_array($fields) || count($fields) < 1) {
|
||||
return false;
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* array PMA_DBI_get_columns(string $database, string $table, bool $full = false, mysql db link $link = null)
|
||||
*
|
||||
|
||||
@ -152,7 +152,7 @@ if (true === $cfg['SkipLockedTables']) {
|
||||
null, PMA_DBI_QUERY_STORE);
|
||||
if ($db_info_result && PMA_DBI_num_rows($db_info_result) > 0) {
|
||||
while ($tmp = PMA_DBI_fetch_row($db_info_result)) {
|
||||
if (!isset($sot_cache[$tmp[0]])) {
|
||||
if (! isset($sot_cache[$tmp[0]])) {
|
||||
$sts_result = PMA_DBI_query(
|
||||
'SHOW TABLE STATUS FROM ' . PMA_backquote($db)
|
||||
. ' LIKE \'' . addslashes($tmp[0]) . '\';');
|
||||
@ -160,7 +160,7 @@ if (true === $cfg['SkipLockedTables']) {
|
||||
PMA_DBI_free_result($sts_result);
|
||||
unset($sts_result);
|
||||
|
||||
if (!isset($sts_tmp['Type']) && isset($sts_tmp['Engine'])) {
|
||||
if (! isset($sts_tmp['Type']) && isset($sts_tmp['Engine'])) {
|
||||
$sts_tmp['Type'] =& $sts_tmp['Engine'];
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ if ($is_create_db_priv) {
|
||||
// The user is allowed to create a db
|
||||
?>
|
||||
<form method="post" action="db_create.php" id="create_database_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax" ' : ''); ?>><strong>
|
||||
<?php echo '<label for="text_create_db">' . __('Create new database') . '</label> ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
|
||||
<?php echo '<label for="text_create_db">' . __('Create database') . '</label> ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
|
||||
<?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
|
||||
<input type="hidden" name="reload" value="1" />
|
||||
<input type="text" name="new_db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" id="text_create_db"/>
|
||||
@ -36,7 +36,7 @@ if ($is_create_db_priv) {
|
||||
} else {
|
||||
?>
|
||||
<!-- db creation no privileges message -->
|
||||
<strong><?php echo __('Create new database') . ': ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
|
||||
<strong><?php echo __('Create database') . ': ' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
|
||||
<?php
|
||||
echo '<span class="noPrivileges">'
|
||||
. ($cfg['ErrorIconic'] ? '<img src="' . $pmaThemeImage . 's_error2.png" alt="" width="11" height="11" hspace="2" border="0" align="middle" />' : '')
|
||||
|
||||
@ -65,7 +65,7 @@ echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' .
|
||||
// If the export method was not set, the default is quick
|
||||
if(isset($_GET['export_method'])) {
|
||||
$cfg['Export']['method'] = $_GET['export_method'];
|
||||
} elseif(!isset($cfg['Export']['method'])) {
|
||||
} elseif(! isset($cfg['Export']['method'])) {
|
||||
$cfg['Export']['method'] = 'quick';
|
||||
}
|
||||
// The export method (quick, custom or custom-no-form)
|
||||
@ -296,7 +296,9 @@ if(isset($_GET['sql_query'])) {
|
||||
?>
|
||||
<?php
|
||||
if(isset($_GET['compression'])) {
|
||||
$selected_compression = $_GET['compression'];
|
||||
$selected_compression = $_GET['compression'];
|
||||
} elseif (isset($cfg['Export']['compression'])) {
|
||||
$selected_compression = $cfg['Export']['compression'];
|
||||
} else {
|
||||
$selected_compression = "none";
|
||||
}
|
||||
|
||||
@ -1091,7 +1091,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($map)) {
|
||||
if (! is_array($map)) {
|
||||
$map = array();
|
||||
}
|
||||
$row_no = 0;
|
||||
@ -1272,7 +1272,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
$condition_field = false;
|
||||
}
|
||||
|
||||
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
|
||||
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical' && (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
|
||||
// the row number corresponds to a data row, not HTML table row
|
||||
$class .= ' row_' . $row_no;
|
||||
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
|
||||
@ -1328,7 +1328,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
// will show both fields NULL even if only one is NULL,
|
||||
// so use the $pointer
|
||||
|
||||
if (!isset($row[$i]) || is_null($row[$i])) {
|
||||
if (! isset($row[$i]) || is_null($row[$i])) {
|
||||
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field);
|
||||
} elseif ($row[$i] != '') {
|
||||
|
||||
@ -1351,7 +1351,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
$class = str_replace('inline_edit', '', $class);
|
||||
|
||||
if (stristr($field_flags, 'BINARY')) {
|
||||
if (!isset($row[$i]) || is_null($row[$i])) {
|
||||
if (! isset($row[$i]) || is_null($row[$i])) {
|
||||
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field);
|
||||
} else {
|
||||
// for blobstreaming
|
||||
@ -1367,7 +1367,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
}
|
||||
// not binary:
|
||||
} else {
|
||||
if (!isset($row[$i]) || is_null($row[$i])) {
|
||||
if (! isset($row[$i]) || is_null($row[$i])) {
|
||||
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field);
|
||||
} elseif ($row[$i] != '') {
|
||||
// if a transform function for blob is set, none of these replacements will be made
|
||||
@ -1395,7 +1395,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
|
||||
// n o t n u m e r i c a n d n o t B L O B
|
||||
} else {
|
||||
if (!isset($row[$i]) || is_null($row[$i])) {
|
||||
if (! isset($row[$i]) || is_null($row[$i])) {
|
||||
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field);
|
||||
} elseif ($row[$i] != '') {
|
||||
// support blanks in the key
|
||||
@ -1477,7 +1477,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
|
||||
// 4. Gather links of del_urls and edit_urls in an array for later
|
||||
// output
|
||||
if (!isset($vertical_display['edit'][$row_no])) {
|
||||
if (! isset($vertical_display['edit'][$row_no])) {
|
||||
$vertical_display['edit'][$row_no] = '';
|
||||
$vertical_display['copy'][$row_no] = '';
|
||||
$vertical_display['delete'][$row_no] = '';
|
||||
@ -1563,7 +1563,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -1581,7 +1581,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -1599,7 +1599,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['edit']) && !is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -1652,7 +1652,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -1670,7 +1670,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -1688,7 +1688,7 @@ function PMA_displayVerticalTable()
|
||||
// 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']))) {
|
||||
echo '<tr>' . "\n";
|
||||
if (!is_array($vertical_display['edit']) && !is_array($vertical_display['row_delete'])) {
|
||||
if (! is_array($vertical_display['edit']) && ! is_array($vertical_display['row_delete'])) {
|
||||
echo $vertical_display['textbtn'];
|
||||
}
|
||||
$foo_counter = 0;
|
||||
@ -2070,7 +2070,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
|
||||
PMA_showMessage($message, $sql_query, 'success');
|
||||
|
||||
} elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
} elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
PMA_showMessage(__('Your SQL query has been executed successfully'), $sql_query, 'success');
|
||||
}
|
||||
|
||||
@ -2090,7 +2090,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
if ($is_display['nav_bar'] == '1') {
|
||||
PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'top_direction_dropdown');
|
||||
echo "\n";
|
||||
} elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
} elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
echo "\n" . '<br /><br />' . "\n";
|
||||
}
|
||||
|
||||
@ -2212,12 +2212,12 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
if ($is_display['nav_bar'] == '1') {
|
||||
echo '<br />' . "\n";
|
||||
PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown');
|
||||
} elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
} elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
echo "\n" . '<br /><br />' . "\n";
|
||||
}
|
||||
|
||||
// 6. ----- Displays "Query results operations"
|
||||
if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
|
||||
PMA_displayResultsOperations($the_disp_mode, $analyzed_sql);
|
||||
}
|
||||
} // end of the 'PMA_displayTable()' function
|
||||
@ -2298,8 +2298,8 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
|
||||
// If the parser found a PROCEDURE clause
|
||||
// (most probably PROCEDURE ANALYSE()) it makes no sense to
|
||||
// display the Export link).
|
||||
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview) && ! isset($analyzed_sql[0]['queryflags']['procedure'])) {
|
||||
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
|
||||
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT' && ! isset($printview) && ! isset($analyzed_sql[0]['queryflags']['procedure'])) {
|
||||
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && ! isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
|
||||
$_url_params['single_table'] = 'true';
|
||||
}
|
||||
if (!$header_shown) {
|
||||
@ -2381,7 +2381,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
|
||||
} elseif (isset($content)) {
|
||||
$size = strlen($content);
|
||||
$display_size = PMA_formatByteDown($size, 3, 1);
|
||||
$result .= ' - '. $display_size[0] . $display_size[1];
|
||||
$result .= ' - '. $display_size[0] . ' ' . $display_size[1];
|
||||
}
|
||||
$result .= ']';
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ if (window.parent.frame_content) {
|
||||
}
|
||||
|
||||
// Link to itself to replicate windows including frameset
|
||||
if (!isset($GLOBALS['checked_special'])) {
|
||||
if (! isset($GLOBALS['checked_special'])) {
|
||||
$GLOBALS['checked_special'] = false;
|
||||
}
|
||||
|
||||
|
||||
@ -8,12 +8,26 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
require_once './libraries/RecentTable.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Add recently used table and reload the navigation.
|
||||
*
|
||||
* @param string $db Database name where the table is located.
|
||||
* @param string $table The table name
|
||||
*/
|
||||
function PMA_addRecentTable($db, $table) {
|
||||
$tmp_result = RecentTable::getInstance()->add($db, $table);
|
||||
if ($tmp_result === true) {
|
||||
echo '<span class="hide" id="update_recent_tables"></span>';
|
||||
} else {
|
||||
$error = $tmp_result;
|
||||
$error->display();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not an Ajax request so we need to generate all this output.
|
||||
*/
|
||||
@ -30,7 +44,7 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
|
||||
// if database storage for user preferences is transient, offer to load
|
||||
// exported settings from localStorage (detection will be done in JavaScript)
|
||||
$userprefs_offer_import = $GLOBALS['PMA_Config']->get('user_preferences') == 'session'
|
||||
&& !isset($_SESSION['userprefs_autoload']);
|
||||
&& ! isset($_SESSION['userprefs_autoload']);
|
||||
if ($userprefs_offer_import) {
|
||||
$GLOBALS['js_include'][] = 'config.js';
|
||||
}
|
||||
@ -123,7 +137,7 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
|
||||
PMA_generate_common_url($GLOBALS['db']),
|
||||
htmlspecialchars($GLOBALS['db']),
|
||||
__('Database'),
|
||||
's_tbl.png');
|
||||
's_db.png');
|
||||
// if the table is being dropped, $_REQUEST['purge'] is set
|
||||
// (it always contains "1")
|
||||
// so do not display the table name in upper div
|
||||
@ -143,7 +157,7 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
|
||||
* @uses $show_comment from libraries/tbl_info.inc.php
|
||||
* @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
|
||||
*/
|
||||
if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
|
||||
if (!empty($show_comment) && ! isset($GLOBALS['avoid_show_comment'])) {
|
||||
if (strstr($show_comment, '; InnoDB free')) {
|
||||
$show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
|
||||
}
|
||||
@ -151,6 +165,11 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
|
||||
.'"' . htmlspecialchars($show_comment)
|
||||
.'"</span>' . "\n";
|
||||
} // end if
|
||||
|
||||
// add recently used table and reload the navigation
|
||||
if ($GLOBALS['cfg']['LeftRecentTable'] > 0) {
|
||||
PMA_addRecentTable($GLOBALS['db'], $GLOBALS['table']);
|
||||
}
|
||||
} else {
|
||||
// no table selected, display database comment if present
|
||||
/**
|
||||
|
||||
@ -127,7 +127,7 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
|
||||
}
|
||||
$msg = '# ';
|
||||
if ($result === FALSE) { // execution failed
|
||||
if (!isset($my_die)) {
|
||||
if (! isset($my_die)) {
|
||||
$my_die = array();
|
||||
}
|
||||
$my_die[] = array('sql' => $import_run_buffer['full'], 'error' => PMA_DBI_getError());
|
||||
@ -697,7 +697,7 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
|
||||
/**
|
||||
* This is the first row to be analyzed
|
||||
*/
|
||||
elseif (!isset($last_cumulative_type) || $last_cumulative_type == NONE) {
|
||||
elseif (! isset($last_cumulative_type) || $last_cumulative_type == NONE) {
|
||||
return $curr_size;
|
||||
}
|
||||
/**
|
||||
|
||||
@ -38,7 +38,7 @@ if (isset($plugin_list)) {
|
||||
} else {
|
||||
$hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.'));
|
||||
$plugin_list['csv']['options'][] =
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ' . PMA_showHint($hint)));
|
||||
array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ') . PMA_showHint($hint));
|
||||
}
|
||||
$plugin_list['csv']['options'][] = array('type' => 'end_group');
|
||||
|
||||
@ -106,7 +106,7 @@ if (!$analyze) {
|
||||
}
|
||||
$sql_template .= ' INTO ' . PMA_backquote($table);
|
||||
|
||||
$tmp_fields = PMA_DBI_get_fields($db, $table);
|
||||
$tmp_fields = PMA_DBI_get_columns($db, $table);
|
||||
|
||||
if (empty($csv_columns)) {
|
||||
$fields = $tmp_fields;
|
||||
|
||||
@ -29,6 +29,9 @@ if (! empty($submit_mult)
|
||||
} else {
|
||||
$selected = $selected_tbl;
|
||||
switch ($submit_mult) {
|
||||
case 'add_prefix_tbl':
|
||||
case 'replace_prefix_tbl':
|
||||
case 'copy_tbl_change_prefix':
|
||||
case 'drop_db':
|
||||
case 'drop_tbl':
|
||||
case 'empty_tbl':
|
||||
@ -238,16 +241,50 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
<?php
|
||||
echo PMA_generate_common_hidden_inputs($_url_params);
|
||||
?>
|
||||
<fieldset class="confirmation">
|
||||
<legend><?php echo ($what == 'drop_db' ? __('You are about to DESTROY a complete database!') . ' ' : '') . __('Do you really want to '); ?>:</legend>
|
||||
<tt><?php echo $full_query; ?></tt>
|
||||
</fieldset>
|
||||
<fieldset class="tblFooters">
|
||||
<input type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes" />
|
||||
<input type="submit" name="mult_btn" value="<?php echo __('No'); ?>" id="buttonNo" />
|
||||
</fieldset>
|
||||
<?php if ($what == 'replace_prefix_tbl' || $what == 'copy_tbl_change_prefix'){ ?>
|
||||
<fieldset class = "input">
|
||||
<legend><?php echo ($what == 'replace_prefix_tbl' ? __('Replace table prefix') : __('Copy table with prefix')) ?>:</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo __('From'); ?></td><td><input type="text" name="from_prefix" id="initialPrefix"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('To'); ?> </td><td><input type="text" name="to_prefix" id="newPrefix"</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="tblFooters">
|
||||
<button type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes"><? echo __('Submit'); ?></button>
|
||||
</fieldset>
|
||||
<?php
|
||||
require './libraries/footer.inc.php';
|
||||
}
|
||||
elseif($what == 'add_prefix_tbl'){ ?>
|
||||
<fieldset class = "input">
|
||||
<legend><?php echo __('Add table prefix') ?>:</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo __('Add prefix'); ?></td> <td><input type="text" name="add_prefix" id="txtPrefix"</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="tblFooters">
|
||||
<button type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes"><? echo __('Submit'); ?></button>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
else { ?>
|
||||
<fieldset class="confirmation">
|
||||
<legend><?php echo ($what == 'drop_db' ? __('You are about to DESTROY a complete database!') . ' ' : '') . __('Do you really want to '); ?>:</legend>
|
||||
<tt><?php echo $full_query; ?></tt>
|
||||
</fieldset>
|
||||
<fieldset class="tblFooters">
|
||||
<input type="submit" name="mult_btn" value="<?php echo __('Yes'); ?>" id="buttonYes" />
|
||||
<input type="submit" name="mult_btn" value="<?php echo __('No'); ?>" id="buttonNo" />
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
require './libraries/footer.inc.php';
|
||||
|
||||
} // end if
|
||||
|
||||
|
||||
@ -373,6 +410,27 @@ elseif ($mult_btn == __('Yes')) {
|
||||
. PMA_backquote($selected[$i])
|
||||
. (($i == $selected_cnt-1) ? ');' : '');
|
||||
break;
|
||||
|
||||
case 'add_prefix_tbl':
|
||||
$newtablename = $add_prefix . $selected[$i];
|
||||
$a_query = 'ALTER TABLE ' . PMA_backquote($selected[$i]) . ' RENAME ' . PMA_backquote($newtablename) ; // ADD PREFIX TO TABLE NAME
|
||||
$run_parts = true;
|
||||
break;
|
||||
|
||||
case 'replace_prefix_tbl':
|
||||
$current = $selected[$i];
|
||||
$newtablename = preg_replace("/^" . $from_prefix . "/" , $to_prefix , $current);
|
||||
$a_query = 'ALTER TABLE ' . PMA_backquote($selected[$i]) . ' RENAME ' . PMA_backquote($newtablename) ; // CHANGE PREFIX PATTERN
|
||||
$run_parts = true;
|
||||
break;
|
||||
|
||||
case 'copy_tbl_change_prefix':
|
||||
$current = $selected[$i];
|
||||
$newtablename = preg_replace("/^" . $from_prefix . "/" , $to_prefix , $current);
|
||||
$a_query = 'CREATE TABLE ' . PMA_backquote($newtablename) . ' SELECT * FROM ' . PMA_backquote($selected[$i]) ; // COPY TABLE AND CHANGE PREFIX PATTERN
|
||||
$run_parts = true;
|
||||
break;
|
||||
|
||||
} // end switch
|
||||
|
||||
// All "DROP TABLE", "DROP FIELD", "OPTIMIZE TABLE" and "REPAIR TABLE"
|
||||
|
||||
@ -37,7 +37,7 @@ if (! PMA_cacheExists('mysql_charsets_count', true)) {
|
||||
: 'SELECT * FROM information_schema.COLLATIONS';
|
||||
$res = PMA_DBI_query($sql);
|
||||
while ($row = PMA_DBI_fetch_assoc($res)) {
|
||||
if (!is_array($mysql_collations[$row['CHARACTER_SET_NAME']])) {
|
||||
if (! is_array($mysql_collations[$row['CHARACTER_SET_NAME']])) {
|
||||
$mysql_collations[$row['CHARACTER_SET_NAME']] = array($row['COLLATION_NAME']);
|
||||
} else {
|
||||
$mysql_collations[$row['CHARACTER_SET_NAME']][] = $row['COLLATION_NAME'];
|
||||
@ -46,7 +46,7 @@ if (! PMA_cacheExists('mysql_charsets_count', true)) {
|
||||
if ($row['IS_DEFAULT'] == 'Yes') {
|
||||
$mysql_default_collations[$row['CHARACTER_SET_NAME']] = $row['COLLATION_NAME'];
|
||||
}
|
||||
//$mysql_collations_available[$row['Collation']] = !isset($row['Compiled']) || $row['Compiled'] == 'Yes';
|
||||
//$mysql_collations_available[$row['Collation']] = ! isset($row['Compiled']) || $row['Compiled'] == 'Yes';
|
||||
$mysql_collations_available[$row['COLLATION_NAME']] = true;
|
||||
$mysql_charsets_available[$row['CHARACTER_SET_NAME']] =
|
||||
!empty($mysql_charsets_available[$row['CHARACTER_SET_NAME']])
|
||||
|
||||
0
libraries/php-gettext/gettext.php
Executable file → Normal file
0
libraries/php-gettext/gettext.php
Executable file → Normal file
@ -71,7 +71,7 @@ function PMA_getString($name)
|
||||
function PMA_pluginCheckboxCheck($section, $opt)
|
||||
{
|
||||
// If the form is being repopulated using $_GET data, that is priority
|
||||
if (isset($_GET[$opt]) || !isset($_GET['repopulate']) && ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
|
||||
if (isset($_GET[$opt]) || ! isset($_GET['repopulate']) && ((isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) ||
|
||||
(isset($GLOBALS['cfg'][$section][$opt]) && $GLOBALS['cfg'][$section][$opt]))) {
|
||||
return ' checked="checked"';
|
||||
}
|
||||
@ -160,7 +160,7 @@ function PMA_pluginIsActive($section, $opt, $val)
|
||||
*/
|
||||
function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
{
|
||||
if (!isset($cfgname)) {
|
||||
if (! isset($cfgname)) {
|
||||
$cfgname = $name;
|
||||
}
|
||||
$ret = '<select id="plugins" name="' . $name . '">';
|
||||
@ -168,7 +168,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL)
|
||||
foreach ($list as $plugin_name => $val) {
|
||||
$ret .= '<option';
|
||||
// If the form is being repopulated using $_GET data, that is priority
|
||||
if(isset($_GET[$name]) && $plugin_name == $_GET[$name] || !isset($_GET[$name]) && $plugin_name == $default) {
|
||||
if(isset($_GET[$name]) && $plugin_name == $_GET[$name] || ! isset($_GET[$name]) && $plugin_name == $default) {
|
||||
$ret .= ' selected="selected"';
|
||||
}
|
||||
$ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . '</option>' . "\n";
|
||||
|
||||
@ -138,6 +138,10 @@ function PMA_printRelationsParamDiagnostic($cfgRelation)
|
||||
|
||||
PMA_printDiagMessageForFeature(__('Designer'), 'designerwork', $messages);
|
||||
|
||||
PMA_printDiagMessageForParameter('recent', isset($cfgRelation['recent']), $messages, 'recent');
|
||||
|
||||
PMA_printDiagMessageForFeature(__('Persistent recently used tables'), 'recentwork', $messages);
|
||||
|
||||
PMA_printDiagMessageForParameter('tracking', isset($cfgRelation['tracking']), $messages, 'tracking');
|
||||
|
||||
PMA_printDiagMessageForFeature(__('Tracking'), 'trackingwork', $messages);
|
||||
@ -220,6 +224,7 @@ function PMA__getRelationsParam()
|
||||
$cfgRelation['commwork'] = false;
|
||||
$cfgRelation['mimework'] = false;
|
||||
$cfgRelation['historywork'] = false;
|
||||
$cfgRelation['recentwork'] = false;
|
||||
$cfgRelation['trackingwork'] = false;
|
||||
$cfgRelation['designerwork'] = false;
|
||||
$cfgRelation['userconfigwork'] = false;
|
||||
@ -271,6 +276,8 @@ function PMA__getRelationsParam()
|
||||
$cfgRelation['pdf_pages'] = $curr_table[0];
|
||||
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['history']) {
|
||||
$cfgRelation['history'] = $curr_table[0];
|
||||
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['recent']) {
|
||||
$cfgRelation['recent'] = $curr_table[0];
|
||||
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['tracking']) {
|
||||
$cfgRelation['tracking'] = $curr_table[0];
|
||||
} elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['userconfig']) {
|
||||
@ -325,6 +332,10 @@ function PMA__getRelationsParam()
|
||||
$cfgRelation['historywork'] = true;
|
||||
}
|
||||
|
||||
if (isset($cfgRelation['recent'])) {
|
||||
$cfgRelation['recentwork'] = true;
|
||||
}
|
||||
|
||||
if (isset($cfgRelation['tracking'])) {
|
||||
$cfgRelation['trackingwork'] = true;
|
||||
}
|
||||
@ -346,8 +357,9 @@ function PMA__getRelationsParam()
|
||||
if ($cfgRelation['relwork'] && $cfgRelation['displaywork']
|
||||
&& $cfgRelation['pdfwork'] && $cfgRelation['commwork']
|
||||
&& $cfgRelation['mimework'] && $cfgRelation['historywork']
|
||||
&& $cfgRelation['trackingwork'] && $cfgRelation['userconfigwork']
|
||||
&& $cfgRelation['bookmarkwork'] && $cfgRelation['designerwork']) {
|
||||
&& $cfgRelation['recentwork'] && $cfgRelation['trackingwork']
|
||||
&& $cfgRelation['userconfigwork'] && $cfgRelation['bookmarkwork']
|
||||
&& $cfgRelation['designerwork']) {
|
||||
$cfgRelation['allworks'] = true;
|
||||
}
|
||||
|
||||
@ -517,7 +529,7 @@ function PMA_getDisplayField($db, $table)
|
||||
* Gets the comments for all rows of a table or the db itself
|
||||
*
|
||||
* @access public
|
||||
* @uses PMA_DBI_get_fields()
|
||||
* @uses PMA_DBI_get_columns()
|
||||
* @uses PMA_getDbComment()
|
||||
* @param string the name of the db to check for
|
||||
* @param string the name of the table to check for
|
||||
@ -529,9 +541,9 @@ function PMA_getComments($db, $table = '')
|
||||
|
||||
if ($table != '') {
|
||||
// MySQL native column comments
|
||||
$fields = PMA_DBI_get_fields($db, $table);
|
||||
$fields = PMA_DBI_get_columns($db, $table);
|
||||
if ($fields) {
|
||||
foreach ($fields as $key => $field) {
|
||||
foreach ($fields as $field) {
|
||||
if (! empty($field['Comment'])) {
|
||||
$comments[$field['Field']] = $field['Comment'];
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ function PMA_replication_print_slaves_table($hidden = false) {
|
||||
*/
|
||||
|
||||
function PMA_replication_get_username_hostname_length() {
|
||||
$fields_info = PMA_DBI_get_fields('mysql', 'user');
|
||||
$fields_info = PMA_DBI_get_columns('mysql', 'user');
|
||||
$username_length = 16;
|
||||
$hostname_length = 41;
|
||||
foreach ($fields_info as $key => $val) {
|
||||
|
||||
@ -680,7 +680,7 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$dia->startDiaDoc($this->paper,$this->_topMargin,$this->_bottomMargin,$this->_leftMargin,$this->_rightMargin,$this->orientation);
|
||||
$alltables = $this->getAllTables($db,$this->pageNumber);
|
||||
foreach ($alltables as $table) {
|
||||
if (!isset($this->tables[$table])) {
|
||||
if (! isset($this->tables[$table])) {
|
||||
$this->tables[$table] = new Table_Stats($table, $this->pageNumber, $this->showKeys);
|
||||
}
|
||||
}
|
||||
@ -725,10 +725,10 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showKeys)
|
||||
{
|
||||
if (!isset($this->tables[$masterTable])) {
|
||||
if (! isset($this->tables[$masterTable])) {
|
||||
$this->tables[$masterTable] = new Table_Stats($masterTable, $this->pageNumber, $showKeys);
|
||||
}
|
||||
if (!isset($this->tables[$foreignTable])) {
|
||||
if (! isset($this->tables[$foreignTable])) {
|
||||
$this->tables[$foreignTable] = new Table_Stats($foreignTable, $this->pageNumber, $showKeys);
|
||||
}
|
||||
$this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
|
||||
|
||||
@ -759,7 +759,7 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$alltables = $this->getAllTables($db,$this->pageNumber);
|
||||
|
||||
foreach ($alltables AS $table) {
|
||||
if (!isset($this->tables[$table])) {
|
||||
if (! isset($this->tables[$table])) {
|
||||
$this->tables[$table] = new Table_Stats($table,$eps->getFont(),$eps->getFontSize(), $this->pageNumber, $this->_tablewidth, $this->showKeys, $this->tableDimension);
|
||||
}
|
||||
|
||||
@ -809,10 +809,10 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private function _addRelation($masterTable,$font,$fontSize, $masterField, $foreignTable, $foreignField, $showInfo)
|
||||
{
|
||||
if (!isset($this->tables[$masterTable])) {
|
||||
if (! isset($this->tables[$masterTable])) {
|
||||
$this->tables[$masterTable] = new Table_Stats($masterTable, $font, $fontSize, $this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
}
|
||||
if (!isset($this->tables[$foreignTable])) {
|
||||
if (! isset($this->tables[$foreignTable])) {
|
||||
$this->tables[$foreignTable] = new Table_Stats($foreignTable,$font,$fontSize,$this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
}
|
||||
$this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
|
||||
|
||||
@ -882,7 +882,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
|
||||
/* snip */
|
||||
foreach ($alltables as $table) {
|
||||
if (!isset($this->tables[$table])) {
|
||||
if (! isset($this->tables[$table])) {
|
||||
$this->tables[$table] = new Table_Stats($table, $this->_ff, $this->pageNumber, $this->_tablewidth, $this->showKeys, $this->tableDimension);
|
||||
}
|
||||
if ($this->sameWide) {
|
||||
@ -962,11 +962,11 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showInfo)
|
||||
{
|
||||
if (!isset($this->tables[$masterTable])) {
|
||||
if (! isset($this->tables[$masterTable])) {
|
||||
$this->tables[$masterTable] = new Table_Stats($masterTable, $this->_ff, $this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
$this->_setMinMax($this->tables[$masterTable]);
|
||||
}
|
||||
if (!isset($this->tables[$foreignTable])) {
|
||||
if (! isset($this->tables[$foreignTable])) {
|
||||
$this->tables[$foreignTable] = new Table_Stats($foreignTable, $this->_ff, $this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
$this->_setMinMax($this->tables[$foreignTable]);
|
||||
}
|
||||
@ -1305,7 +1305,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
if ($zerofill) {
|
||||
$attribute = 'UNSIGNED ZEROFILL';
|
||||
}
|
||||
if (!isset($row['Default'])) {
|
||||
if (! isset($row['Default'])) {
|
||||
if ($row['Null'] != '' && $row['Null'] != 'NO') {
|
||||
$row['Default'] = 'NULL';
|
||||
}
|
||||
|
||||
@ -742,7 +742,7 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$alltables = $this->getAllTables($db,$this->pageNumber);
|
||||
|
||||
foreach ($alltables AS $table) {
|
||||
if (!isset($this->tables[$table])) {
|
||||
if (! isset($this->tables[$table])) {
|
||||
$this->tables[$table] = new Table_Stats($table,$svg->getFont(),$svg->getFontSize(), $this->pageNumber, $this->_tablewidth, $this->showKeys, $this->tableDimension);
|
||||
}
|
||||
|
||||
@ -805,11 +805,11 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private function _addRelation($masterTable,$font,$fontSize, $masterField, $foreignTable, $foreignField, $showInfo)
|
||||
{
|
||||
if (!isset($this->tables[$masterTable])) {
|
||||
if (! isset($this->tables[$masterTable])) {
|
||||
$this->tables[$masterTable] = new Table_Stats($masterTable, $font, $fontSize, $this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
$this->_setMinMax($this->tables[$masterTable]);
|
||||
}
|
||||
if (!isset($this->tables[$foreignTable])) {
|
||||
if (! isset($this->tables[$foreignTable])) {
|
||||
$this->tables[$foreignTable] = new Table_Stats($foreignTable,$font,$fontSize,$this->pageNumber, $this->_tablewidth, false, $showInfo);
|
||||
$this->_setMinMax($this->tables[$foreignTable]);
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ class PMA_User_Schema
|
||||
* Display WYSIWYG parts
|
||||
*/
|
||||
|
||||
if (!isset($_POST['with_field_names']) && !isset($_POST['showwysiwyg'])) {
|
||||
if (! isset($_POST['with_field_names']) && ! isset($_POST['showwysiwyg'])) {
|
||||
$with_field_names = TRUE;
|
||||
}
|
||||
$this->_displayScratchboardTables($array_sh_page);
|
||||
@ -783,10 +783,10 @@ class PMA_User_Schema
|
||||
$arrvalue = 'c_table_' . $i;
|
||||
global $$arrvalue;
|
||||
$arrvalue = $$arrvalue;
|
||||
if (!isset($arrvalue['x']) || $arrvalue['x'] == '') {
|
||||
if (! isset($arrvalue['x']) || $arrvalue['x'] == '') {
|
||||
$arrvalue['x'] = 0;
|
||||
}
|
||||
if (!isset($arrvalue['y']) || $arrvalue['y'] == '') {
|
||||
if (! isset($arrvalue['y']) || $arrvalue['y'] == '') {
|
||||
$arrvalue['y'] = 0;
|
||||
}
|
||||
if (isset($arrvalue['name']) && $arrvalue['name'] != '--') {
|
||||
|
||||
@ -505,7 +505,7 @@ class PMA_Visio_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
$alltables = $this->getAllTables($db,$this->pageNumber);
|
||||
|
||||
foreach ($alltables as $table) {
|
||||
if (!isset($this->tables[$table])) {
|
||||
if (! isset($this->tables[$table])) {
|
||||
$this->tables[$table] = new Table_Stats($table, $this->pageNumber, $this->showKeys);
|
||||
}
|
||||
}
|
||||
@ -550,10 +550,10 @@ class PMA_Visio_Relation_Schema extends PMA_Export_Relation_Schema
|
||||
*/
|
||||
private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showKeys)
|
||||
{
|
||||
if (!isset($this->tables[$masterTable])) {
|
||||
if (! isset($this->tables[$masterTable])) {
|
||||
$this->tables[$masterTable] = new Table_Stats($masterTable, $this->pageNumber, $showKeys);
|
||||
}
|
||||
if (!isset($this->tables[$foreignTable])) {
|
||||
if (! isset($this->tables[$foreignTable])) {
|
||||
$this->tables[$foreignTable] = new Table_Stats($foreignTable, $this->pageNumber, $showKeys);
|
||||
}
|
||||
$this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
|
||||
|
||||
@ -27,7 +27,7 @@ if (!$GLOBALS['is_ajax_request']) {
|
||||
/**
|
||||
* Put something in $sub_part
|
||||
*/
|
||||
if (!isset($sub_part)) {
|
||||
if (! isset($sub_part)) {
|
||||
$sub_part = '';
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommo
|
||||
* If update is required, it is placed in $update_array
|
||||
* Otherwise that entry is placed in the $insert_array.
|
||||
*
|
||||
* @uses PMA_DBI_get_fields()
|
||||
* @uses PMA_DBI_get_columns()
|
||||
* @uses PMA_DBI_get_column_values()
|
||||
* @uses PMA_DBI_fetch_result()
|
||||
*
|
||||
@ -95,7 +95,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
|
||||
{
|
||||
if (isset($matching_table[$matching_table_index])) {
|
||||
$fld = array();
|
||||
$fld_results = PMA_DBI_get_fields($src_db, $matching_table[$matching_table_index], $src_link);
|
||||
$fld_results = PMA_DBI_get_columns($src_db, $matching_table[$matching_table_index], true, $src_link);
|
||||
$is_key = array();
|
||||
if (isset($fld_results)) {
|
||||
foreach ($fld_results as $each_field) {
|
||||
@ -113,7 +113,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
|
||||
$source_result_set = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link);
|
||||
$source_size = sizeof($source_result_set);
|
||||
|
||||
$trg_fld_results = PMA_DBI_get_fields($trg_db, $matching_table[$matching_table_index], $trg_link);
|
||||
$trg_fld_results = PMA_DBI_get_columns($trg_db, $matching_table[$matching_table_index], true, $trg_link);
|
||||
$all_keys_match = true;
|
||||
$trg_keys = array();
|
||||
|
||||
@ -597,7 +597,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
/**
|
||||
* PMA_createTargetTables() Create the missing table $uncommon_table in target database
|
||||
*
|
||||
* @uses PMA_DBI_get_fields()
|
||||
* @uses PMA_DBI_get_columns()
|
||||
* @uses PMA_backquote()
|
||||
* @uses PMA_DBI_fetch_result()
|
||||
*
|
||||
@ -613,7 +613,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|
||||
function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncommon_tables, $table_index, &$uncommon_tables_fields, $display)
|
||||
{
|
||||
if (isset($uncommon_tables[$table_index])) {
|
||||
$fields_result = PMA_DBI_get_fields($src_db, $uncommon_tables[$table_index], $src_link);
|
||||
$fields_result = PMA_DBI_get_columns($src_db, $uncommon_tables[$table_index], true, $src_link);
|
||||
$fields = array();
|
||||
foreach ($fields_result as $each_field) {
|
||||
$field_name = $each_field['Field'];
|
||||
|
||||
@ -95,7 +95,7 @@ if (! isset($_COOKIE[$session_name])) {
|
||||
* Token which is used for authenticating access queries.
|
||||
* (we use "space PMA_token space" to prevent overwriting)
|
||||
*/
|
||||
if (!isset($_SESSION[' PMA_token '])) {
|
||||
if (! isset($_SESSION[' PMA_token '])) {
|
||||
$_SESSION[' PMA_token '] = md5(uniqid(rand(), true));
|
||||
}
|
||||
|
||||
|
||||
@ -119,8 +119,7 @@ function PMA_sqlQueryForm($query = true, $display_tab = false, $delimiter = ';')
|
||||
if ($GLOBALS['cfg']['AjaxEnable']) {
|
||||
echo ' class="ajax"';
|
||||
}
|
||||
echo ' id="sqlqueryform"'
|
||||
.' onsubmit="return checkSqlQuery(this)" name="sqlform">' . "\n";
|
||||
echo ' id="sqlqueryform" name="sqlform">' . "\n";
|
||||
}
|
||||
|
||||
if ($is_querywindow) {
|
||||
|
||||
@ -46,7 +46,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
if (!defined('TESTSUITE')) {
|
||||
require_once './libraries/mysql_charsets.lib.php';
|
||||
}
|
||||
if (!isset($mysql_charsets)) {
|
||||
if (! isset($mysql_charsets)) {
|
||||
$mysql_charsets = array();
|
||||
$mysql_charsets_count = 0;
|
||||
$mysql_collations_flat = array();
|
||||
@ -244,9 +244,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
6 => '<>',
|
||||
7 => '>=',
|
||||
8 => '>>',
|
||||
9 => '||'
|
||||
9 => '||',
|
||||
10 => '==',
|
||||
);
|
||||
$allpunct_list_pair_size = 10; //count($allpunct_list_pair);
|
||||
$allpunct_list_pair_size = 11; //count($allpunct_list_pair);
|
||||
$quote_list = '\'"`';
|
||||
$arraysize = 0;
|
||||
|
||||
@ -828,7 +829,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
*/
|
||||
function PMA_SQP_analyze($arr)
|
||||
{
|
||||
if ($arr == array() || !isset($arr['len'])) {
|
||||
if ($arr == array() || ! isset($arr['len'])) {
|
||||
return array();
|
||||
}
|
||||
$result = array();
|
||||
@ -2090,7 +2091,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
{
|
||||
//DEBUG echo 'in Format<pre>'; print_r($arr); echo '</pre>';
|
||||
// then check for an array
|
||||
if (!is_array($arr)) {
|
||||
if (! is_array($arr)) {
|
||||
return htmlspecialchars($arr);
|
||||
}
|
||||
// first check for the SQL parser having hit an error
|
||||
|
||||
@ -102,7 +102,7 @@ if ($showtable) {
|
||||
}
|
||||
}
|
||||
// we need explicit DEFAULT value here (different from '0')
|
||||
$pack_keys = (!isset($pack_keys) || strlen($pack_keys) == 0) ? 'DEFAULT' : $pack_keys;
|
||||
$pack_keys = (! isset($pack_keys) || strlen($pack_keys) == 0) ? 'DEFAULT' : $pack_keys;
|
||||
unset($create_options, $each_create_option);
|
||||
} // end if
|
||||
?>
|
||||
|
||||
@ -112,7 +112,7 @@ unset($tabs);
|
||||
|
||||
if(PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]))
|
||||
{
|
||||
$msg = PMA_Message::notice('<a href="tbl_tracking.php?'.$url_query.'">'.sprintf(__('Tracking of %s.%s is activated.'), $GLOBALS["db"], $GLOBALS["table"]).'</a>');
|
||||
$msg = PMA_Message::notice('<a href="tbl_tracking.php?'.$url_query.'">'.sprintf(__('Tracking of %s.%s is activated.'), htmlspecialchars($GLOBALS["db"]), htmlspecialchars($GLOBALS["table"])).'</a>');
|
||||
$msg->display();
|
||||
}
|
||||
|
||||
|
||||
@ -378,7 +378,7 @@ for ($i = 0; $i < $num_fields; $i++) {
|
||||
* having NULL enabled does not implicit having Default with NULL
|
||||
*
|
||||
if (isset($row)
|
||||
&& !isset($row['Default']) && isset($row['Null']) && $row['Null'] == 'YES') {
|
||||
&& ! isset($row['Default']) && isset($row['Null']) && $row['Null'] == 'YES') {
|
||||
$row['Default'] = 'NULL';
|
||||
}
|
||||
*/
|
||||
|
||||
0
libraries/transformations/generator.sh
Normal file → Executable file
0
libraries/transformations/generator.sh
Normal file → Executable file
0
libraries/transformations/template_generator.sh
Normal file → Executable file
0
libraries/transformations/template_generator.sh
Normal file → Executable file
0
libraries/transformations/template_generator_mimetype.sh
Normal file → Executable file
0
libraries/transformations/template_generator_mimetype.sh
Normal file → Executable file
@ -15,7 +15,7 @@ require './libraries/server_links.inc.php';
|
||||
// build user preferences menu
|
||||
|
||||
$form_param = filter_input(INPUT_GET, 'form');
|
||||
if (!isset($forms[$form_param])) {
|
||||
if (! isset($forms[$form_param])) {
|
||||
$forms_keys = array_keys($forms);
|
||||
$form_param = array_shift($forms_keys);
|
||||
}
|
||||
@ -64,7 +64,7 @@ $msg->display();
|
||||
|
||||
// warn about using session storage for settings
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if (!$cfgRelation['userconfigwork']) {
|
||||
if (! $cfgRelation['userconfigwork']) {
|
||||
$msg = __('Your preferences will be saved for current session only. Storing them permanently requires %sphpMyAdmin configuration storage%s.');
|
||||
$msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]'));
|
||||
PMA_Message::notice($msg)->display();
|
||||
|
||||
@ -49,9 +49,9 @@ function PMA_userprefs_pageinit()
|
||||
function PMA_load_userprefs()
|
||||
{
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if (!$cfgRelation['userconfigwork']) {
|
||||
if (! $cfgRelation['userconfigwork']) {
|
||||
// no pmadb table, use session storage
|
||||
if (!isset($_SESSION['userconfig'])) {
|
||||
if (! isset($_SESSION['userconfig'])) {
|
||||
$_SESSION['userconfig'] = array(
|
||||
'db' => array(),
|
||||
'ts' => time());
|
||||
@ -104,7 +104,7 @@ function PMA_save_userprefs(array $config_array)
|
||||
? $GLOBALS['server']
|
||||
: $GLOBALS['cfg']['ServerDefault'];
|
||||
$cache_key = 'server_' . $server;
|
||||
if (!$cfgRelation['userconfigwork']) {
|
||||
if (! $cfgRelation['userconfigwork']) {
|
||||
// no pmadb table, use session storage
|
||||
$_SESSION['userconfig'] = array(
|
||||
'db' => $config_array,
|
||||
@ -175,7 +175,7 @@ function PMA_apply_userprefs(array $config_data)
|
||||
$whitelist['Server/hide_db'] = true;
|
||||
$whitelist['Server/only_db'] = true;
|
||||
foreach ($config_data as $path => $value) {
|
||||
if (!isset($whitelist[$path]) || isset($blacklist[$path])) {
|
||||
if (! isset($whitelist[$path]) || isset($blacklist[$path])) {
|
||||
continue;
|
||||
}
|
||||
PMA_array_write($path, $cfg, $value);
|
||||
|
||||
@ -27,6 +27,13 @@
|
||||
*/
|
||||
class zipfile
|
||||
{
|
||||
/**
|
||||
* Whether to echo zip as it's built or return as string from -> file
|
||||
*
|
||||
* @var boolean $doWrite
|
||||
*/
|
||||
var $doWrite = false;
|
||||
|
||||
/**
|
||||
* Array to store compressed data
|
||||
*
|
||||
@ -56,6 +63,21 @@ class zipfile
|
||||
var $old_offset = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Sets member variable this -> doWrite to true
|
||||
* - Should be called immediately after class instantiantion
|
||||
* - If set to true, then ZIP archive are echo'ed to STDOUT as each
|
||||
* file is added via this -> addfile(), and central directories are
|
||||
* echoed to STDOUT on final call to this -> file(). Also,
|
||||
* this -> file() returns an empty string so it is safe to issue a
|
||||
* "echo $zipfile;" command
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function setDoWrite() {
|
||||
$this -> doWrite = true;
|
||||
} // end of the 'setDoWrite()' method
|
||||
|
||||
/**
|
||||
* Converts an Unix timestamp to a four byte DOS date and time format (date
|
||||
* in high two bytes, time in low two bytes allowing magnitude comparison).
|
||||
@ -133,8 +155,12 @@ class zipfile
|
||||
//$fr .= pack('V', $c_len); // compressed filesize
|
||||
//$fr .= pack('V', $unc_len); // uncompressed filesize
|
||||
|
||||
// add this entry to array
|
||||
$this -> datasec[] = $fr;
|
||||
// echo this entry on the fly, ...
|
||||
if ( $this -> doWrite) {
|
||||
echo $fr;
|
||||
} else { // ... OR add this entry to array
|
||||
$this -> datasec[] = $fr;
|
||||
}
|
||||
|
||||
// now add to central directory record
|
||||
$cdrec = "\x50\x4b\x01\x02";
|
||||
@ -165,26 +191,30 @@ class zipfile
|
||||
|
||||
|
||||
/**
|
||||
* Dumps out file
|
||||
* Echo central dir if ->doWrite==true, else build string to return
|
||||
*
|
||||
* @return string the zipped file
|
||||
* @return string if ->doWrite {empty string} else the ZIP file contents
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function file()
|
||||
{
|
||||
$data = implode('', $this -> datasec);
|
||||
$ctrldir = implode('', $this -> ctrl_dir);
|
||||
|
||||
return
|
||||
$data .
|
||||
$ctrldir .
|
||||
$header = $ctrldir .
|
||||
$this -> eof_ctrl_dir .
|
||||
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
|
||||
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall
|
||||
pack('V', strlen($ctrldir)) . // size of central dir
|
||||
pack('V', strlen($data)) . // offset to start of central dir
|
||||
"\x00\x00"; // .zip file comment length
|
||||
|
||||
if ( $this -> doWrite ) { // Send central directory & end ctrl dir to STDOUT
|
||||
echo $header;
|
||||
return ""; // Return empty string
|
||||
} else { // Return entire ZIP archive as string
|
||||
$data = implode('', $this -> datasec);
|
||||
return $data . $header;
|
||||
}
|
||||
} // end of the 'file()' method
|
||||
|
||||
} // end of the 'zipfile' class
|
||||
|
||||
7
main.php
7
main.php
@ -202,7 +202,10 @@ echo '<div class="group pmagroup">';
|
||||
echo '<h2>phpMyAdmin</h2>';
|
||||
echo '<ul>';
|
||||
$class = null;
|
||||
if ($GLOBALS['cfg']['VersionCheck']) {
|
||||
// workaround for bug 3302733; some browsers don't like the situation
|
||||
// where phpMyAdmin is called on a secure page but a part of the page
|
||||
// (the version check) refers to a non-secure page
|
||||
if ($GLOBALS['cfg']['VersionCheck'] && ! $GLOBALS['PMA_Config']->get('is_https')) {
|
||||
$class = 'jsversioncheck';
|
||||
}
|
||||
PMA_printListItem(__('Version information') . ': ' . PMA_VERSION, 'li_pma_version', null, null, null, null, $class);
|
||||
@ -292,7 +295,7 @@ if (file_exists('./config')) {
|
||||
*/
|
||||
if ($server > 0) {
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
if(!$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
if(! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
$message = PMA_Message::notice(__('The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click %shere%s.'));
|
||||
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $common_url_query . '">', false);
|
||||
$message->addParam('</a>', false);
|
||||
|
||||
@ -53,6 +53,16 @@ function PMA_exitNavigationFrame()
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once './libraries/common.lib.php';
|
||||
require_once './libraries/RecentTable.class.php';
|
||||
|
||||
/**
|
||||
* Check if it is an ajax request to reload the recent tables list.
|
||||
*/
|
||||
if ($GLOBALS['is_ajax_request'] && $_REQUEST['recent_table']) {
|
||||
PMA_ajaxResponse('', true, array('options' => RecentTable::getInstance()->getHtmlSelectOption()) );
|
||||
}
|
||||
|
||||
// keep the offset of the db list in session before closing it
|
||||
if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
|
||||
$_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
|
||||
@ -126,7 +136,7 @@ require_once './libraries/header_http.inc.php';
|
||||
<base target="frame_content" />
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&js_frame=left&nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
|
||||
<script src="./js/jquery/jquery-1.4.4.js" type="text/javascript"></script>
|
||||
<script src="./js/jquery/jquery-1.6.1.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">
|
||||
@ -179,6 +189,14 @@ require_once './libraries/header_http.inc.php';
|
||||
<body id="body_leftFrame">
|
||||
<?php
|
||||
require './libraries/navigation_header.inc.php';
|
||||
|
||||
// display recently used tables
|
||||
if ($GLOBALS['cfg']['LeftRecentTable'] > 0) {
|
||||
echo '<div id="recentTableList">';
|
||||
echo RecentTable::getInstance()->getHtmlSelect();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if (! $GLOBALS['server']) {
|
||||
// no server selected
|
||||
PMA_exitNavigationFrame();
|
||||
|
||||
@ -6,6 +6,54 @@
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
|
||||
|
||||
var _change = 0; // variable to track any change in designer layout.
|
||||
var _staying = 0; // variable to check if the user stayed after seeing the confirmation prompt.
|
||||
|
||||
// Below is the function to change the href attributes to '#' while the href script is called using
|
||||
// the onclick event. It fixes the Internet Explorer issue with href.
|
||||
|
||||
$(document).ready(function(){
|
||||
$('a').filter(function(){
|
||||
return ( /^javascript\:/i).test($(this).attr('href'));
|
||||
}).each(function(){
|
||||
var hrefscript = $(this).attr('href');
|
||||
hrefscript = hrefscript.substr(11);
|
||||
$(this).data('hrefscript', hrefscript);
|
||||
}).click(function(){
|
||||
var hrefscript = $(this).data('hrefscript');
|
||||
eval (hrefscript);
|
||||
return false;
|
||||
}).attr('href', '#');
|
||||
});
|
||||
|
||||
// Below is the function to bind onbeforeunload events with the content_frame as well as the top window.
|
||||
|
||||
$(document).ready(function(){
|
||||
$(window).bind('beforeunload', function(){ // onbeforeunload for the frame window.
|
||||
if (_change == 1 && _staying == 0)
|
||||
return PMA_messages['strLeavingDesigner'];
|
||||
else if (_change == 1 && _staying == 1)
|
||||
_staying = 0;
|
||||
});
|
||||
$(window).unload(function(){
|
||||
_change = 0;
|
||||
});
|
||||
window.top.onbeforeunload = function(){ // onbeforeunload for the browser main window.
|
||||
if (_change == 1 && _staying == 0){
|
||||
_staying = 1; // Helps if the user stays on the page as there
|
||||
setTimeout('make_zero();', 100); // is no other way of knowing whether the user stayed or not.
|
||||
return PMA_messages['strLeavingDesigner'];
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
function make_zero(){ // Function called if the user stays after seeing the confirmation prompt.
|
||||
_staying = 0;
|
||||
}
|
||||
|
||||
|
||||
var dx, dy, dy2;
|
||||
var cur_click;
|
||||
// update in Main()
|
||||
@ -95,6 +143,7 @@ function MouseMove(e)
|
||||
//window.status = "X = "+ Glob_X + " Y = "+ Glob_Y;
|
||||
|
||||
if (cur_click != null) {
|
||||
_change = 1;
|
||||
var mGx = Glob_X - dx;
|
||||
var mGy = Glob_Y - dy;
|
||||
mGx = mGx > 0 ? mGx : 0;
|
||||
@ -448,6 +497,7 @@ function Get_url_pos()
|
||||
|
||||
function Save2()
|
||||
{
|
||||
_change = 0;
|
||||
var poststr = 'IS_AJAX=1&server='+server+'&db=' + db + '&token=' + token + '&die_save_pos=1';
|
||||
poststr += Get_url_pos();
|
||||
makeRequest('pmd_save_pos.php', poststr);
|
||||
|
||||
1452
po/be@latin.po
1452
po/be@latin.po
File diff suppressed because it is too large
Load Diff
1432
po/en_GB.po
1432
po/en_GB.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
Loading…
Reference in New Issue
Block a user