Skip to content

Commit

Permalink
Resolved conflict in common.lib.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanaka committed Jun 12, 2012
2 parents 2aec415 + bf219df commit 4e01dd5
Show file tree
Hide file tree
Showing 10 changed files with 578 additions and 507 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -54,6 +54,8 @@ VerboseMultiSubmit, ReplaceHelpImg
- bug #3531584 [interface] No form validation in change password dialog
- bug #3531585 [interface] Broken password validation in copy user form
- bug #3531586 [unterface] Add user form prints JSON when user presses enter
- bug #3534121 [config] duplicate line in config.sample.inc.php
- bug #3534311 [interface] Grid editing incorrectly parses ENUM/SET values

3.5.1.0 (2012-05-03)
- bug #3510784 [edit] Limit clause ignored when sort order is remembered
Expand Down
1 change: 0 additions & 1 deletion config.sample.inc.php
Expand Up @@ -58,7 +58,6 @@
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma_recent';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

Expand Down
4 changes: 0 additions & 4 deletions js/server_status.js
Expand Up @@ -130,10 +130,6 @@ $(function() {
}
});

$.ajaxSetup({
cache: false
});

// Add tabs
$('#serverStatusTabs').tabs({
// Tab persistence
Expand Down
2 changes: 1 addition & 1 deletion js/server_variables.js
Expand Up @@ -174,7 +174,7 @@ function editVariable(link)
$cell.html('<span class="oldContent" style="display:none;">' + $cell.html() + '</span>');
// put edit field and save/cancel link
$cell.prepend('<table class="serverVariableEditTable" border="0"><tr><td></td><td style="width:100%;">' +
'<input type="text" id="variableEditArea" value="' + data + '" /></td></tr</table>');
'<input type="text" id="variableEditArea" value="' + data + '" /></td></tr></table>');
$cell.find('table td:first').append(mySaveLink);
$cell.find('table td:first').append(' ');
$cell.find('table td:first').append(myCancelLink);
Expand Down
23 changes: 12 additions & 11 deletions js/tbl_zoom_plot_jqplot.js
Expand Up @@ -139,7 +139,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_0').val(),
'it' : 0,
'token' : window.parent.token,
'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(1) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(1) td:eq(1)').html(data.field_collation);
Expand All @@ -163,7 +163,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_1').val(),
'it' : 1,
'token' : window.parent.token,
'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(3) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(3) td:eq(1)').html(data.field_collation);
Expand All @@ -186,7 +186,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_2').val(),
'it' : 2,
'token' : window.parent.token,
'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(6) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(6) td:eq(1)').html(data.field_collation);
Expand All @@ -207,7 +207,7 @@ $(document).ready(function() {
'table' : window.parent.table,
'field' : $('#tableid_3').val(),
'it' : 3,
'token' : window.parent.token,
'token' : window.parent.token
},function(data) {
$('#tableFieldsId tr:eq(8) td:eq(0)').html(data.field_type);
$('#tableFieldsId tr:eq(8) td:eq(1)').html(data.field_collation);
Expand Down Expand Up @@ -264,14 +264,14 @@ $(document).ready(function() {
//Find changed values by comparing form values with selectedRow Object
var newValues = new Object();//Stores the values changed from original
var sqlTypes = new Object();
var it = 4;
var it = 0;
var xChange = false;
var yChange = false;
for (key in selectedRow) {
var oldVal = selectedRow[key];
var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
var newVal = ($('#edit_fields_null_id_' + it).attr('checked')) ? null : $('#edit_fieldID_' + it).val();
if (newVal instanceof Array) { // when the column is of type SET
newVal = $('#fieldID_' + it).map(function(){
newVal = $('#edit_fieldID_' + it).map(function(){
return $(this).val();
}).get().join(",");
}
Expand All @@ -286,7 +286,7 @@ $(document).ready(function() {
searchedData[searchedDataKey][yLabel] = newVal;
}
}
var $input = $('#fieldID_' + it);
var $input = $('#edit_fieldID_' + it);
if ($input.hasClass('bit')) {
sqlTypes[key] = 'bit';
}
Expand Down Expand Up @@ -534,6 +534,7 @@ $(document).ready(function() {
// resizing, it's ok
// under IE 9, everything is fine
currentChart = $.jqplot('querychart', series, options);
currentChart.resetZoom();

$('button.button-reset').click(function(event) {
event.preventDefault();
Expand All @@ -551,7 +552,7 @@ $(document).ready(function() {
$('div#querychart').bind('jqplotDataClick',
function(event, seriesIndex, pointIndex, data) {
searchedDataKey = data[4]; // key from searchedData (global)
var field_id = 4;
var field_id = 0;
var post_params = {
'ajax_request' : true,
'get_data_row' : true,
Expand All @@ -565,8 +566,8 @@ $(document).ready(function() {
// Row is contained in data.row_info,
// now fill the displayResultForm with row values
for (key in data.row_info) {
$field = $('#fieldID_' + field_id);
$field_null = $('#fields_null_id_' + field_id);
$field = $('#edit_fieldID_' + field_id);
$field_null = $('#edit_fields_null_id_' + field_id);
if (data.row_info[key] == null) {
$field_null.attr('checked', true);
$field.val('');
Expand Down
44 changes: 44 additions & 0 deletions libraries/common.lib.php
Expand Up @@ -3971,4 +3971,48 @@ function PMA_mimeDefaultFunction($buffer)

return $buffer;
}

/*
* Parses ENUM/SET values
*
* @param string $definition The definition of the column
* for which to parse the values
*
* @return array
*/
function PMA_parseEnumSetValues($definition)
{
$values_string = htmlentities($definition);
// There is a JS port of the below parser in functions.js
// If you are fixing something here,
// you need to also update the JS port.
$values = array();
$in_string = false;
$buffer = '';
for ($i=0; $i<strlen($values_string); $i++) {
$curr = $values_string[$i];
$next = $i == strlen($values_string)-1 ? '' : $values_string[$i+1];
if (! $in_string && $curr == "'") {
$in_string = true;
} else if ($in_string && $curr == "\\" && $next == "\\") {
$buffer .= "&#92;";
$i++;
} else if ($in_string && $next == "'" && ($curr == "'" || $curr == "\\")) {
$buffer .= "&#39;";
$i++;
} else if ($in_string && $curr == "'") {
$in_string = false;
$values[] = $buffer;
$buffer = '';
} else if ($in_string) {
$buffer .= $curr;
}
}
if (strlen($buffer) > 0) {
// The leftovers in the buffer are the last value (if any)
$values[] = $buffer;
}
return $values;
}

?>

0 comments on commit 4e01dd5

Please sign in to comment.