Git
Threads by month
- ----- 2026 -----
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 9 participants
- 39111 discussions
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16240-ga62aa22
by Madhura Jayaratne 20 Aug '11
by Madhura Jayaratne 20 Aug '11
20 Aug '11
The branch, master has been updated
via a62aa22ad5dfe90191f9186dcf3bd7c18c2a021a (commit)
via c052a0203ba0850fa44205e65c5b1584dde0fb65 (commit)
via efbbc52568efa883cfb2cc6c15bf9db3c6605085 (commit)
via d5c3cbf42a1fcb9fc78c06e522088a690b1f8dd8 (commit)
from b0ed51d8cdaa0ec42649f6258932889687890594 (commit)
- Log -----------------------------------------------------------------
commit a62aa22ad5dfe90191f9186dcf3bd7c18c2a021a
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Aug 21 00:51:36 2011 +0530
Replace tab characters with spaces
commit c052a0203ba0850fa44205e65c5b1584dde0fb65
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Aug 21 00:47:29 2011 +0530
More instances of coding style violations in Eps_Relation_Schema
commit efbbc52568efa883cfb2cc6c15bf9db3c6605085
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Aug 21 00:45:47 2011 +0530
Coding style improvements for Pdf_Relation_Schema
commit d5c3cbf42a1fcb9fc78c06e522088a690b1f8dd8
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Aug 20 23:38:22 2011 +0530
Style improvements for Export_Relation_Schema
-----------------------------------------------------------------------
Summary of changes:
js/tbl_zoom_plot.js | 638 ++++++++++----------
libraries/schema/Eps_Relation_Schema.class.php | 4 +-
libraries/schema/Export_Relation_Schema.class.php | 86 ++-
libraries/schema/Pdf_Relation_Schema.class.php | 518 +++++++++++++-----
4 files changed, 770 insertions(+), 476 deletions(-)
diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index e773175..b8c4259 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -60,14 +60,14 @@ function isEmpty(obj) {
**/
function getDate(val,type) {
if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
- }
+ return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
+ }
else if(type.toString().search(/time/i) != -1) {
return Highcharts.dateFormat('%H:%M:%S', val)
- }
+ }
else if (type.toString().search(/date/i) != -1) {
return Highcharts.dateFormat('%Y-%m-%e', val)
- }
+ }
}
/**
@@ -77,14 +77,14 @@ function getDate(val,type) {
**/
function getTimeStamp(val,type) {
if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
- }
+ return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
+ }
else if(type.toString().search(/time/i) != -1) {
- return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
- }
+ return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
+ }
else if (type.toString().search(/date/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd')
- }
+ return getDateFromFormat(val,'yyyy-MM-dd')
+ }
}
/**
@@ -92,12 +92,12 @@ function getTimeStamp(val,type) {
** @param field: field type (as in database structure)
**/
function getType(field) {
- if(field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
- return 'numeric';
- else if(field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
- return 'time';
- else
- return 'text';
+ if(field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
+ return 'numeric';
+ else if(field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
+ return 'time';
+ else
+ return 'text';
}
/**
** Converts a categorical array into numeric array
@@ -140,29 +140,29 @@ function includePan(currentChart) {
$('#querychart').mousemove(function(e) {
if (mouseDown == 1) {
if (e.pageX > lastX) {
- var xExtremes = currentChart.xAxis[0].getExtremes();
+ var xExtremes = currentChart.xAxis[0].getExtremes();
var diff = (e.pageX - lastX) * (xExtremes.max - xExtremes.min) / chartWidth;
currentChart.xAxis[0].setExtremes(xExtremes.min - diff, xExtremes.max - diff);
}
else if (e.pageX < lastX) {
- var xExtremes = currentChart.xAxis[0].getExtremes();
+ var xExtremes = currentChart.xAxis[0].getExtremes();
var diff = (lastX - e.pageX) * (xExtremes.max - xExtremes.min) / chartWidth;
- currentChart.xAxis[0].setExtremes(xExtremes.min + diff, xExtremes.max + diff);
+ currentChart.xAxis[0].setExtremes(xExtremes.min + diff, xExtremes.max + diff);
}
if (e.pageY > lastY) {
- var yExtremes = currentChart.yAxis[0].getExtremes();
+ var yExtremes = currentChart.yAxis[0].getExtremes();
var ydiff = 1.0 * (e.pageY - lastY) * (yExtremes.max - yExtremes.min) / chartHeight;
- currentChart.yAxis[0].setExtremes(yExtremes.min + ydiff, yExtremes.max + ydiff);
+ currentChart.yAxis[0].setExtremes(yExtremes.min + ydiff, yExtremes.max + ydiff);
}
else if (e.pageY < lastY) {
- var yExtremes = currentChart.yAxis[0].getExtremes();
+ var yExtremes = currentChart.yAxis[0].getExtremes();
var ydiff = 1.0 * (lastY - e.pageY) * (yExtremes.max - yExtremes.min) / chartHeight;
- currentChart.yAxis[0].setExtremes(yExtremes.min - ydiff, yExtremes.max - ydiff);
+ currentChart.yAxis[0].setExtremes(yExtremes.min - ydiff, yExtremes.max - ydiff);
}
}
- lastX = e.pageX;
- lastY = e.pageY;
+ lastX = e.pageX;
+ lastY = e.pageY;
});
}
@@ -216,8 +216,8 @@ $(document).ready(function() {
**/
$('#inputFormSubmitId').click(function() {
if ($('#tableid_0').get(0).selectedIndex == 0 || $('#tableid_1').get(0).selectedIndex == 0)
- PMA_ajaxShowMessage(PMA_messages['strInputNull']);
- else if (xLabel == yLabel)
+ PMA_ajaxShowMessage(PMA_messages['strInputNull']);
+ else if (xLabel == yLabel)
PMA_ajaxShowMessage(PMA_messages['strSameInputs']);
});
@@ -240,16 +240,16 @@ $(document).ready(function() {
} else {
$link.text(PMA_messages['strHideSearchCriteria']);
}
- // avoid default click action
- return false;
- });
+ // avoid default click action
+ return false;
+ });
/**
** Set dialog properties for the data display form
**/
$("#dataDisplay").dialog({
autoOpen: false,
- title: 'Data point content',
+ title: 'Data point content',
modal: false, //false otherwise other dialogues like timepicker may not function properly
height: $('#dataDisplay').height() + 80,
width: $('#dataDisplay').width() + 80
@@ -260,152 +260,152 @@ $(document).ready(function() {
*/
$("#submitForm").click(function(event) {
-
+
//Prevent default submission of form
event.preventDefault();
-
- //Find changed values by comparing form values with selectedRow Object
- var newValues = new Array();//Stores the values changed from original
+
+ //Find changed values by comparing form values with selectedRow Object
+ var newValues = new Array();//Stores the values changed from original
var it = 4;
var xChange = false;
var yChange = false;
- for (key in selectedRow) {
- if (key != 'where_clause'){
- var oldVal = selectedRow[key];
- var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
- if (oldVal != newVal){
- selectedRow[key] = newVal;
- newValues[key] = newVal;
- if(key == xLabel) {
- xChange = true;
- data[currentData][xLabel] = newVal;
- }
- else if(key == yLabel) {
- yChange = true;
- data[currentData][yLabel] = newVal;
- }
- }
- }
- it++
- }//End data update
+ for (key in selectedRow) {
+ if (key != 'where_clause'){
+ var oldVal = selectedRow[key];
+ var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
+ if (oldVal != newVal){
+ selectedRow[key] = newVal;
+ newValues[key] = newVal;
+ if(key == xLabel) {
+ xChange = true;
+ data[currentData][xLabel] = newVal;
+ }
+ else if(key == yLabel) {
+ yChange = true;
+ data[currentData][yLabel] = newVal;
+ }
+ }
+ }
+ it++
+ }//End data update
- //Update the chart series and replot
+ //Update the chart series and replot
if (xChange || yChange) {
- var newSeries = new Array();
- newSeries[0] = new Object();
+ var newSeries = new Array();
+ newSeries[0] = new Object();
newSeries[0].marker = {
symbol: 'circle'
};
- //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
+ //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
if(xChange) {
- xCord[currentData] = selectedRow[xLabel];
- if(xType == 'numeric') {
- currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
- currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
+ xCord[currentData] = selectedRow[xLabel];
+ if(xType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
+ currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
}
- else if(xType == 'time') {
- currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
- }
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
+ else if(xType == 'time') {
+ currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
+ }
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
if(yType != 'text')
- newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
}
}
- currentSettings.series = newSeries;
+ currentSettings.series = newSeries;
currentChart = PMA_createChart(currentSettings);
- }
+ }
- }
+ }
if(yChange) {
- yCord[currentData] = selectedRow[yLabel];
- if(yType == 'numeric') {
- currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
- currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
+ yCord[currentData] = selectedRow[yLabel];
+ if(yType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
+ currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
}
- else if(yType =='time') {
- currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
- }
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
- if(xType != 'text' )
+ else if(yType =='time') {
+ currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
+ }
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
+ if(xType != 'text' )
newSeries[0].data.push({ name: value[dataLabel], x: value[xLabel], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
}
}
- currentSettings.series = newSeries;
+ currentSettings.series = newSeries;
currentChart = PMA_createChart(currentSettings);
- }
- }
- currentChart.series[0].data[currentData].select();
}
- //End plot update
+ }
+ currentChart.series[0].data[currentData].select();
+ }
+ //End plot update
- //Generate SQL query for update
- if (!isEmpty(newValues)) {
+ //Generate SQL query for update
+ if (!isEmpty(newValues)) {
var sql_query = 'UPDATE `' + window.parent.table + '` SET ';
- for (key in newValues) {
- if(key != 'where_clause') {
- sql_query += '`' + key + '`=' ;
- var value = newValues[key];
- if(!isNumeric(value) && value != null)
- sql_query += '\'' + value + '\' ,';
- else
- sql_query += value + ' ,';
- }
- }
- sql_query = sql_query.substring(0, sql_query.length - 1);
- sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
-
- //Post SQL query to sql.php
- $.post('sql.php', {
+ for (key in newValues) {
+ if(key != 'where_clause') {
+ sql_query += '`' + key + '`=' ;
+ var value = newValues[key];
+ if(!isNumeric(value) && value != null)
+ sql_query += '\'' + value + '\' ,';
+ else
+ sql_query += value + ' ,';
+ }
+ }
+ sql_query = sql_query.substring(0, sql_query.length - 1);
+ sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
+
+ //Post SQL query to sql.php
+ $.post('sql.php', {
'token' : window.parent.token,
'db' : window.parent.db,
'ajax_request' : true,
'sql_query' : sql_query,
- 'inline_edit' : false
- }, function(data) {
- if(data.success == true) {
- $('#sqlqueryresults').html(data.sql_query);
- $("#sqlqueryresults").trigger('appendAnchor');
- }
- else
- PMA_ajaxShowMessage(data.error);
- })//End $.post
- }//End database update
- $("#dataDisplay").dialog("close");
+ 'inline_edit' : false
+ }, function(data) {
+ if(data.success == true) {
+ $('#sqlqueryresults').html(data.sql_query);
+ $("#sqlqueryresults").trigger('appendAnchor');
+ }
+ else
+ PMA_ajaxShowMessage(data.error);
+ })//End $.post
+ }//End database update
+ $("#dataDisplay").dialog("close");
});//End submit handler
/*
@@ -418,14 +418,14 @@ $(document).ready(function() {
.hide();
$('#togglesearchformlink')
.text(PMA_messages['strShowSearchCriteria'])
- $('#togglesearchformdiv').show();
+ $('#togglesearchformdiv').show();
var selectedRow;
- var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
- var series = new Array();
- var xCord = new Array();
- var yCord = new Array();
- var tempX, tempY;
- var it = 0;
+ var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
+ var series = new Array();
+ var xCord = new Array();
+ var yCord = new Array();
+ var tempX, tempY;
+ var it = 0;
var xMax; // xAxis extreme max
var xMin; // xAxis extreme min
var yMax; // yAxis extreme max
@@ -434,33 +434,33 @@ $(document).ready(function() {
// Set the basic plot settings
var currentSettings = {
chart: {
- renderTo: 'querychart',
- type: 'scatter',
- //zoomType: 'xy',
- width:$('#resizer').width() -3,
- height:$('#resizer').height()-20
- },
- credits: {
+ renderTo: 'querychart',
+ type: 'scatter',
+ //zoomType: 'xy',
+ width:$('#resizer').width() -3,
+ height:$('#resizer').height()-20
+ },
+ credits: {
enabled: false
},
- exporting: { enabled: false },
+ exporting: { enabled: false },
label: { text: $('#dataLabel').val() },
- plotOptions: {
- series: {
- allowPointSelect: true,
+ plotOptions: {
+ series: {
+ allowPointSelect: true,
cursor: 'pointer',
- showInLegend: false,
+ showInLegend: false,
dataLabels: {
enabled: false,
},
- point: {
+ point: {
events: {
click: function() {
- var id = this.id;
- var fid = 4;
- currentData = id;
- // Make AJAX request to tbl_zoom_select.php for getting the complete row info
- var post_params = {
+ var id = this.id;
+ var fid = 4;
+ currentData = id;
+ // Make AJAX request to tbl_zoom_select.php for getting the complete row info
+ var post_params = {
'ajax_request' : true,
'get_data_row' : true,
'db' : window.parent.db,
@@ -469,33 +469,33 @@ $(document).ready(function() {
'token' : window.parent.token,
}
$.post('tbl_zoom_select.php', post_params, function(data) {
- // Row is contained in data.row_info, now fill the displayResultForm with row values
- for ( key in data.row_info) {
- if (data.row_info[key] == null)
- $('#fields_null_id_' + fid).attr('checked', true);
- else
- $('#fieldID_' + fid).val(data.row_info[key]);
- fid++;
- }
- selectedRow = new Object();
- selectedRow = data.row_info;
+ // Row is contained in data.row_info, now fill the displayResultForm with row values
+ for ( key in data.row_info) {
+ if (data.row_info[key] == null)
+ $('#fields_null_id_' + fid).attr('checked', true);
+ else
+ $('#fieldID_' + fid).val(data.row_info[key]);
+ fid++;
+ }
+ selectedRow = new Object();
+ selectedRow = data.row_info;
});
- $("#dataDisplay").dialog("open");
+ $("#dataDisplay").dialog("open");
},
}
- }
- }
- },
- tooltip: {
- formatter: function() {
- return this.point.name;
- }
- },
+ }
+ }
+ },
+ tooltip: {
+ formatter: function() {
+ return this.point.name;
+ }
+ },
title: { text: 'Query Results' },
- xAxis: {
- title: { text: $('#tableid_0').val() },
- events: {
+ xAxis: {
+ title: { text: $('#tableid_0').val() },
+ events: {
setExtremes: function(e){
this.resetZoom.show();
}
@@ -503,16 +503,16 @@ $(document).ready(function() {
},
yAxis: {
- min: null,
- title: { text: $('#tableid_1').val() },
- endOnTick: false,
+ min: null,
+ title: { text: $('#tableid_1').val() },
+ endOnTick: false,
startOnTick: false,
- events: {
+ events: {
setExtremes: function(e){
this.resetZoom.show();
}
}
- },
+ },
}
$('#resizer').resizable({
@@ -525,159 +525,159 @@ $(document).ready(function() {
}
});
- // Classify types as either numeric,time,text
- xType = getType(xType);
- yType = getType(yType);
+ // Classify types as either numeric,time,text
+ xType = getType(xType);
+ yType = getType(yType);
- //Set the axis type based on the field
- currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
- currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
+ //Set the axis type based on the field
+ currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
+ currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
// Formulate series data for plot
series[0] = new Object();
series[0].data = new Array();
- series[0].marker = {
+ series[0].marker = {
symbol: 'circle'
};
- if (xType != 'text' && yType != 'text') {
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+ if (xType != 'text' && yType != 'text') {
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: xVal, y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- it++;
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ it++;
});
- if(xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
- }
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ if(xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
+ }
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
}
- if(yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
- }
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ if(yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
+ }
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
}
}
-
- else if (xType =='text' && yType !='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
-
- tempX = getCord(xCord);
- $.each(data,function(key,value) {
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+
+ else if (xType =='text' && yType !='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+
+ tempX = getCord(xCord);
+ $.each(data,function(key,value) {
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
-
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
+
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
}
}
- if(yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
- }
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ if(yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
+ }
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
}
- xCord = tempX[2];
- }
-
- else if (xType !='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ xCord = tempX[2];
+ }
+
+ else if (xType !='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
series[0].data.push({ name: value[dataLabel], y: tempY[0][it], x: xVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- if(xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
- }
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ if(xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
+ }
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
}
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
- }
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
}
- yCord = tempY[2];
- }
-
- else if (xType =='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempX = getCord(xCord);
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
+ }
+ yCord = tempY[2];
+ }
+
+ else if (xType =='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempX = getCord(xCord);
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: tempY[0][it], marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
- }
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
+ }
}
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
- }
- }
- xCord = tempX[2];
- yCord = tempY[2];
-
- }
-
- currentSettings.series = series;
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
+ }
+ }
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ }
+
+ currentSettings.series = series;
currentChart = PMA_createChart(currentSettings);
- xMin = currentChart.xAxis[0].getExtremes().min;
- xMax = currentChart.xAxis[0].getExtremes().max;
- yMin = currentChart.yAxis[0].getExtremes().min;
- yMax = currentChart.yAxis[0].getExtremes().max;
- includePan(currentChart); //Enable panning feature
+ xMin = currentChart.xAxis[0].getExtremes().min;
+ xMax = currentChart.xAxis[0].getExtremes().max;
+ yMin = currentChart.yAxis[0].getExtremes().min;
+ yMax = currentChart.yAxis[0].getExtremes().max;
+ includePan(currentChart); //Enable panning feature
var setZoom = function() {
- var newxm = xMin + (xMax - xMin) * (1 - zoomRatio) / 2;
- var newxM = xMax - (xMax - xMin) * (1 - zoomRatio) / 2;
- var newym = yMin + (yMax - yMin) * (1 - zoomRatio) / 2;
- var newyM = yMax - (yMax - yMin) * (1 - zoomRatio) / 2;
+ var newxm = xMin + (xMax - xMin) * (1 - zoomRatio) / 2;
+ var newxM = xMax - (xMax - xMin) * (1 - zoomRatio) / 2;
+ var newym = yMin + (yMax - yMin) * (1 - zoomRatio) / 2;
+ var newyM = yMax - (yMax - yMin) * (1 - zoomRatio) / 2;
currentChart.xAxis[0].setExtremes(newxm,newxM);
currentChart.yAxis[0].setExtremes(newym,newyM);
- };
- //Enable zoom feature
- $("#querychart").mousewheel(function(objEvent, intDelta) {
+ };
+ //Enable zoom feature
+ $("#querychart").mousewheel(function(objEvent, intDelta) {
if (intDelta > 0) {
if (zoomRatio > 0.1) {
zoomRatio = zoomRatio - 0.1;
@@ -703,6 +703,6 @@ $(document).ready(function() {
currentChart.yAxis[0].setExtremes(null, null)
this.style.display = 'none'
});
- scrollToChart();
+ scrollToChart();
}
});
diff --git a/libraries/schema/Eps_Relation_Schema.class.php b/libraries/schema/Eps_Relation_Schema.class.php
index be70889..ffb117e 100644
--- a/libraries/schema/Eps_Relation_Schema.class.php
+++ b/libraries/schema/Eps_Relation_Schema.class.php
@@ -111,13 +111,13 @@ class PMA_EPS
* font can be set whenever needed in EPS
*
* @param string $value sets the font name e.g Arial
- * @param integer $value sets the size of the font e.g 10
+ * @param integer $size sets the size of the font e.g 10
*
* @return void
*
* @access public
*/
- function setFont($value,$size)
+ function setFont($value, $size)
{
$this->font = $value;
$this->fontSize = $size;
diff --git a/libraries/schema/Export_Relation_Schema.class.php b/libraries/schema/Export_Relation_Schema.class.php
index bfdb063..d9ce1ec 100644
--- a/libraries/schema/Export_Relation_Schema.class.php
+++ b/libraries/schema/Export_Relation_Schema.class.php
@@ -10,7 +10,6 @@
* It contains those methods which are common in them
* it works like factory pattern
*/
-
class PMA_Export_Relation_Schema
{
private $_pageTitle;
@@ -27,8 +26,10 @@ class PMA_Export_Relation_Schema
/**
* Set Page Number
*
- * @param integer value Page Number of the document to be created
+ * @param integer $value Page Number of the document to be created
+ *
* @return void
+ *
* @access public
*/
public function setPageNumber($value)
@@ -39,8 +40,10 @@ class PMA_Export_Relation_Schema
/**
* Set Show Grid
*
- * @param boolean value show grid of the document or not
+ * @param boolean $value show grid of the document or not
+ *
* @return void
+ *
* @access public
*/
public function setShowGrid($value)
@@ -48,6 +51,13 @@ class PMA_Export_Relation_Schema
$this->showGrid = (isset($value) && $value == 'on') ? 1 : 0;
}
+ /**
+ * Sets showColor
+ *
+ * @param string $value 'on' to set the the variable
+ *
+ * @return nothing
+ */
public function setShowColor($value)
{
$this->showColor = (isset($value) && $value == 'on') ? 1 : 0;
@@ -56,8 +66,10 @@ class PMA_Export_Relation_Schema
/**
* Set Table Dimension
*
- * @param boolean value show table co-ordinates or not
+ * @param boolean $value show table co-ordinates or not
+ *
* @return void
+ *
* @access public
*/
public function setTableDimension($value)
@@ -68,8 +80,10 @@ class PMA_Export_Relation_Schema
/**
* Set same width of All Tables
*
- * @param boolean value set same width of all tables or not
+ * @param boolean $value set same width of all tables or not
+ *
* @return void
+ *
* @access public
*/
public function setAllTableSameWidth($value)
@@ -80,8 +94,10 @@ class PMA_Export_Relation_Schema
/**
* Set Data Dictionary
*
- * @param boolean value show selected database data dictionary or not
+ * @param boolean $value show selected database data dictionary or not
+ *
* @return void
+ *
* @access public
*/
public function setWithDataDictionary($value)
@@ -92,8 +108,10 @@ class PMA_Export_Relation_Schema
/**
* Set Show only keys
*
- * @param boolean value show only keys or not
+ * @param boolean $value show only keys or not
+ *
* @return void
+ *
* @access public
*/
public function setShowKeys($value)
@@ -104,8 +122,10 @@ class PMA_Export_Relation_Schema
/**
* Set Orientation
*
- * @param string value Orientation will be portrait or landscape
+ * @param string $value Orientation will be portrait or landscape
+ *
* @return void
+ *
* @access public
*/
public function setOrientation($value)
@@ -116,8 +136,10 @@ class PMA_Export_Relation_Schema
/**
* Set type of paper
*
- * @param string value paper type can be A4 etc
+ * @param string $value paper type can be A4 etc
+ *
* @return void
+ *
* @access public
*/
public function setPaper($value)
@@ -128,8 +150,10 @@ class PMA_Export_Relation_Schema
/**
* Set title of the page
*
- * @param string value title of the page displayed at top of the document
+ * @param string $title title of the page displayed at top of the document
+ *
* @return void
+ *
* @access public
*/
public function setPageTitle($title)
@@ -140,8 +164,10 @@ class PMA_Export_Relation_Schema
/**
* Set type of export relational schema
*
- * @param string value can be pdf,svg,dia,visio,eps etc
+ * @param string $value can be pdf,svg,dia,visio,eps etc
+ *
* @return void
+ *
* @access public
*/
public function setExportType($value)
@@ -152,22 +178,26 @@ class PMA_Export_Relation_Schema
/**
* get all tables involved or included in page
*
- * @param string db name of the database
- * @param integer pageNumber page number whose tables will be fetched in an array
+ * @param string $db name of the database
+ * @param integer $pageNumber page no. whose tables will be fetched in an array
+ *
* @return Array an array of tables
+ *
* @access public
*/
- public function getAllTables($db,$pageNumber)
+ public function getAllTables($db, $pageNumber)
{
global $cfgRelation;
// Get All tables
- $tab_sql = 'SELECT table_name FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
- . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
- . ' AND pdf_page_number = ' . $pageNumber;
+ $tab_sql = 'SELECT table_name FROM '
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['table_coords'])
+ . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
+ . ' AND pdf_page_number = ' . $pageNumber;
$tab_rs = PMA_query_as_controluser($tab_sql, null, PMA_DBI_QUERY_STORE);
if (!$tab_rs || !PMA_DBI_num_rows($tab_rs) > 0) {
- $this->dieSchema('',__('This page does not contain any tables!'));
+ $this->dieSchema('', __('This page does not contain any tables!'));
}
while ($curr_table = @PMA_DBI_fetch_assoc($tab_rs)) {
$alltables[] = PMA_sqlAddSlashes($curr_table['table_name']);
@@ -178,12 +208,15 @@ class PMA_Export_Relation_Schema
/**
* Displays an error message
*
- * @param integer pageNumber ID of the chosen page
- * @param string type Schema Type
- * @param string error_message the error mesage
+ * @param integer $pageNumber ID of the chosen page
+ * @param string $type Schema Type
+ * @param string $error_message The error mesage
+ *
* @global array the PMA configuration array
* @global string the current database name
+ *
* @access public
+ *
* @return void
*/
function dieSchema($pageNumber, $type = '', $error_message = '')
@@ -191,18 +224,19 @@ class PMA_Export_Relation_Schema
global $cfg;
global $db;
- require_once './libraries/header.inc.php';
- echo "<p><strong>" . __("SCHEMA ERROR: ") . $type ."</strong></p>" . "\n";
+ include_once './libraries/header.inc.php';
+ echo "<p><strong>" . __("SCHEMA ERROR: ") . $type . "</strong></p>" . "\n";
if (!empty($error_message)) {
$error_message = htmlspecialchars($error_message);
}
echo '<p>' . "\n";
echo ' ' . $error_message . "\n";
echo '</p>' . "\n";
- echo '<a href="schema_edit.php?' . PMA_generate_common_url($db).'&do=selectpage&chpage='.$pageNumber.'&action_choose=0'
- . '">' . __('Back') . '</a>';
+ echo '<a href="schema_edit.php?' . PMA_generate_common_url($db)
+ . '&do=selectpage&chpage=' . $pageNumber . '&action_choose=0'
+ . '">' . __('Back') . '</a>';
echo "\n";
- require_once './libraries/footer.inc.php';
+ include_once './libraries/footer.inc.php';
exit();
}
}
diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php
index ed96efd..aa08a6a 100644
--- a/libraries/schema/Pdf_Relation_Schema.class.php
+++ b/libraries/schema/Pdf_Relation_Schema.class.php
@@ -5,8 +5,7 @@
* @package phpMyAdmin
*/
-include_once("Export_Relation_Schema.class.php");
-
+require_once 'Export_Relation_Schema.class.php';
require_once './libraries/PDF.class.php';
/**
@@ -32,6 +31,13 @@ class PMA_Schema_PDF extends PMA_PDF
var $widths;
private $_ff = PMA_PDF_FONT;
+ /**
+ * Sets the value for margins
+ *
+ * @param float $c_margin margin
+ *
+ * @return nothing
+ */
public function setCMargin($c_margin)
{
$this->cMargin = $c_margin;
@@ -40,12 +46,15 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Sets the scaling factor, defines minimum coordinates and margins
*
- * @param float scale The scaling factor
- * @param float _xMin The minimum X coordinate
- * @param float _yMin The minimum Y coordinate
- * @param float leftMargin The left margin
- * @param float topMargin The top margin
+ * @param float $scale The scaling factor
+ * @param float $xMin The minimum X coordinate
+ * @param float $yMin The minimum Y coordinate
+ * @param float $leftMargin The left margin
+ * @param float $topMargin The top margin
+ *
* @access public
+ *
+ * @return nothing
*/
function PMA_PDF_setScale($scale = 1, $xMin = 0, $yMin = 0, $leftMargin = -1, $topMargin = -1)
{
@@ -63,14 +72,19 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Outputs a scaled cell
*
- * @param float w The cell width
- * @param float h The cell height
- * @param string txt The text to output
- * @param mixed border Whether to add borders or not
- * @param integer ln Where to put the cursor once the output is done
- * @param string align Align mode
- * @param integer fill Whether to fill the cell with a color or not
+ * @param float $w The cell width
+ * @param float $h The cell height
+ * @param string $txt The text to output
+ * @param mixed $border Whether to add borders or not
+ * @param integer $ln Where to put the cursor once the output is done
+ * @param string $align Align mode
+ * @param integer $fill Whether to fill the cell with a color or not
+ * @param string $link Link
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::Cell()
*/
function PMA_PDF_cellScale($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '')
@@ -83,11 +97,15 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Draws a scaled line
*
- * @param float x1 The horizontal position of the starting point
- * @param float y1 The vertical position of the starting point
- * @param float x2 The horizontal position of the ending point
- * @param float y2 The vertical position of the ending point
+ * @param float $x1 The horizontal position of the starting point
+ * @param float $y1 The vertical position of the starting point
+ * @param float $x2 The horizontal position of the ending point
+ * @param float $y2 The vertical position of the ending point
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::Line()
*/
function PMA_PDF_lineScale($x1, $y1, $x2, $y2)
@@ -102,9 +120,13 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Sets x and y scaled positions
*
- * @param float x The x position
- * @param float y The y position
+ * @param float $x The x position
+ * @param float $y The y position
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::SetXY()
*/
function PMA_PDF_setXyScale($x, $y)
@@ -117,8 +139,12 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Sets the X scaled positions
*
- * @param float x The x position
+ * @param float $x The x position
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::SetX()
*/
function PMA_PDF_setXScale($x)
@@ -130,8 +156,12 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Sets the scaled font size
*
- * @param float size The font size (in points)
+ * @param float $size The font size (in points)
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::SetFontSize()
*/
function PMA_PDF_setFontSizeScale($size)
@@ -145,7 +175,11 @@ class PMA_Schema_PDF extends PMA_PDF
* Sets the scaled line width
*
* @param float $width The line width
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see TCPDF::SetLineWidth()
*/
function PMA_PDF_setLineWidthScale($width)
@@ -154,6 +188,13 @@ class PMA_Schema_PDF extends PMA_PDF
$this->SetLineWidth($width);
}
+ /**
+ * This method is used to render the page header.
+ *
+ * @return nothing
+ *
+ * @see TCPDF::Header()
+ */
function Header()
{
// We only show this if we find something in the new pdf_pages table
@@ -161,9 +202,11 @@ class PMA_Schema_PDF extends PMA_PDF
// This function must be named "Header" to work with the TCPDF library
global $cfgRelation, $db, $pdf_page_number, $with_doc;
if ($with_doc) {
- $test_query = 'SELECT * FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
- . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
- . ' AND page_nr = \'' . $pdf_page_number . '\'';
+ $test_query = 'SELECT * FROM '
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['pdf_pages'])
+ . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
+ . ' AND page_nr = \'' . $pdf_page_number . '\'';
$test_rs = PMA_query_as_controluser($test_query);
$pages = @PMA_DBI_fetch_assoc($test_rs);
$this->SetFont($this->_ff, 'B', 14);
@@ -175,6 +218,10 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* This function must be named "Footer" to work with the TCPDF library
+ *
+ * @return nothing
+ *
+ * @see PMA_PDF::Footer()
*/
function Footer()
{
@@ -184,6 +231,13 @@ class PMA_Schema_PDF extends PMA_PDF
}
}
+ /**
+ * Sets widths
+ *
+ * @param array $w array of widths
+ *
+ * @return nothing
+ */
function SetWidths($w)
{
// column widths
@@ -195,8 +249,9 @@ class PMA_Schema_PDF extends PMA_PDF
// line height
$nb = 0;
$data_cnt = count($data);
- for ($i = 0;$i < $data_cnt;$i++)
- $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));
+ for ($i = 0;$i < $data_cnt;$i++) {
+ $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));
+ }
$il = $this->FontSize;
$h = ($il + 1) * $nb;
// page break if necessary
@@ -225,8 +280,9 @@ class PMA_Schema_PDF extends PMA_PDF
/**
* Compute number of lines used by a multicell of width w
*
- * @param int $w
- * @param string $txt
+ * @param int $w width
+ * @param string $txt text
+ *
* @return int
*/
function NbLines($w, $txt)
@@ -309,18 +365,22 @@ class Table_Stats
/**
* The "Table_Stats" constructor
*
- * @param string table_name The table name
- * @param integer fontSize The font size
- * @param integer pageNumber The current page number (from the
- * $cfg['Servers'][$i]['table_coords'] table)
- * @param integer sameWideWidth The max. with among tables
- * @param boolean showKeys Whether to display keys or not
- * @param boolean showInfo Whether to display table position or not
+ * @param string $tableName The table name
+ * @param integer $fontSize The font size
+ * @param integer $pageNumber The current page number (from the
+ * $cfg['Servers'][$i]['table_coords'] table)
+ * @param integer &$sameWideWidth The max. with among tables
+ * @param boolean $showKeys Whether to display keys or not
+ * @param boolean $showInfo Whether to display table position or not
+ *
* @global object The current PDF document
* @global array The relations settings
* @global string The current db name
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF, Table_Stats::Table_Stats_setWidth,
- Table_Stats::Table_Stats_setHeight
+ * Table_Stats::Table_Stats_setHeight
*/
function __construct($tableName, $fontSize, $pageNumber, &$sameWideWidth, $showKeys = false, $showInfo = false)
{
@@ -329,7 +389,7 @@ class Table_Stats
$this->_tableName = $tableName;
$sql = 'DESCRIBE ' . PMA_backquote($tableName);
$result = PMA_DBI_try_query($sql, null, PMA_DBI_QUERY_STORE);
- if (!$result || !PMA_DBI_num_rows($result)) {
+ if (! $result || ! PMA_DBI_num_rows($result)) {
$pdf->Error(sprintf(__('The %s table doesn\'t exist!'), $tableName));
}
// load fields
@@ -338,7 +398,10 @@ class Table_Stats
$indexes = PMA_Index::getFromTable($this->_tableName, $db);
$all_columns = array();
foreach ($indexes as $index) {
- $all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));
+ $all_columns = array_merge(
+ $all_columns,
+ array_flip(array_keys($index->getColumns()))
+ );
}
$this->fields = array_keys($all_columns);
} else {
@@ -358,13 +421,19 @@ class Table_Stats
$sameWideWidth = $this->width;
}
$sql = 'SELECT x, y FROM '
- . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['table_coords'])
. ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
. ' AND table_name = \'' . PMA_sqlAddSlashes($tableName) . '\''
. ' AND pdf_page_number = ' . $pageNumber;
$result = PMA_query_as_controluser($sql, false, PMA_DBI_QUERY_STORE);
- if (!$result || !PMA_DBI_num_rows($result)) {
- $pdf->Error(sprintf(__('Please configure the coordinates for table %s'), $tableName));
+ if (! $result || ! PMA_DBI_num_rows($result)) {
+ $pdf->Error(
+ sprintf(
+ __('Please configure the coordinates for table %s'),
+ $tableName
+ )
+ );
}
list($this->x, $this->y) = PMA_DBI_fetch_row($result);
$this->x = (double) $this->x;
@@ -376,7 +445,10 @@ class Table_Stats
/*
* index
*/
- $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($tableName) . ';', null, PMA_DBI_QUERY_STORE);
+ $result = PMA_DBI_query(
+ 'SHOW INDEX FROM ' . PMA_backquote($tableName) . ';',
+ null, PMA_DBI_QUERY_STORE
+ );
if (PMA_DBI_num_rows($result) > 0) {
while ($row = PMA_DBI_fetch_assoc($result)) {
if ($row['Key_name'] == 'PRIMARY') {
@@ -400,9 +472,14 @@ class Table_Stats
/**
* Sets the width of the table
*
- * @param integer fontSize The font size
+ * @param integer $fontSize The font size
+ *
* @global object The current PDF document
+ *
* @access private
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF
*/
private function _setWidth($fontSize)
@@ -427,6 +504,8 @@ class Table_Stats
/**
* Sets the height of the table
*
+ * @return nothing
+ *
* @access private
*/
private function _setHeight()
@@ -437,10 +516,16 @@ class Table_Stats
/**
* Do draw the table
*
- * @param integer fontSize The font size
- * @param boolean setColor Whether to display color
- * @global object The current PDF document
+ * @param integer $fontSize The font size
+ * @param boolean $withDoc
+ * @param boolean $setColor Whether to display color
+ *
+ * @global object The current PDF document
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF
*/
public function tableDraw($fontSize, $withDoc, $setColor = 0)
@@ -459,7 +544,16 @@ class Table_Stats
$pdf->PMA_links['doc'][$this->_tableName]['-'] = '';
}
- $pdf->PMA_PDF_cellScale($this->width, $this->heightCell, $this->_getTitle(), 1, 1, 'C', $setColor, $pdf->PMA_links['doc'][$this->_tableName]['-']);
+ $pdf->PMA_PDF_cellScale(
+ $this->width,
+ $this->heightCell,
+ $this->_getTitle(),
+ 1,
+ 1,
+ 'C',
+ $setColor,
+ $pdf->PMA_links['doc'][$this->_tableName]['-']
+ );
$pdf->PMA_PDF_setXScale($this->x);
$pdf->SetFont($this->_ff, '', $fontSize);
$pdf->SetTextColor(0);
@@ -480,12 +574,23 @@ class Table_Stats
$pdf->PMA_links['doc'][$this->_tableName][$field] = '';
}
- $pdf->PMA_PDF_cellScale($this->width, $this->heightCell, ' ' . $field, 1, 1, 'L', $setColor, $pdf->PMA_links['doc'][$this->_tableName][$field]);
+ $pdf->PMA_PDF_cellScale(
+ $this->width,
+ $this->heightCell,
+ ' ' . $field,
+ 1,
+ 1,
+ 'L',
+ $setColor,
+ $pdf->PMA_links['doc'][$this->_tableName][$field]
+ );
$pdf->PMA_PDF_setXScale($this->x);
$pdf->SetFillColor(255);
}
/*if ($pdf->PageNo() > 1) {
- $pdf->PMA_PDF_die(__('The scale factor is too small to fit the schema on one page'));
+ $pdf->PMA_PDF_die(
+ __('The scale factor is too small to fit the schema on one page')
+ );
} */
}
}
@@ -499,7 +604,8 @@ class Table_Stats
* in PDF document.
*
* @name Relation_Stats
- * @see PMA_Schema_PDF::SetDrawColor,PMA_Schema_PDF::PMA_PDF_setLineWidthScale,PMA_Schema_PDF::PMA_PDF_lineScale
+ * @see PMA_Schema_PDF::SetDrawColor, PMA_Schema_PDF::PMA_PDF_setLineWidthScale,
+ * PMA_Schema_PDF::PMA_PDF_lineScale
*/
class Relation_Stats
{
@@ -515,10 +621,13 @@ class Relation_Stats
/**
* The "Relation_Stats" constructor
*
- * @param string master_table The master table name
- * @param string master_field The relation field in the master table
- * @param string foreign_table The foreign table name
- * @param string foreigh_field The relation field in the foreign table
+ * @param string $master_table The master table name
+ * @param string $master_field The relation field in the master table
+ * @param string $foreign_table The foreign table name
+ * @param string $foreign_field The relation field in the foreign table
+ *
+ * @return nothing
+ *
* @see Relation_Stats::_getXy
*/
function __construct($master_table, $master_field, $foreign_table, $foreign_field)
@@ -569,9 +678,11 @@ class Relation_Stats
/**
* Gets arrows coordinates
*
- * @param string table The current table name
- * @param string column The relation column name
+ * @param string $table The current table name
+ * @param string $column The relation column name
+ *
* @return array Arrows coordinates
+ *
* @access private
*/
private function _getXy($table, $column)
@@ -582,13 +693,17 @@ class Relation_Stats
}
/**
- * draws relation links and arrows
- * shows foreign key relations
+ * draws relation links and arrows shows foreign key relations
+ *
+ * @param boolean $changeColor Whether to use one color per relation or not
+ * @param integer $i The id of the link to draw
*
- * @param boolean changeColor Whether to use one color per relation or not
- * @param integer i The id of the link to draw
* @global object The current PDF document
+ *
* @access public
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF
*/
public function relationDraw($changeColor, $i)
@@ -607,7 +722,7 @@ class Relation_Stats
array(1, 1, 0),
array(1, 0, 1),
array(0, 1, 1)
- );
+ );
list ($a, $b, $c) = $case[$d];
$e = (1 - ($j - 1) / 6);
$pdf->SetDrawColor($a * 255 * $e, $b * 255 * $e, $c * 255 * $e);
@@ -615,19 +730,54 @@ class Relation_Stats
$pdf->SetDrawColor(0);
}
$pdf->PMA_PDF_setLineWidthScale(0.2);
- $pdf->PMA_PDF_lineScale($this->xSrc, $this->ySrc, $this->xSrc + $this->srcDir * $this->wTick, $this->ySrc);
- $pdf->PMA_PDF_lineScale($this->xDest + $this->destDir * $this->wTick, $this->yDest, $this->xDest, $this->yDest);
+ $pdf->PMA_PDF_lineScale(
+ $this->xSrc,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * $this->wTick,
+ $this->ySrc
+ );
+ $pdf->PMA_PDF_lineScale(
+ $this->xDest + $this->destDir * $this->wTick,
+ $this->yDest,
+ $this->xDest,
+ $this->yDest
+ );
$pdf->PMA_PDF_setLineWidthScale(0.1);
- $pdf->PMA_PDF_lineScale($this->xSrc + $this->srcDir * $this->wTick, $this->ySrc, $this->xDest + $this->destDir * $this->wTick, $this->yDest);
+ $pdf->PMA_PDF_lineScale(
+ $this->xSrc + $this->srcDir * $this->wTick,
+ $this->ySrc,
+ $this->xDest + $this->destDir * $this->wTick,
+ $this->yDest
+ );
/*
* Draws arrows ->
*/
$root2 = 2 * sqrt(2);
- $pdf->PMA_PDF_lineScale($this->xSrc + $this->srcDir * $this->wTick * 0.75, $this->ySrc, $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, $this->ySrc + $this->wTick / $root2);
- $pdf->PMA_PDF_lineScale($this->xSrc + $this->srcDir * $this->wTick * 0.75, $this->ySrc, $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, $this->ySrc - $this->wTick / $root2);
-
- $pdf->PMA_PDF_lineScale($this->xDest + $this->destDir * $this->wTick / 2, $this->yDest, $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, $this->yDest + $this->wTick / $root2);
- $pdf->PMA_PDF_lineScale($this->xDest + $this->destDir * $this->wTick / 2, $this->yDest, $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, $this->yDest - $this->wTick / $root2);
+ $pdf->PMA_PDF_lineScale(
+ $this->xSrc + $this->srcDir * $this->wTick * 0.75,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick,
+ $this->ySrc + $this->wTick / $root2
+ );
+ $pdf->PMA_PDF_lineScale(
+ $this->xSrc + $this->srcDir * $this->wTick * 0.75,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick,
+ $this->ySrc - $this->wTick / $root2
+ );
+
+ $pdf->PMA_PDF_lineScale(
+ $this->xDest + $this->destDir * $this->wTick / 2,
+ $this->yDest,
+ $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick,
+ $this->yDest + $this->wTick / $root2
+ );
+ $pdf->PMA_PDF_lineScale(
+ $this->xDest + $this->destDir * $this->wTick / 2,
+ $this->yDest,
+ $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick,
+ $this->yDest - $this->wTick / $root2
+ );
$pdf->SetDrawColor(0);
}
}
@@ -688,11 +838,17 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
// Initializes a new document
$pdf = new PMA_Schema_PDF($this->orientation, 'mm', $this->paper);
- $pdf->SetTitle(sprintf(__('Schema of the %s database - Page %s'), $GLOBALS['db'], $this->pageNumber));
+ $pdf->SetTitle(
+ sprintf(
+ __('Schema of the %s database - Page %s'),
+ $GLOBALS['db'],
+ $this->pageNumber
+ )
+ );
$pdf->setCMargin(0);
$pdf->Open();
$pdf->SetAutoPageBreak('auto');
- $alltables = $this->getAllTables($db,$this->pageNumber);
+ $alltables = $this->getAllTables($db, $this->pageNumber);
if ($this->withDoc) {
$pdf->SetAutoPageBreak('auto', 15);
@@ -707,7 +863,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
if ($this->withDoc) {
$pdf->SetLink($pdf->PMA_links['RT']['-'], -1);
$pdf->Bookmark(__('Relational schema'));
- $pdf->SetAlias('{00}', $pdf->PageNo()) ;
+ $pdf->SetAlias('{00}', $pdf->PageNo());
$this->topMargin = 28;
$this->bottomMargin = 28;
}
@@ -715,7 +871,13 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
/* snip */
foreach ($alltables as $table) {
if (! isset($this->tables[$table])) {
- $this->tables[$table] = new Table_Stats($table, $this->_ff, $this->pageNumber, $this->_tablewidth, $this->showKeys, $this->tableDimension);
+ $this->tables[$table] = new Table_Stats(
+ $table, $this->_ff,
+ $this->pageNumber,
+ $this->_tablewidth,
+ $this->showKeys,
+ $this->tableDimension
+ );
}
if ($this->sameWide) {
$this->tables[$table]->width = $this->_tablewidth;
@@ -727,10 +889,17 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$this->scale = ceil(
max(
($this->_xMax - $this->_xMin) / ($pdf->getPageWidth() - $this->rightMargin - $this->leftMargin),
- ($this->_yMax - $this->_yMin) / ($pdf->getPageHeight() - $this->topMargin - $this->bottomMargin))
- * 100) / 100;
-
- $pdf->PMA_PDF_setScale($this->scale, $this->_xMin, $this->_yMin, $this->leftMargin, $this->topMargin);
+ ($this->_yMax - $this->_yMin) / ($pdf->getPageHeight() - $this->topMargin - $this->bottomMargin)
+ ) * 100
+ ) / 100;
+
+ $pdf->PMA_PDF_setScale(
+ $this->scale,
+ $this->_xMin,
+ $this->_yMin,
+ $this->leftMargin,
+ $this->topMargin
+ );
// Builds and save the PDF document
$pdf->PMA_PDF_setLineWidthScale(0.1);
@@ -753,7 +922,13 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
// (do not use array_search() because we would have to
// to do a === false and this is not PHP3 compatible)
if (in_array($rel['foreign_table'], $alltables)) {
- $this->_addRelation($one_table, $master_field, $rel['foreign_table'], $rel['foreign_field'], $this->tableDimension);
+ $this->_addRelation(
+ $one_table,
+ $master_field,
+ $rel['foreign_table'],
+ $rel['foreign_field'],
+ $this->tableDimension
+ );
}
} // end while
} // end if
@@ -770,7 +945,10 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Sets X and Y minimum and maximum for a table cell
*
- * @param string table The table name of which sets XY co-ordinates
+ * @param string $table The table name of which sets XY co-ordinates
+ *
+ * @return nothing
+ *
* @access private
*/
private function _setMinMax($table)
@@ -784,32 +962,49 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Defines relation objects
*
- * @param string master_table The master table name
- * @param string master_field The relation field in the master table
- * @param string foreign_table The foreign table name
- * @param string foreign_field The relation field in the foreign table
- * @param boolean show_info Whether to display table position or not
+ * @param string $masterTable The master table name
+ * @param string $masterField The relation field in the master table
+ * @param string $foreignTable The foreign table name
+ * @param string $foreignField The relation field in the foreign table
+ * @param boolean $showInfo Whether to display table position or not
+ *
* @access private
+ *
+ * @return nothing
+ *
* @see _setMinMax
*/
private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showInfo)
{
if (! isset($this->tables[$masterTable])) {
- $this->tables[$masterTable] = new Table_Stats($masterTable, $this->_ff, $this->pageNumber, $this->_tablewidth, false, $showInfo);
+ $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])) {
- $this->tables[$foreignTable] = new Table_Stats($foreignTable, $this->_ff, $this->pageNumber, $this->_tablewidth, false, $showInfo);
+ $this->tables[$foreignTable] = new Table_Stats(
+ $foreignTable, $this->_ff, $this->pageNumber,
+ $this->_tablewidth, false, $showInfo
+ );
$this->_setMinMax($this->tables[$foreignTable]);
}
- $this->relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
+ $this->relations[] = new Relation_Stats(
+ $this->tables[$masterTable], $masterField,
+ $this->tables[$foreignTable], $foreignField
+ );
}
/**
* Draws the grid
*
* @global object the current PMA_Schema_PDF instance
+ *
* @access private
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF
*/
private function _strokeGrid()
@@ -831,19 +1026,35 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$pdf->SetDrawColor(200, 200, 200);
// Draws horizontal lines
for ($l = 0; $l <= intval(($pdf->getPageHeight() - $topSpace - $bottomSpace) / $gridSize); $l++) {
- $pdf->line(0, $l * $gridSize + $topSpace, $pdf->getPageWidth(), $l * $gridSize + $topSpace);
+ $pdf->line(
+ 0, $l * $gridSize + $topSpace,
+ $pdf->getPageWidth(), $l * $gridSize + $topSpace
+ );
// Avoid duplicates
- if ($l > 0 && $l <= intval(($pdf->getPageHeight() - $topSpace - $bottomSpace - $labelHeight) / $gridSize)) {
+ if ($l > 0
+ && $l <= intval(($pdf->getPageHeight() - $topSpace - $bottomSpace - $labelHeight) / $gridSize)
+ ) {
$pdf->SetXY(0, $l * $gridSize + $topSpace);
- $label = (string) sprintf('%.0f', ($l * $gridSize + $topSpace - $this->topMargin) * $this->scale + $this->_yMin);
+ $label = (string) sprintf(
+ '%.0f',
+ ($l * $gridSize + $topSpace - $this->topMargin) * $this->scale + $this->_yMin
+ );
$pdf->Cell($labelWidth, $labelHeight, ' ' . $label);
} // end if
} // end for
// Draws vertical lines
for ($j = 0; $j <= intval($pdf->getPageWidth() / $gridSize); $j++) {
- $pdf->line($j * $gridSize, $topSpace, $j * $gridSize, $pdf->getPageHeight() - $bottomSpace);
+ $pdf->line(
+ $j * $gridSize,
+ $topSpace,
+ $j * $gridSize,
+ $pdf->getPageHeight() - $bottomSpace
+ );
$pdf->SetXY($j * $gridSize, $topSpace);
- $label = (string) sprintf('%.0f', ($j * $gridSize - $this->leftMargin) * $this->scale + $this->_xMin);
+ $label = (string) sprintf(
+ '%.0f',
+ ($j * $gridSize - $this->leftMargin) * $this->scale + $this->_xMin
+ );
$pdf->Cell($labelWidth, $labelHeight, $label);
}
}
@@ -851,8 +1062,12 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Draws relation arrows
*
- * @param boolean changeColor Whether to use one color per relation or not
+ * @param boolean $changeColor Whether to use one color per relation or not
+ *
* @access private
+ *
+ * @return nothing
+ *
* @see Relation_Stats::relationdraw()
*/
private function _drawRelations($changeColor)
@@ -867,8 +1082,12 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Draws tables
*
- * @param boolean changeColor Whether to display table position or not
+ * @param boolean $changeColor Whether to display table position or not
+ *
* @access private
+ *
+ * @return nothing
+ *
* @see Table_Stats::tableDraw()
*/
private function _drawTables($changeColor = 0)
@@ -882,11 +1101,16 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
* Ouputs the PDF document to a file
* or sends the output to browser
*
+ * @param integer $pageNumber page number
+ *
* @global object The current PDF document
* @global string The current database name
* @global integer The current page number (from the
- * $cfg['Servers'][$i]['table_coords'] table)
+ * $cfg['Servers'][$i]['table_coords'] table)
* @access private
+ *
+ * @return nothing
+ *
* @see PMA_Schema_PDF
*/
private function _showOutput($pageNumber)
@@ -894,8 +1118,10 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
global $pdf, $db, $cfgRelation;
// Get the name of this pdfpage to use as filename
- $_name_sql = 'SELECT page_descr FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
- . ' WHERE page_nr = ' . $pageNumber;
+ $_name_sql = 'SELECT page_descr FROM '
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['pdf_pages'])
+ . ' WHERE page_nr = ' . $pageNumber;
$_name_rs = PMA_query_as_controluser($_name_sql);
if ($_name_rs) {
$_name_row = PMA_DBI_fetch_row($_name_rs);
@@ -919,36 +1145,54 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$pdf->PMA_links['doc'][$table]['-'] = $pdf->AddLink();
$pdf->SetX(10);
// $pdf->Ln(1);
- $pdf->Cell(0, 6, __('Page number:') . ' {' . sprintf("%02d", $i) . '}', 0, 0, 'R', 0, $pdf->PMA_links['doc'][$table]['-']);
+ $pdf->Cell(
+ 0, 6, __('Page number:') . ' {' . sprintf("%02d", $i) . '}', 0, 0,
+ 'R', 0, $pdf->PMA_links['doc'][$table]['-']
+ );
$pdf->SetX(10);
- $pdf->Cell(0, 6, $i . ' ' . $table, 0, 1, 'L', 0, $pdf->PMA_links['doc'][$table]['-']);
+ $pdf->Cell(
+ 0, 6, $i . ' ' . $table, 0, 1,
+ 'L', 0, $pdf->PMA_links['doc'][$table]['-']
+ );
// $pdf->Ln(1);
$fields = PMA_DBI_get_columns($GLOBALS['db'], $table);
- foreach($fields as $row) {
+ foreach ($fields as $row) {
$pdf->SetX(20);
$field_name = $row['Field'];
$pdf->PMA_links['doc'][$table][$field_name] = $pdf->AddLink();
- // $pdf->Cell(0, 6, $field_name,0,1,'L',0, $pdf->PMA_links['doc'][$table][$field_name]);
+ //$pdf->Cell(
+ // 0, 6, $field_name, 0, 1,
+ // 'L', 0, $pdf->PMA_links['doc'][$table][$field_name]
+ //);
}
$lasttable = $table;
$i++;
}
$pdf->PMA_links['RT']['-'] = $pdf->AddLink();
$pdf->SetX(10);
- $pdf->Cell(0, 6, __('Page number:') . ' {00}', 0, 0, 'R', 0, $pdf->PMA_links['RT']['-']);
+ $pdf->Cell(
+ 0, 6, __('Page number:') . ' {00}', 0, 0,
+ 'R', 0, $pdf->PMA_links['RT']['-']
+ );
$pdf->SetX(10);
- $pdf->Cell(0, 6, $i . ' ' . __('Relational schema'), 0, 1, 'L', 0, $pdf->PMA_links['RT']['-']);
+ $pdf->Cell(
+ 0, 6, $i . ' ' . __('Relational schema'), 0, 1,
+ 'L', 0, $pdf->PMA_links['RT']['-']
+ );
$z = 0;
foreach ($alltables as $table) {
$z++;
$pdf->SetAutoPageBreak(true, 15);
$pdf->addpage($GLOBALS['orientation']);
$pdf->Bookmark($table);
- $pdf->SetAlias('{' . sprintf("%02d", $z) . '}', $pdf->PageNo()) ;
+ $pdf->SetAlias('{' . sprintf("%02d", $z) . '}', $pdf->PageNo());
$pdf->PMA_links['RT'][$table]['-'] = $pdf->AddLink();
$pdf->SetLink($pdf->PMA_links['doc'][$table]['-'], -1);
$pdf->SetFont($this->_ff, 'B', 18);
- $pdf->Cell(0, 8, $z . ' ' . $table, 1, 1, 'C', 0, $pdf->PMA_links['RT'][$table]['-']);
+ $pdf->Cell(
+ 0, 8, $z . ' ' . $table, 1, 1,
+ 'C', 0, $pdf->PMA_links['RT'][$table]['-']
+ );
$pdf->SetFont($this->_ff, '', 8);
$pdf->ln();
@@ -962,11 +1206,21 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
* Gets table informations
*/
$showtable = PMA_Table::sGetStatusInfo($db, $table);
- $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
- $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
- $create_time = (isset($showtable['Create_time']) ? PMA_localisedDate(strtotime($showtable['Create_time'])) : '');
- $update_time = (isset($showtable['Update_time']) ? PMA_localisedDate(strtotime($showtable['Update_time'])) : '');
- $check_time = (isset($showtable['Check_time']) ? PMA_localisedDate(strtotime($showtable['Check_time'])) : '');
+ $num_rows = isset($showtable['Rows'])
+ ? $showtable['Rows']
+ : 0;
+ $show_comment = isset($showtable['Comment'])
+ ? $showtable['Comment']
+ : '';
+ $create_time = isset($showtable['Create_time'])
+ ? PMA_localisedDate(strtotime($showtable['Create_time']))
+ : '';
+ $update_time = isset($showtable['Update_time'])
+ ? PMA_localisedDate(strtotime($showtable['Update_time']))
+ : '';
+ $check_time = isset($showtable['Check_time'])
+ ? PMA_localisedDate(strtotime($showtable['Check_time']))
+ : '';
/**
* Gets table keys and retains them
@@ -996,7 +1250,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
}
// I don't know what does following column mean....
- // $indexes_info[$row['Key_name']]['Packed'] = $row['Packed'];
+ // $indexes_info[$row['Key_name']]['Packed'] = $row['Packed'];
$indexes_info[$row['Key_name']]['Comment'] = $row['Comment'];
$indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name'] = $row['Column_name'];
@@ -1032,22 +1286,22 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
*/
$break = false;
- if (!empty($show_comment)) {
+ if (! empty($show_comment)) {
$pdf->Cell(0, 3, __('Table comments') . ' : ' . $show_comment, 0, 1);
$break = true;
}
- if (!empty($create_time)) {
+ if (! empty($create_time)) {
$pdf->Cell(0, 3, __('Creation') . ': ' . $create_time, 0, 1);
$break = true;
}
- if (!empty($update_time)) {
+ if (! empty($update_time)) {
$pdf->Cell(0, 3, __('Last update') . ': ' . $update_time, 0, 1);
$break = true;
}
- if (!empty($check_time)) {
+ if (! empty($check_time)) {
$pdf->Cell(0, 3, __('Last check') . ': ' . $check_time, 0, 1);
$break = true;
}
@@ -1095,8 +1349,8 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
foreach ($columns as $row) {
$extracted_fieldspec = PMA_extractFieldSpec($row['Type']);
- $type = $extracted_fieldspec['print_type'];
- $attribute = $extracted_fieldspec['attribute'];
+ $type = $extracted_fieldspec['print_type'];
+ $attribute = $extracted_fieldspec['attribute'];
if (! isset($row['Default'])) {
if ($row['Null'] != '' && $row['Null'] != 'NO') {
$row['Default'] = 'NULL';
@@ -1107,22 +1361,28 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$pdf->PMA_links['RT'][$table][$field_name] = $pdf->AddLink();
$pdf->Bookmark($field_name, 1, -1);
$pdf->SetLink($pdf->PMA_links['doc'][$table][$field_name], -1);
- $pdf_row = array($field_name,
+ $pdf_row = array(
+ $field_name,
$type,
$attribute,
($row['Null'] == '' || $row['Null'] == 'NO') ? __('No') : __('Yes'),
- ((isset($row['Default'])) ? $row['Default'] : ''),
+ (isset($row['Default']) ? $row['Default'] : ''),
$row['Extra'],
- ((isset($res_rel[$field_name])) ? $res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field'] : ''),
- ((isset($comments[$field_name])) ? $comments[$field_name] : ''),
- ((isset($mime_map) && isset($mime_map[$field_name])) ? str_replace('_', '/', $mime_map[$field_name]['mimetype']) : '')
- );
+ (isset($res_rel[$field_name])
+ ? $res_rel[$field_name]['foreign_table'] . ' -> ' . $res_rel[$field_name]['foreign_field']
+ : ''),
+ (isset($comments[$field_name])
+ ? $comments[$field_name]
+ : ''),
+ (isset($mime_map) && isset($mime_map[$field_name])
+ ? str_replace('_', '/', $mime_map[$field_name]['mimetype'])
+ : '')
+ );
$links[0] = $pdf->PMA_links['RT'][$table][$field_name];
- if (isset($res_rel[$field_name]['foreign_table']) AND
- isset($res_rel[$field_name]['foreign_field']) AND
- isset($pdf->PMA_links['doc'][$res_rel[$field_name]['foreign_table']][$res_rel[$field_name]['foreign_field']])
- )
- {
+ if (isset($res_rel[$field_name]['foreign_table'])
+ AND isset($res_rel[$field_name]['foreign_field'])
+ AND isset($pdf->PMA_links['doc'][$res_rel[$field_name]['foreign_table']][$res_rel[$field_name]['foreign_field']])
+ ) {
$links[6] = $pdf->PMA_links['doc'][$res_rel[$field_name]['foreign_table']][$res_rel[$field_name]['foreign_field']];
} else {
unset($links[6]);
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16236-gb0ed51d
by Piotr Przybylski 20 Aug '11
by Piotr Przybylski 20 Aug '11
20 Aug '11
The branch, master has been updated
via b0ed51d8cdaa0ec42649f6258932889687890594 (commit)
from 4adf3478e6b64d7ea77e8d5cdffa4f7cd829f56d (commit)
- Log -----------------------------------------------------------------
commit b0ed51d8cdaa0ec42649f6258932889687890594
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Sat Aug 20 13:51:06 2011 +0200
Remove todo item
-----------------------------------------------------------------------
Summary of changes:
libraries/advisory_rules.txt | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/libraries/advisory_rules.txt b/libraries/advisory_rules.txt
index c3445e0..7745157 100644
--- a/libraries/advisory_rules.txt
+++ b/libraries/advisory_rules.txt
@@ -214,7 +214,6 @@ rule 'Rate of reading first index entry'
This usually indicates frequent full index scans. Full index scans are faster than table scans but require lots of CPU cycles in big tables, if those tables that have or had high volumes of UPDATEs and DELETEs, running 'OPTIMIZE TABLE' might reduce the amount of and/or speed up full index scans. Other than that full index scans can only be reduced by rewriting queries.
Index scans average: %s, this value should be less than 1 per hour | PMA_bytime(value,2)
-# This rule may be applicable to MyISAM-only workloads, but completely wrong for InnoDB - http://www.mysqlperformanceblog.com/2010/06/15/what-does-handler_read_rnd-m…
rule 'Rate of reading fixed position'
Handler_read_rnd / Uptime
value * 60 * 60 > 1
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16235-g4adf347
by Marc Delisle 20 Aug '11
by Marc Delisle 20 Aug '11
20 Aug '11
The branch, master has been updated
via 4adf3478e6b64d7ea77e8d5cdffa4f7cd829f56d (commit)
via c0651983be13538c25fea9515150702fbeeb7124 (commit)
via cae2c2a52b54c0dbdf952283cfd29baf2d9d03cf (commit)
via b441555d688ce1d01b71a0f241b29257d4765298 (commit)
via 7c25bb1b734f6728bd80c7233e7a759bb4cabc4e (commit)
via 01d5a76ca992bb521530a804ef358c3ec3e5094c (commit)
via 7a821c8a367c78116b3cfc649ca1c4c8e10cd861 (commit)
via 328c5d5b27d8744d4d073971ca47c972df60ab3b (commit)
via ed98d7ead90a73e64602ee20621d54f0b33f39dc (commit)
via 8dd9309fcb059623f51f516689ef222f3b5904fe (commit)
from 681df0a9f9380ae2b5f8f065f6b5b3e986a23351 (commit)
- Log -----------------------------------------------------------------
commit 4adf3478e6b64d7ea77e8d5cdffa4f7cd829f56d
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Aug 20 07:35:38 2011 -0400
Typo, English improvements
commit c0651983be13538c25fea9515150702fbeeb7124
Merge: 681df0a cae2c2a
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Aug 20 07:33:07 2011 -0400
Merge commit 'cae2c2a52b54c0dbdf952283cfd29baf2d9d03cf'
commit cae2c2a52b54c0dbdf952283cfd29baf2d9d03cf
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Sat Aug 20 11:02:47 2011 +0530
Modified the 'How to use?' message for info about mousewheel zoom and panning feature
commit b441555d688ce1d01b71a0f241b29257d4765298
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Sat Aug 20 10:58:33 2011 +0530
Added FAQ in Documentation.html about 'How to use Zoom search feature?' (FAQ 6.32)
commit 7c25bb1b734f6728bd80c7233e7a759bb4cabc4e
Merge: 01d5a76 9b2570b
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Sat Aug 20 10:09:21 2011 +0530
Merge remote branch 'phpmyadmin/master'
commit 01d5a76ca992bb521530a804ef358c3ec3e5094c
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Fri Aug 19 09:13:01 2011 +0530
Added "Reset Zoom" link that reverts the plot to original display.
commit 7a821c8a367c78116b3cfc649ca1c4c8e10cd861
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Fri Aug 19 09:03:55 2011 +0530
Improved the panning feature
commit 328c5d5b27d8744d4d073971ca47c972df60ab3b
Merge: ed98d7e 676b0cc
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Fri Aug 19 08:14:44 2011 +0530
Merge remote branch 'phpmyadmin/master'
Conflicts:
js/tbl_zoom_plot.js
commit ed98d7ead90a73e64602ee20621d54f0b33f39dc
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Mon Aug 15 17:18:07 2011 +0530
Added: Mousewheel zoom and panning feature
commit 8dd9309fcb059623f51f516689ef222f3b5904fe
Merge: 1b7e2f6 b319651
Author: Ammar Yasir <ammaryasir.88(a)gmail.com>
Date: Fri Aug 12 23:33:13 2011 +0530
Merge remote branch 'phpmyadmin/master'
-----------------------------------------------------------------------
Summary of changes:
Documentation.html | 32 ++-
js/messages.php | 4 +-
js/tbl_zoom_plot.js | 761 +++++++++++++++++++++++++++++----------------------
tbl_zoom_select.php | 1 +
4 files changed, 467 insertions(+), 331 deletions(-)
diff --git a/Documentation.html b/Documentation.html
index d7c76e1..d590a6b 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -4410,13 +4410,43 @@ chmod o+rwx tmp
</ul>
<h4 id="faq6_31">
- <a href="#faq6_31">6.30 How do I create a relation in designer?</a></h4>
+ <a href="#faq6_31">6.31 How do I create a relation in designer?</a></h4>
<p>To select relation, click :</p>
<img src="pmd/images/help_relation.png"></p>
<p>The display column is shown in pink. To set/unset a column as the display column, click the "Choose column to display" icon, then click on the appropriate column name.</p>
+<h4 id="faq6_32">
+ <a href="#faq6_32">6.32 How can I use the zoom search feature?</a></h4>
+
+ <p> The Zoom search feature is an alternative to table search feature. It allows you to explore
+ a table by representing its data in a scatter plot. You can locate this feature by selecting
+ a table and clicking the 'Search' tab. One of the sub-tabs in the 'Table Search' page is
+ 'Zoom Search'. <br/><br/>
+
+ Consider the table REL_persons in <a href="#faq6_6"><abbr title="Frequently Asked Questions">
+ FAQ</abbr> 6.6</a> for an example. To use zoom search, two columns need to be selected,
+ for example, id and town_code. The id values will be represented on one axis and town_code
+ values on the other axis. Each row will be represented as a point in a scatter plot based
+ on its id and town_code. You can include two additional search criteria apart from the two
+ fields to display.<br/><br/>
+
+ You can choose which field should be displayed as label for each point. If a display
+ column has been set for the table (see <a href="#faqdisplay"><abbr title="Frequently Asked
+ Questions">FAQ</abbr> 6.7</a>), it is taken as the label unless you specify otherwise.
+ You can also select the maximum number of rows you want to be displayed in the plot by
+ specifing it in the 'Max rows to plot' field. Once you have decided over your criteria,
+ click 'Go' to display the plot.<br/><br/>
+
+ After the plot is generated, you can use the mousewheel to zoom in and out of the plot.
+ In addition, panning feature is enabled to navigate through the plot. You can zoom-in to
+ a certail level of detail and use panning to locate your area of interest. Clicking on a
+ point opens a dialogue box, displaying field values of the data row represented by the point.
+ You can edit the values if required and click on submit to issue an update query. Basic
+ instructions on how to use can be viewed by clicking the 'How to use?' link located just above
+ the plot.</p>
+
<h3 id="faqproject">phpMyAdmin project</h3>
<h4 id="faq7_1">
diff --git a/js/messages.php b/js/messages.php
index 7bb7bd3..8a606dc 100644
--- a/js/messages.php
+++ b/js/messages.php
@@ -265,7 +265,9 @@ $js_messages['strDisplayHelp'] = '<ul><li>'
. '</li><li>'
. __('Hovering over a point will show its label.')
. '</li><li>'
- . __('Drag and select an area in the plot to zoom into it.')
+ . __('Use mousewheel to zoom in or out of the plot.')
+ . '</li><li>'
+ . __('Click and drag the mouse to navigate the plot.')
. '</li><li>'
. __('Click reset zoom link to come back to original state.')
. '</li><li>'
diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index 796b543..e773175 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -35,7 +35,7 @@ Array.min = function (array) {
/**
** Checks if a string contains only numeric value
- ** @param n: String (to be checked)
+ ** @param n: String (to be checked)
**/
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
@@ -43,7 +43,7 @@ function isNumeric(n) {
/**
** Checks if an object is empty
- ** @param n: Object (to be checked)
+ ** @param n: Object (to be checked)
**/
function isEmpty(obj) {
var name;
@@ -59,15 +59,15 @@ function isEmpty(obj) {
** @param type String Field type(datetime/timestamp/time/date)
**/
function getDate(val,type) {
- if (type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
- }
- else if (type.toString().search(/time/i) != -1) {
- return Highcharts.dateFormat('%H:%M:%S', val + 19800000)
- }
+ if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
+ return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
+ }
+ else if(type.toString().search(/time/i) != -1) {
+ return Highcharts.dateFormat('%H:%M:%S', val)
+ }
else if (type.toString().search(/date/i) != -1) {
return Highcharts.dateFormat('%Y-%m-%e', val)
- }
+ }
}
/**
@@ -76,30 +76,30 @@ function getDate(val,type) {
** @param type Sring Field type(datetime/timestamp/time/date)
**/
function getTimeStamp(val,type) {
- if (type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
- }
- else if (type.toString().search(/time/i) != -1) {
- return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
- }
+ if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
+ return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
+ }
+ else if(type.toString().search(/time/i) != -1) {
+ return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
+ }
else if (type.toString().search(/date/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd')
- }
+ return getDateFromFormat(val,'yyyy-MM-dd')
+ }
}
/**
** Classifies the field type into numeric,timeseries or text
** @param field: field type (as in database structure)
- **/
+ **/
function getType(field) {
- if (field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
- return 'numeric';
- else if (field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
- return 'time';
- else
- return 'text';
+ if(field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
+ return 'numeric';
+ else if(field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
+ return 'time';
+ else
+ return 'text';
}
-/**
+/**
** Converts a categorical array into numeric array
** @param array categorical values array
**/
@@ -121,6 +121,51 @@ function scrollToChart() {
$('html,body').animate({scrollTop: x}, 500);
}
+/**
+ ** Handlers for panning feature
+ **/
+function includePan(currentChart) {
+ var mouseDown;
+ var lastX;
+ var lastY;
+ var chartWidth = $('#resizer').width() - 3;
+ var chartHeight = $('#resizer').height() - 20;
+ $('#querychart').mousedown(function() {
+ mouseDown = 1;
+ });
+
+ $('#querychart').mouseup(function() {
+ mouseDown = 0;
+ });
+ $('#querychart').mousemove(function(e) {
+ if (mouseDown == 1) {
+ if (e.pageX > lastX) {
+ var xExtremes = currentChart.xAxis[0].getExtremes();
+ var diff = (e.pageX - lastX) * (xExtremes.max - xExtremes.min) / chartWidth;
+ currentChart.xAxis[0].setExtremes(xExtremes.min - diff, xExtremes.max - diff);
+ }
+ else if (e.pageX < lastX) {
+ var xExtremes = currentChart.xAxis[0].getExtremes();
+ var diff = (lastX - e.pageX) * (xExtremes.max - xExtremes.min) / chartWidth;
+ currentChart.xAxis[0].setExtremes(xExtremes.min + diff, xExtremes.max + diff);
+ }
+
+ if (e.pageY > lastY) {
+ var yExtremes = currentChart.yAxis[0].getExtremes();
+ var ydiff = 1.0 * (e.pageY - lastY) * (yExtremes.max - yExtremes.min) / chartHeight;
+ currentChart.yAxis[0].setExtremes(yExtremes.min + ydiff, yExtremes.max + ydiff);
+ }
+ else if (e.pageY < lastY) {
+ var yExtremes = currentChart.yAxis[0].getExtremes();
+ var ydiff = 1.0 * (lastY - e.pageY) * (yExtremes.max - yExtremes.min) / chartHeight;
+ currentChart.yAxis[0].setExtremes(yExtremes.min - ydiff, yExtremes.max - ydiff);
+ }
+ }
+ lastX = e.pageX;
+ lastY = e.pageY;
+ });
+}
+
$(document).ready(function() {
/**
@@ -131,7 +176,7 @@ $(document).ready(function() {
cache: 'false'
});
- var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer';
+ var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer';
var currentChart = null;
var currentData = null;
var xLabel = $('#tableid_0').val();
@@ -139,8 +184,12 @@ $(document).ready(function() {
var xType = $('#types_0').val();
var yType = $('#types_1').val();
var dataLabel = $('#dataLabel').val();
+ var lastX;
+ var lastY;
+ var zoomRatio = 1;
+
- // Get query result
+ // Get query result
var data = jQuery.parseJSON($('#querydata').html());
/**
@@ -164,16 +213,16 @@ $(document).ready(function() {
/**
* Input form validation
- **/
+ **/
$('#inputFormSubmitId').click(function() {
- if ($('#tableid_0').get(0).selectedIndex == 0 || $('#tableid_1').get(0).selectedIndex == 0)
- PMA_ajaxShowMessage(PMA_messages['strInputNull']);
- else if (xLabel == yLabel)
+ if ($('#tableid_0').get(0).selectedIndex == 0 || $('#tableid_1').get(0).selectedIndex == 0)
+ PMA_ajaxShowMessage(PMA_messages['strInputNull']);
+ else if (xLabel == yLabel)
PMA_ajaxShowMessage(PMA_messages['strSameInputs']);
});
/**
- ** Prepare a div containing a link, otherwise it's incorrectly displayed
+ ** Prepare a div containing a link, otherwise it's incorrectly displayed
** after a couple of clicks
**/
$('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>')
@@ -191,177 +240,177 @@ $(document).ready(function() {
} else {
$link.text(PMA_messages['strHideSearchCriteria']);
}
- // avoid default click action
- return false;
- });
-
- /**
+ // avoid default click action
+ return false;
+ });
+
+ /**
** Set dialog properties for the data display form
**/
$("#dataDisplay").dialog({
autoOpen: false,
- title: 'Data point content',
+ title: 'Data point content',
modal: false, //false otherwise other dialogues like timepicker may not function properly
height: $('#dataDisplay').height() + 80,
width: $('#dataDisplay').width() + 80
});
/*
- * Handle submit of zoom_display_form
+ * Handle submit of zoom_display_form
*/
-
+
$("#submitForm").click(function(event) {
-
+
//Prevent default submission of form
event.preventDefault();
-
- //Find changed values by comparing form values with selectedRow Object
- var newValues = new Array();//Stores the values changed from original
+
+ //Find changed values by comparing form values with selectedRow Object
+ var newValues = new Array();//Stores the values changed from original
var it = 4;
var xChange = false;
var yChange = false;
- for (key in selectedRow) {
- if (key != 'where_clause'){
- var oldVal = selectedRow[key];
- var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
- if (oldVal != newVal){
- selectedRow[key] = newVal;
- newValues[key] = newVal;
- if (key == xLabel) {
- xChange = true;
- data[currentData][xLabel] = newVal;
- }
- else if (key == yLabel) {
- yChange = true;
- data[currentData][yLabel] = newVal;
- }
- }
- }
- it++
- }//End data update
-
- //Update the chart series and replot
+ for (key in selectedRow) {
+ if (key != 'where_clause'){
+ var oldVal = selectedRow[key];
+ var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
+ if (oldVal != newVal){
+ selectedRow[key] = newVal;
+ newValues[key] = newVal;
+ if(key == xLabel) {
+ xChange = true;
+ data[currentData][xLabel] = newVal;
+ }
+ else if(key == yLabel) {
+ yChange = true;
+ data[currentData][yLabel] = newVal;
+ }
+ }
+ }
+ it++
+ }//End data update
+
+ //Update the chart series and replot
if (xChange || yChange) {
- var newSeries = new Array();
- newSeries[0] = new Object();
+ var newSeries = new Array();
+ newSeries[0] = new Object();
newSeries[0].marker = {
symbol: 'circle'
};
- //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
- if (xChange) {
- xCord[currentData] = selectedRow[xLabel];
- if (xType == 'numeric') {
- currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
- currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
- }
- else if (xType == 'time') {
- currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
+ //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
+ if(xChange) {
+ xCord[currentData] = selectedRow[xLabel];
+ if(xType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
+ currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
}
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
- if (yType != 'text')
- newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ else if(xType == 'time') {
+ currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
+ }
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
+ if(yType != 'text')
+ newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if (tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
}
}
- currentSettings.series = newSeries;
+ currentSettings.series = newSeries;
currentChart = PMA_createChart(currentSettings);
- }
+ }
- }
- if (yChange) {
+ }
+ if(yChange) {
- yCord[currentData] = selectedRow[yLabel];
- if (yType == 'numeric') {
- currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
- currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
+ yCord[currentData] = selectedRow[yLabel];
+ if(yType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
+ currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
}
- else if (yType =='time') {
- currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
- }
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
- if (xType != 'text' )
+ else if(yType =='time') {
+ currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
+ }
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
+ if(xType != 'text' )
newSeries[0].data.push({ name: value[dataLabel], x: value[xLabel], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.yAxis.labels = { formatter : function() {
- if (tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
}
}
- currentSettings.series = newSeries;
- currentChart = PMA_createChart(currentSettings);
- }
- }
- currentChart.series[0].data[currentData].select();
+ currentSettings.series = newSeries;
+ currentChart = PMA_createChart(currentSettings);
+ }
+ }
+ currentChart.series[0].data[currentData].select();
}
- //End plot update
+ //End plot update
- //Generate SQL query for update
- if (!isEmpty(newValues)) {
+ //Generate SQL query for update
+ if (!isEmpty(newValues)) {
var sql_query = 'UPDATE `' + window.parent.table + '` SET ';
- for (key in newValues) {
- if (key != 'where_clause') {
- sql_query += '`' + key + '`=' ;
- var value = newValues[key];
- if (!isNumeric(value) && value != null)
- sql_query += '\'' + value + '\' ,';
- else
- sql_query += value + ' ,';
- }
- }
- sql_query = sql_query.substring(0, sql_query.length - 1);
- sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
-
- //Post SQL query to sql.php
- $.post('sql.php', {
+ for (key in newValues) {
+ if(key != 'where_clause') {
+ sql_query += '`' + key + '`=' ;
+ var value = newValues[key];
+ if(!isNumeric(value) && value != null)
+ sql_query += '\'' + value + '\' ,';
+ else
+ sql_query += value + ' ,';
+ }
+ }
+ sql_query = sql_query.substring(0, sql_query.length - 1);
+ sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
+
+ //Post SQL query to sql.php
+ $.post('sql.php', {
'token' : window.parent.token,
'db' : window.parent.db,
'ajax_request' : true,
'sql_query' : sql_query,
- 'inline_edit' : false
- }, function(data) {
- if (data.success == true) {
- $('#sqlqueryresults').html(data.sql_query);
- $("#sqlqueryresults").trigger('appendAnchor');
- }
- else
- PMA_ajaxShowMessage(data.error);
- })//End $.post
- }//End database update
- $("#dataDisplay").dialog("close");
- });//End submit handler
+ 'inline_edit' : false
+ }, function(data) {
+ if(data.success == true) {
+ $('#sqlqueryresults').html(data.sql_query);
+ $("#sqlqueryresults").trigger('appendAnchor');
+ }
+ else
+ PMA_ajaxShowMessage(data.error);
+ })//End $.post
+ }//End database update
+ $("#dataDisplay").dialog("close");
+ });//End submit handler
/*
* Generate plot using Highcharts
- */
+ */
if (data != null) {
$('#zoom_search_form')
@@ -369,87 +418,101 @@ $(document).ready(function() {
.hide();
$('#togglesearchformlink')
.text(PMA_messages['strShowSearchCriteria'])
- $('#togglesearchformdiv').show();
+ $('#togglesearchformdiv').show();
var selectedRow;
- var columnNames = new Array();
- var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
- var series = new Array();
- var xCord = new Array();
- var yCord = new Array();
- var xCat = new Array();
- var yCat = new Array();
- var tempX, tempY;
- var it = 0;
+ var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
+ var series = new Array();
+ var xCord = new Array();
+ var yCord = new Array();
+ var tempX, tempY;
+ var it = 0;
+ var xMax; // xAxis extreme max
+ var xMin; // xAxis extreme min
+ var yMax; // yAxis extreme max
+ var yMin; // yAxis extreme min
// Set the basic plot settings
var currentSettings = {
chart: {
- renderTo: 'querychart',
- type: 'scatter',
- zoomType: 'xy',
- width:$('#resizer').width() -3,
- height:$('#resizer').height()-20
- },
- credits: {
- enabled: false
+ renderTo: 'querychart',
+ type: 'scatter',
+ //zoomType: 'xy',
+ width:$('#resizer').width() -3,
+ height:$('#resizer').height()-20
+ },
+ credits: {
+ enabled: false
},
- exporting: { enabled: false },
+ exporting: { enabled: false },
label: { text: $('#dataLabel').val() },
- plotOptions: {
- series: {
- allowPointSelect: true,
+ plotOptions: {
+ series: {
+ allowPointSelect: true,
cursor: 'pointer',
- showInLegend: false,
+ showInLegend: false,
dataLabels: {
- enabled: false
+ enabled: false,
},
- point: {
+ point: {
events: {
click: function() {
- var id = this.id;
- var fid = 4;
- currentData = id;
- // Make AJAX request to tbl_zoom_select.php for getting the complete row info
- var post_params = {
+ var id = this.id;
+ var fid = 4;
+ currentData = id;
+ // Make AJAX request to tbl_zoom_select.php for getting the complete row info
+ var post_params = {
'ajax_request' : true,
'get_data_row' : true,
'db' : window.parent.db,
'table' : window.parent.table,
'where_clause' : data[id]['where_clause'],
- 'token' : window.parent.token
+ 'token' : window.parent.token,
}
$.post('tbl_zoom_select.php', post_params, function(data) {
- // Row is contained in data.row_info, now fill the displayResultForm with row values
- for ( key in data.row_info) {
- if (data.row_info[key] == null)
- $('#fields_null_id_' + fid).attr('checked', true);
- else
- $('#fieldID_' + fid).val(data.row_info[key]);
- fid++;
- }
- selectedRow = new Object();
- selectedRow = data.row_info;
+ // Row is contained in data.row_info, now fill the displayResultForm with row values
+ for ( key in data.row_info) {
+ if (data.row_info[key] == null)
+ $('#fields_null_id_' + fid).attr('checked', true);
+ else
+ $('#fieldID_' + fid).val(data.row_info[key]);
+ fid++;
+ }
+ selectedRow = new Object();
+ selectedRow = data.row_info;
});
- $("#dataDisplay").dialog("open");
- }
+ $("#dataDisplay").dialog("open");
+ },
}
+ }
+ }
+ },
+ tooltip: {
+ formatter: function() {
+ return this.point.name;
+ }
+ },
+ title: { text: 'Query Results' },
+ xAxis: {
+ title: { text: $('#tableid_0').val() },
+ events: {
+ setExtremes: function(e){
+ this.resetZoom.show();
}
}
- },
- tooltip: {
- formatter: function() {
- return this.point.name;
- }
- },
- title: { text: 'Query Results' },
- xAxis: {
- title: { text: $('#tableid_0').val() }
+
},
yAxis: {
- min: null,
- title: { text: $('#tableid_1').val() }
- }
+ min: null,
+ title: { text: $('#tableid_1').val() },
+ endOnTick: false,
+ startOnTick: false,
+ events: {
+ setExtremes: function(e){
+ this.resetZoom.show();
+ }
+ }
+ },
}
$('#resizer').resizable({
@@ -461,145 +524,185 @@ $(document).ready(function() {
);
}
});
+
+ // Classify types as either numeric,time,text
+ xType = getType(xType);
+ yType = getType(yType);
- // Classify types as either numeric,time,text
- xType = getType(xType);
- yType = getType(yType);
-
- //Set the axis type based on the field
- currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
- currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
+ //Set the axis type based on the field
+ currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
+ currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
// Formulate series data for plot
series[0] = new Object();
series[0].data = new Array();
- series[0].marker = {
+ series[0].marker = {
symbol: 'circle'
};
- if (xType != 'text' && yType != 'text') {
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+ if (xType != 'text' && yType != 'text') {
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: xVal, y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- it++;
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ it++;
});
- if (xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
- }
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ if(xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
+ }
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
}
- if (yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
- }
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ if(yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
+ }
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
}
}
-
- else if (xType =='text' && yType !='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
-
- tempX = getCord(xCord);
- $.each(data,function(key,value) {
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+
+ else if (xType =='text' && yType !='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+
+ tempX = getCord(xCord);
+ $.each(data,function(key,value) {
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
-
- currentSettings.xAxis.labels = { formatter : function() {
- if (tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
- }
- }
- if (yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
+
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
+ }
}
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ if(yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
+ }
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
}
- xCord = tempX[2];
- }
-
- else if (xType !='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ xCord = tempX[2];
+ }
+
+ else if (xType !='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
series[0].data.push({ name: value[dataLabel], y: tempY[0][it], x: xVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- if (xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
+ if(xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
+ }
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
}
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
+ }
}
- currentSettings.yAxis.labels = { formatter : function() {
- if (tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
- }
- }
- yCord = tempY[2];
- }
-
- else if (xType =='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempX = getCord(xCord);
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
+ yCord = tempY[2];
+ }
+
+ else if (xType =='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempX = getCord(xCord);
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: tempY[0][it], marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if (tempX[1][this.value] && tempX[1][this.value].length > 10) {
- return tempX[1][this.value].substring(0,10)
- } else {
- return tempX[1][this.value];
- }
- }};
- currentSettings.yAxis.labels = { formatter : function() {
- if (tempY[1][this.value] && tempY[1][this.value].length > 10) {
- return tempY[1][this.value].substring(0,10);
- } else {
- return tempY[1][this.value];
- }
- }};
- xCord = tempX[2];
- yCord = tempY[2];
-
- }
-
- currentSettings.series = series;
+ currentSettings.xAxis.labels = { formatter : function() {
+ if(tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
+ }
+ }
+ currentSettings.yAxis.labels = { formatter : function() {
+ if(tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
+ }
+ }
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ }
+
+ currentSettings.series = series;
currentChart = PMA_createChart(currentSettings);
- scrollToChart();
+ xMin = currentChart.xAxis[0].getExtremes().min;
+ xMax = currentChart.xAxis[0].getExtremes().max;
+ yMin = currentChart.yAxis[0].getExtremes().min;
+ yMax = currentChart.yAxis[0].getExtremes().max;
+ includePan(currentChart); //Enable panning feature
+ var setZoom = function() {
+ var newxm = xMin + (xMax - xMin) * (1 - zoomRatio) / 2;
+ var newxM = xMax - (xMax - xMin) * (1 - zoomRatio) / 2;
+ var newym = yMin + (yMax - yMin) * (1 - zoomRatio) / 2;
+ var newyM = yMax - (yMax - yMin) * (1 - zoomRatio) / 2;
+ currentChart.xAxis[0].setExtremes(newxm,newxM);
+ currentChart.yAxis[0].setExtremes(newym,newyM);
+ };
+ //Enable zoom feature
+ $("#querychart").mousewheel(function(objEvent, intDelta) {
+ if (intDelta > 0) {
+ if (zoomRatio > 0.1) {
+ zoomRatio = zoomRatio - 0.1;
+ setZoom();
+ }
+ }
+ else if (intDelta < 0) {
+ zoomRatio = zoomRatio + 0.1;
+ setZoom();
+ }
+ });
+ //Add reset zoom feature
+ currentChart.yAxis[0].resetZoom = currentChart.xAxis[0].resetZoom = $('<a href="#">Reset zoom</a>')
+ .appendTo(currentChart.container)
+ .css({
+ position: 'absolute',
+ top: 10,
+ right: 20,
+ display: 'none'
+ })
+ .click(function(){
+ currentChart.xAxis[0].setExtremes(null, null)
+ currentChart.yAxis[0].setExtremes(null, null)
+ this.style.display = 'none'
+ });
+ scrollToChart();
}
});
diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php
index 3942e00..518121d 100644
--- a/tbl_zoom_select.php
+++ b/tbl_zoom_select.php
@@ -21,6 +21,7 @@ $GLOBALS['js_include'][] = 'sql.js';
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'tbl_zoom_plot.js';
$GLOBALS['js_include'][] = 'date.js';
+$GLOBALS['js_include'][] = 'jquery/jquery.mousewheel.js';
$GLOBALS['js_include'][] = 'highcharts/highcharts.js';
/* Files required for chart exporting */
$GLOBALS['js_include'][] = 'highcharts/exporting.js';
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16225-g681df0a
by Marc Delisle 20 Aug '11
by Marc Delisle 20 Aug '11
20 Aug '11
The branch, master has been updated
via 681df0a9f9380ae2b5f8f065f6b5b3e986a23351 (commit)
via 85f62705e4dbbbf34b1e1c3bbc790b66a0e78966 (commit)
via 69c14828baf1a6c256e91d55d899d33d7b05bb71 (commit)
from 249a1d5c8cd7796cb240f99389b731df0f02cc43 (commit)
- Log -----------------------------------------------------------------
commit 681df0a9f9380ae2b5f8f065f6b5b3e986a23351
Merge: 85f6270 249a1d5
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Aug 20 15:58:37 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 85f62705e4dbbbf34b1e1c3bbc790b66a0e78966
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Aug 20 15:55:02 2011 +0530
Rewrote the functions in querywindow.js using jquery
commit 69c14828baf1a6c256e91d55d899d33d7b05bb71
Merge: 90c010f 9147f30
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Aug 13 07:01:34 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
-----------------------------------------------------------------------
Summary of changes:
js/querywindow.js | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/js/querywindow.js b/js/querywindow.js
index ba9fe6e..55c895a 100644
--- a/js/querywindow.js
+++ b/js/querywindow.js
@@ -7,36 +7,35 @@ function PMA_queryAutoCommit()
function PMA_querywindowCommit(tab)
{
- document.getElementById('hiddenqueryform').querydisplay_tab.value = tab;
- document.getElementById('hiddenqueryform').submit();
+ $('#hiddenqueryform').find("input[name='querydisplay_tab']").attr("value" ,tab);
+ $('#hiddenqueryform').submit();
return false;
}
function PMA_querywindowSetFocus()
{
- document.getElementById('sqlquery').focus();
+ $('#sqlquery').focus();
}
function PMA_querywindowResize()
{
// for Gecko
- if (typeof(self.sizeToContent) == 'function') {
- self.sizeToContent();
+ if (typeof($(this)[0].sizeToContent) == 'function') {
+ $(this)[0].sizeToContent();
//self.scrollbars.visible = false;
// give some more space ... to prevent 'fli(pp/ck)ing'
- self.resizeBy(10, 50);
+ $(this)[0].resizeBy(10, 50);
return;
}
// for IE, Opera
- if (document.getElementById && typeof(document.getElementById('querywindowcontainer')) != 'undefined') {
-
+ if ($('#querywindowcontainer') != 'undefined') {
// get content size
- var newWidth = document.getElementById('querywindowcontainer').offsetWidth;
- var newHeight = document.getElementById('querywindowcontainer').offsetHeight;
+ var newWidth = $("#querywindowcontainer")[0].offsetWidth;
+ var newHeight = $("#querywindowcontainer")[0].offsetHeight;
// set size to contentsize
// plus some offset for scrollbars, borders, statusbar, menus ...
- self.resizeTo(newWidth + 45, newHeight + 75);
+ $(this)[0].resizeTo(newWidth + 45, newHeight + 75);
}
}
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16222-g249a1d5
by Madhura Jayaratne 20 Aug '11
by Madhura Jayaratne 20 Aug '11
20 Aug '11
The branch, master has been updated
via 249a1d5c8cd7796cb240f99389b731df0f02cc43 (commit)
via c5b108b716dd765f67b30d530d6d50f7791c2569 (commit)
from e3a3e26146c5856f1593656aefe73de7a6da683d (commit)
- Log -----------------------------------------------------------------
commit 249a1d5c8cd7796cb240f99389b731df0f02cc43
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Aug 20 07:30:11 2011 +0530
Coding style improvements to Eps_Relation_Schema
commit c5b108b716dd765f67b30d530d6d50f7791c2569
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Aug 20 07:29:53 2011 +0530
Coding style improvements to Dia_Relation_Schema
-----------------------------------------------------------------------
Summary of changes:
libraries/schema/Dia_Relation_Schema.class.php | 294 +++++++++------
libraries/schema/Eps_Relation_Schema.class.php | 462 +++++++++++++++---------
2 files changed, 463 insertions(+), 293 deletions(-)
diff --git a/libraries/schema/Dia_Relation_Schema.class.php b/libraries/schema/Dia_Relation_Schema.class.php
index fa2884d..11c03ec 100644
--- a/libraries/schema/Dia_Relation_Schema.class.php
+++ b/libraries/schema/Dia_Relation_Schema.class.php
@@ -5,7 +5,7 @@
* @package phpMyAdmin
*/
-include_once("Export_Relation_Schema.class.php");
+include_once "Export_Relation_Schema.class.php";
/**
* This Class inherits the XMLwriter class and
@@ -14,7 +14,6 @@ include_once("Export_Relation_Schema.class.php");
* @access public
* @see http://php.net/manual/en/book.xmlwriter.php
*/
-
class PMA_DIA extends XMLWriter
{
public $title;
@@ -44,7 +43,7 @@ class PMA_DIA extends XMLWriter
* Create the XML document
*/
- $this->startDocument('1.0','UTF-8');
+ $this->startDocument('1.0', 'UTF-8');
}
/**
@@ -55,27 +54,29 @@ class PMA_DIA extends XMLWriter
* to define the document, then finally a Layer starts which
* holds all the objects.
*
- * @param string paper The size of the paper/document
- * @param float topMargin top margin of the paper/document in cm
- * @param float bottomMargin bottom margin of the paper/document in cm
- * @param float leftMargin left margin of the paper/document in cm
- * @param float rightMargin right margin of the paper/document in cm
- * @param string portrait document will be portrait or landscape
+ * @param string $paper the size of the paper/document
+ * @param float $topMargin top margin of the paper/document in cm
+ * @param float $bottomMargin bottom margin of the paper/document in cm
+ * @param float $leftMargin left margin of the paper/document in cm
+ * @param float $rightMargin right margin of the paper/document in cm
+ * @param string $portrait document will be portrait or landscape
+ *
* @return void
+ *
* @access public
* @see XMLWriter::startElement(),XMLWriter::writeAttribute(),XMLWriter::writeRaw()
*/
function startDiaDoc($paper,$topMargin,$bottomMargin,$leftMargin,$rightMargin,$portrait)
{
- if($portrait == 'P'){
+ if ($portrait == 'P') {
$isPortrait='true';
- }else{
+ } else {
$isPortrait='false';
}
$this->startElement('dia:diagram');
$this->writeAttribute('xmlns:dia', 'http://www.lysator.liu.se/~alla/dia/');
$this->startElement('dia:diagramdata');
- $this->writeRaw (
+ $this->writeRaw(
'<dia:attribute name="background">
<dia:color val="#ffffff"/>
</dia:attribute>
@@ -85,22 +86,22 @@ class PMA_DIA extends XMLWriter
<dia:attribute name="paper">
<dia:composite type="paper">
<dia:attribute name="name">
- <dia:string>#'.$paper.'#</dia:string>
+ <dia:string>#' . $paper . '#</dia:string>
</dia:attribute>
<dia:attribute name="tmargin">
- <dia:real val="'.$topMargin.'"/>
+ <dia:real val="' . $topMargin . '"/>
</dia:attribute>
<dia:attribute name="bmargin">
- <dia:real val="'.$bottomMargin.'"/>
+ <dia:real val="' . $bottomMargin . '"/>
</dia:attribute>
<dia:attribute name="lmargin">
- <dia:real val="'.$leftMargin.'"/>
+ <dia:real val="' . $leftMargin . '"/>
</dia:attribute>
<dia:attribute name="rmargin">
- <dia:real val="'.$rightMargin.'"/>
+ <dia:real val="' . $rightMargin . '"/>
</dia:attribute>
<dia:attribute name="is_portrait">
- <dia:boolean val="'.$isPortrait.'"/>
+ <dia:boolean val="' . $isPortrait . '"/>
</dia:attribute>
<dia:attribute name="scaling">
<dia:real val="1"/>
@@ -160,18 +161,21 @@ class PMA_DIA extends XMLWriter
/**
* Output Dia Document for download
*
- * @param string fileName name of the dia document
+ * @param string $fileName name of the dia document
+ *
* @return void
* @access public
* @see XMLWriter::flush()
*/
function showOutput($fileName)
{
- if(ob_get_clean()){
+ if (ob_get_clean()) {
ob_end_clean();
}
$output = $this->flush();
- PMA_download_header($fileName . '.dia', 'application/x-dia-diagram', strlen($output));
+ PMA_download_header(
+ $fileName . '.dia', 'application/x-dia-diagram', strlen($output)
+ );
print $output;
}
}
@@ -200,14 +204,17 @@ class Table_Stats
/**
* The "Table_Stats" constructor
*
- * @param string table_name The table name
- * @param integer pageNumber The current page number (from the
- * $cfg['Servers'][$i]['table_coords'] table)
- * @param boolean showKeys Whether to display ONLY keys or not
+ * @param string $tableName The table name
+ * @param integer $pageNumber The current page number (from the
+ * $cfg['Servers'][$i]['table_coords'] table)
+ * @param boolean $showKeys Whether to display ONLY keys or not
+ *
* @return void
+ *
* @global object The current dia document
* @global array The relations settings
* @global string The current db name
+ *
* @see PMA_DIA
*/
function __construct($tableName, $pageNumber, $showKeys = false)
@@ -218,7 +225,10 @@ class Table_Stats
$sql = 'DESCRIBE ' . PMA_backquote($tableName);
$result = PMA_DBI_try_query($sql, null, PMA_DBI_QUERY_STORE);
if (!$result || !PMA_DBI_num_rows($result)) {
- $dia->dieSchema($pageNumber,"DIA",sprintf(__('The %s table doesn\'t exist!'), $tableName));
+ $dia->dieSchema(
+ $pageNumber, "DIA",
+ sprintf(__('The %s table doesn\'t exist!'), $tableName)
+ );
}
/*
* load fields
@@ -228,7 +238,10 @@ class Table_Stats
$indexes = PMA_Index::getFromTable($this->tableName, $db);
$all_columns = array();
foreach ($indexes as $index) {
- $all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));
+ $all_columns = array_merge(
+ $all_columns,
+ array_flip(array_keys($index->getColumns()))
+ );
}
$this->fields = array_keys($all_columns);
} else {
@@ -238,13 +251,21 @@ class Table_Stats
}
$sql = 'SELECT x, y FROM '
- . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['table_coords'])
. ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
. ' AND table_name = \'' . PMA_sqlAddSlashes($tableName) . '\''
. ' AND pdf_page_number = ' . $pageNumber;
$result = PMA_query_as_controluser($sql, false, PMA_DBI_QUERY_STORE);
- if (!$result || !PMA_DBI_num_rows($result)) {
- $dia->dieSchema($pageNumber,"DIA",sprintf(__('Please configure the coordinates for table %s'), $tableName));
+ if (! $result || ! PMA_DBI_num_rows($result)) {
+ $dia->dieSchema(
+ $pageNumber,
+ "DIA",
+ sprintf(
+ __('Please configure the coordinates for table %s'),
+ $tableName
+ )
+ );
}
list($this->x, $this->y) = PMA_DBI_fetch_row($result);
$this->x = (double) $this->x;
@@ -256,7 +277,11 @@ class Table_Stats
/*
* index
*/
- $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($tableName) . ';', null, PMA_DBI_QUERY_STORE);
+ $result = PMA_DBI_query(
+ 'SHOW INDEX FROM ' . PMA_backquote($tableName) . ';',
+ null,
+ PMA_DBI_QUERY_STORE
+ );
if (PMA_DBI_num_rows($result) > 0) {
while ($row = PMA_DBI_fetch_assoc($result)) {
if ($row['Key_name'] == 'PRIMARY') {
@@ -280,13 +305,15 @@ class Table_Stats
* is used to generate the XML of Dia Document. Database Table
* Object and their attributes are involved in the combination
* of displaing Database - Table on Dia Document.
-
- * @param boolean changeColor Whether to show color for tables text or not
- if changeColor is true then an array of $listOfColors
- will be used to choose the random colors for tables text
- we can change/add more colors to this array
- @return void
- * @global object The current Dia document
+ *
+ * @param boolean $changeColor Whether to show color for tables text or not
+ * if changeColor is true then an array of $listOfColors will be used to choose
+ * the random colors for tables text we can change/add more colors to this array
+ *
+ * @return void
+ *
+ * @global object The current Dia document
+ *
* @access public
* @see PMA_DIA
*/
@@ -301,7 +328,7 @@ class Table_Stats
'00FF00'
);
shuffle($listOfColors);
- $this->tableColor = '#'.$listOfColors[0].'';
+ $this->tableColor = '#' . $listOfColors[0] . '';
} else {
$this->tableColor = '#000000';
}
@@ -311,19 +338,22 @@ class Table_Stats
$dia->startElement('dia:object');
$dia->writeAttribute('type', 'Database - Table');
$dia->writeAttribute('version', '0');
- $dia->writeAttribute('id', ''.$this->tableId.'');
+ $dia->writeAttribute('id', '' . $this->tableId . '');
$dia->writeRaw(
'<dia:attribute name="obj_pos">
- <dia:point val="'.($this->x * $factor).','.($this->y * $factor).'"/>
+ <dia:point val="'
+ . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
</dia:attribute>
<dia:attribute name="obj_bb">
- <dia:rectangle val="'.($this->x * $factor).','.($this->y * $factor).';9.97,9.2"/>
+ <dia:rectangle val="'
+ .($this->x * $factor) . ',' . ($this->y * $factor) . ';9.97,9.2"/>
</dia:attribute>
<dia:attribute name="meta">
<dia:composite type="dict"/>
</dia:attribute>
<dia:attribute name="elem_corner">
- <dia:point val="'.($this->x * $factor).','.($this->y * $factor).'"/>
+ <dia:point val="'
+ . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
</dia:attribute>
<dia:attribute name="elem_width">
<dia:real val="5.9199999999999999"/>
@@ -332,7 +362,7 @@ class Table_Stats
<dia:real val="3.5"/>
</dia:attribute>
<dia:attribute name="text_colour">
- <dia:color val="'.$this->tableColor.'"/>
+ <dia:color val="' . $this->tableColor . '"/>
</dia:attribute>
<dia:attribute name="line_colour">
<dia:color val="#000000"/>
@@ -344,7 +374,7 @@ class Table_Stats
<dia:real val="0.10000000000000001"/>
</dia:attribute>
<dia:attribute name="name">
- <dia:string>#'.$this->tableName.'#</dia:string>
+ <dia:string>#' . $this->tableName . '#</dia:string>
</dia:attribute>
<dia:attribute name="comment">
<dia:string>##</dia:string>
@@ -379,44 +409,44 @@ class Table_Stats
<dia:attribute name="comment_font_height">
<dia:real val="0.69999999999999996"/>
</dia:attribute>'
- );
+ );
$dia->startElement('dia:attribute');
$dia->writeAttribute('name', 'attributes');
foreach ($this->fields as $field) {
- $dia->writeRaw(
- '<dia:composite type="table_attribute">
- <dia:attribute name="name">
- <dia:string>#'.$field.'#</dia:string>
- </dia:attribute>
- <dia:attribute name="type">
- <dia:string>##</dia:string>
- </dia:attribute>
- <dia:attribute name="comment">
+ $dia->writeRaw(
+ '<dia:composite type="table_attribute">
+ <dia:attribute name="name">
+ <dia:string>#' . $field . '#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="type">
<dia:string>##</dia:string>
- </dia:attribute>'
- );
- unset($pm);
- $pm = 'false';
- if (in_array($field, $this->primary)) {
- $pm = 'true';
- }
- if ($field == $this->displayfield) {
- $pm = 'false';
- }
- $dia->writeRaw(
- '<dia:attribute name="primary_key">
- <dia:boolean val="'.$pm.'"/>
- </dia:attribute>
- <dia:attribute name="nullable">
- <dia:boolean val="false"/>
- </dia:attribute>
- <dia:attribute name="unique">
- <dia:boolean val="'.$pm.'"/>
- </dia:attribute>
- </dia:composite>'
- );
+ </dia:attribute>
+ <dia:attribute name="comment">
+ <dia:string>##</dia:string>
+ </dia:attribute>'
+ );
+ unset($pm);
+ $pm = 'false';
+ if (in_array($field, $this->primary)) {
+ $pm = 'true';
+ }
+ if ($field == $this->displayfield) {
+ $pm = 'false';
+ }
+ $dia->writeRaw(
+ '<dia:attribute name="primary_key">
+ <dia:boolean val="' . $pm . '"/>
+ </dia:attribute>
+ <dia:attribute name="nullable">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="unique">
+ <dia:boolean val="' . $pm . '"/>
+ </dia:attribute>
+ </dia:composite>'
+ );
}
$dia->endElement();
$dia->endElement();
@@ -452,11 +482,13 @@ class Relation_Stats
/**
* The "Relation_Stats" constructor
*
- * @param string master_table The master table name
- * @param string master_field The relation field in the master table
- * @param string foreign_table The foreign table name
- * @param string foreigh_field The relation field in the foreign table
+ * @param string $master_table The master table name
+ * @param string $master_field The relation field in the master table
+ * @param string $foreign_table The foreign table name
+ * @param string $foreign_field The relation field in the foreign table
+ *
* @return void
+ *
* @see Relation_Stats::_getXy
*/
function __construct($master_table, $master_field, $foreign_table, $foreign_field)
@@ -480,9 +512,11 @@ class Relation_Stats
* then determines its left and right connection
* points.
*
- * @param string table The current table name
- * @param string column The relation column name
+ * @param string $table The current table name
+ * @param string $column The relation column name
+ *
* @return array Table right,left connection points and key position
+ *
* @access private
*/
private function _getXy($table, $column)
@@ -490,8 +524,7 @@ class Relation_Stats
$pos = array_search($column, $table->fields);
// left, right, position
$value = 12;
- if($pos != 0)
- {
+ if ($pos != 0) {
return array($pos + $value + $pos, $pos + $value + $pos + 1, $pos);
}
return array($pos + $value , $pos + $value + 1, $pos);
@@ -506,12 +539,14 @@ class Relation_Stats
* Database reference Object and their attributes are involved
* in the combination of displaing Database - reference on Dia Document.
*
- * @param boolean changeColor Whether to use one color per relation or not
- if changeColor is true then an array of $listOfColors
- will be used to choose the random colors for references
- lines. we can change/add more colors to this array
+ * @param boolean $changeColor Whether to use one color per relation or not
+ * if changeColor is true then an array of $listOfColors will be used to choose
+ * the random colors for references lines. we can change/add more colors to this
+ *
* @return void
- * @global object The current Dia document
+ *
+ * @global object The current Dia document
+ *
* @access public
* @see PMA_PDF
*/
@@ -525,8 +560,8 @@ class Relation_Stats
* points are same then return it false and don't draw that
* relation
*/
- if ( $this->srcConnPointsRight == $this->destConnPointsRight ){
- if ( $this->srcConnPointsLeft == $this->destConnPointsLeft ){
+ if ( $this->srcConnPointsRight == $this->destConnPointsRight) {
+ if ( $this->srcConnPointsLeft == $this->destConnPointsLeft) {
return false;
}
}
@@ -538,13 +573,14 @@ class Relation_Stats
'00FF00'
);
shuffle($listOfColors);
- $this->referenceColor = '#'.$listOfColors[0].'';
+ $this->referenceColor = '#' . $listOfColors[0] . '';
} else {
$this->referenceColor = '#000000';
}
$dia->writeRaw(
- '<dia:object type="Database - Reference" version="0" id="'.PMA_Dia_Relation_Schema::$objectId.'">
+ '<dia:object type="Database - Reference" version="0" id="'
+ . PMA_Dia_Relation_Schema::$objectId . '">
<dia:attribute name="obj_pos">
<dia:point val="3.27,18.9198"/>
</dia:attribute>
@@ -576,7 +612,7 @@ class Relation_Stats
<dia:color val="#000000"/>
</dia:attribute>
<dia:attribute name="line_colour">
- <dia:color val="'.$this->referenceColor.'"/>
+ <dia:color val="' . $this->referenceColor . '"/>
</dia:attribute>
<dia:attribute name="line_width">
<dia:real val="0.10000000000000001"/>
@@ -610,11 +646,15 @@ class Relation_Stats
<dia:real val="0.59999999999999998"/>
</dia:attribute>
<dia:connections>
- <dia:connection handle="0" to="'.$this->masterTableId.'" connection="'.$this->srcConnPointsRight.'"/>
- <dia:connection handle="1" to="'.$this->foreignTableId.'" connection="'.$this->destConnPointsRight.'"/>
+ <dia:connection handle="0" to="'
+ . $this->masterTableId . '" connection="'
+ . $this->srcConnPointsRight . '"/>
+ <dia:connection handle="1" to="'
+ . $this->foreignTableId . '" connection="'
+ . $this->destConnPointsRight . '"/>
</dia:connections>
</dia:object>'
- );
+ );
}
}
@@ -667,11 +707,16 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
$this->setExportType($_POST['export_type']);
$dia = new PMA_DIA();
- $dia->startDiaDoc($this->paper,$this->_topMargin,$this->_bottomMargin,$this->_leftMargin,$this->_rightMargin,$this->orientation);
- $alltables = $this->getAllTables($db,$this->pageNumber);
+ $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])) {
- $this->tables[$table] = new Table_Stats($table, $this->pageNumber, $this->showKeys);
+ $this->tables[$table] = new Table_Stats(
+ $table, $this->pageNumber, $this->showKeys
+ );
}
}
@@ -682,12 +727,15 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
$seen_a_relation = true;
foreach ($exist_rel as $master_field => $rel) {
/* put the foreign table on the schema only if selected
- * by the user
- * (do not use array_search() because we would have to
- * to do a === false and this is not PHP3 compatible)
- */
+ * by the user
+ * (do not use array_search() because we would have to
+ * to do a === false and this is not PHP3 compatible)
+ */
if (in_array($rel['foreign_table'], $alltables)) {
- $this->_addRelation($one_table, $master_field, $rel['foreign_table'], $rel['foreign_field'],$this->showKeys);
+ $this->_addRelation(
+ $one_table, $master_field, $rel['foreign_table'],
+ $rel['foreign_field'], $this->showKeys
+ );
}
}
}
@@ -698,30 +746,40 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
$this->_drawRelations($this->showColor);
}
$dia->endDiaDoc();
- $dia->showOutput($db.'-'.$this->pageNumber);
+ $dia->showOutput($db . '-' . $this->pageNumber);
exit();
}
/**
* Defines relation objects
*
- * @param string masterTable The master table name
- * @param string masterField The relation field in the master table
- * @param string foreignTable The foreign table name
- * @param string foreignField The relation field in the foreign table
+ * @param string $masterTable The master table name
+ * @param string $masterField The relation field in the master table
+ * @param string $foreignTable The foreign table name
+ * @param string $foreignField The relation field in the foreign table
+ * @param bool $showKeys Whether to display ONLY keys or not
+ *
* @return void
+ *
* @access private
* @see Table_Stats::__construct(),Relation_Stats::__construct()
*/
private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showKeys)
{
if (! isset($this->tables[$masterTable])) {
- $this->tables[$masterTable] = new Table_Stats($masterTable, $this->pageNumber, $showKeys);
+ $this->tables[$masterTable] = new Table_Stats(
+ $masterTable, $this->pageNumber, $showKeys
+ );
}
if (! isset($this->tables[$foreignTable])) {
- $this->tables[$foreignTable] = new Table_Stats($foreignTable, $this->pageNumber, $showKeys);
+ $this->tables[$foreignTable] = new Table_Stats(
+ $foreignTable, $this->pageNumber, $showKeys
+ );
}
- $this->_relations[] = new Relation_Stats($this->tables[$masterTable], $masterField, $this->tables[$foreignTable], $foreignField);
+ $this->_relations[] = new Relation_Stats(
+ $this->tables[$masterTable], $masterField,
+ $this->tables[$foreignTable], $foreignField
+ );
}
/**
@@ -731,8 +789,10 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
* foreign table's forein field using Dia object
* type Database - Reference
*
- * @param boolean changeColor Whether to use one color per relation or not
+ * @param boolean $changeColor Whether to use one color per relation or not
+ *
* @return void
+ *
* @access private
* @see Relation_Stats::relationDraw()
*/
@@ -749,8 +809,10 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
* Tables are generated using Dia object type Database - Table
* primary fields are underlined and bold in tables
*
- * @param boolean changeColor Whether to show color for tables text or not
+ * @param boolean $changeColor Whether to show color for tables text or not
+ *
* @return void
+ *
* @access private
* @see Table_Stats::tableDraw()
*/
diff --git a/libraries/schema/Eps_Relation_Schema.class.php b/libraries/schema/Eps_Relation_Schema.class.php
index 367b8c2..be70889 100644
--- a/libraries/schema/Eps_Relation_Schema.class.php
+++ b/libraries/schema/Eps_Relation_Schema.class.php
@@ -5,7 +5,7 @@
* @package phpMyAdmin
*/
-include_once("Export_Relation_Schema.class.php");
+include_once "Export_Relation_Schema.class.php";
/**
* This Class is EPS Library and
@@ -42,8 +42,10 @@ class PMA_EPS
/**
* Set document title
*
- * @param string value sets the title text
+ * @param string $value sets the title text
+ *
* @return void
+ *
* @access public
*/
function setTitle($value)
@@ -54,8 +56,10 @@ class PMA_EPS
/**
* Set document author
*
- * @param string value sets the author
+ * @param string $value sets the author
+ *
* @return void
+ *
* @access public
*/
function setAuthor($value)
@@ -66,8 +70,10 @@ class PMA_EPS
/**
* Set document creation date
*
- * @param string value sets the date
+ * @param string $value sets the date
+ *
* @return void
+ *
* @access public
*/
function setDate($value)
@@ -78,17 +84,19 @@ class PMA_EPS
/**
* Set document orientation
*
- * @param string value sets the author
+ * @param string $value sets the author
+ *
* @return void
+ *
* @access public
*/
function setOrientation($value)
{
$this->stringCommands .= "%%PageOrder: Ascend \n";
- if($value == "L"){
+ if ($value == "L") {
$value = "Landscape";
$this->stringCommands .= '%%Orientation: ' . $value . "\n";
- }else{
+ } else {
$value = "Portrait";
$this->stringCommands .= '%%Orientation: ' . $value . "\n";
}
@@ -102,17 +110,19 @@ class PMA_EPS
*
* font can be set whenever needed in EPS
*
- * @param string value sets the font name e.g Arial
- * @param integer value sets the size of the font e.g 10
+ * @param string $value sets the font name e.g Arial
+ * @param integer $value sets the size of the font e.g 10
+ *
* @return void
+ *
* @access public
*/
function setFont($value,$size)
{
$this->font = $value;
$this->fontSize = $size;
- $this->stringCommands .= "/".$value." findfont % Get the basic font\n";
- $this->stringCommands .= "".$size." scalefont % Scale the font to $size points\n";
+ $this->stringCommands .= "/" . $value . " findfont % Get the basic font\n";
+ $this->stringCommands .= "" . $size . " scalefont % Scale the font to $size points\n";
$this->stringCommands .= "setfont % Make it the current font\n";
}
@@ -144,19 +154,21 @@ class PMA_EPS
* drawing the lines from x,y source to x,y destination and set the
* width of the line. lines helps in showing relationships of tables
*
- * @param integer x_from The x_from attribute defines the start
- left position of the element
- * @param integer y_from The y_from attribute defines the start
- right position of the element
- * @param integer x_to The x_to attribute defines the end
- left position of the element
- * @param integer y_to The y_to attribute defines the end
- right position of the element
- * @param integer lineWidth sets the width of the line e.g 2
+ * @param integer $x_from The x_from attribute defines the start
+ * left position of the element
+ * @param integer $y_from The y_from attribute defines the start
+ * right position of the element
+ * @param integer $x_to The x_to attribute defines the end
+ * left position of the element
+ * @param integer $y_to The y_to attribute defines the end
+ * right position of the element
+ * @param integer $lineWidth Sets the width of the line e.g 2
+ *
* @return void
+ *
* @access public
*/
- function line($x_from=0, $y_from=0, $x_to=0, $y_to=0, $lineWidth=0)
+ function line($x_from = 0, $y_from = 0, $x_to = 0, $y_to = 0, $lineWidth = 0)
{
$this->stringCommands .= $lineWidth . " setlinewidth \n";
$this->stringCommands .= $x_from . ' ' . $y_from . " moveto \n";
@@ -170,28 +182,30 @@ class PMA_EPS
* drawing the rectangle from x,y source to x,y destination and set the
* width of the line. rectangles drawn around the text shown of fields
*
- * @param integer x_from The x_from attribute defines the start
- left position of the element
- * @param integer y_from The y_from attribute defines the start
- right position of the element
- * @param integer x_to The x_to attribute defines the end
- left position of the element
- * @param integer y_to The y_to attribute defines the end
- right position of the element
- * @param integer lineWidth sets the width of the line e.g 2
+ * @param integer $x_from The x_from attribute defines the start
+ left position of the element
+ * @param integer $y_from The y_from attribute defines the start
+ right position of the element
+ * @param integer $x_to The x_to attribute defines the end
+ left position of the element
+ * @param integer $y_to The y_to attribute defines the end
+ right position of the element
+ * @param integer $lineWidth Sets the width of the line e.g 2
+ *
* @return void
+ *
* @access public
*/
function rect($x_from, $y_from, $x_to, $y_to, $lineWidth)
{
- $this->stringCommands .= $lineWidth . " setlinewidth \n";
- $this->stringCommands .= "newpath \n";
- $this->stringCommands .= $x_from . " " . $y_from . " moveto \n";
- $this->stringCommands .= "0 " . $y_to . " rlineto \n";
- $this->stringCommands .= $x_to . " 0 rlineto \n";
- $this->stringCommands .= "0 -" . $y_to . " rlineto \n";
- $this->stringCommands .= "closepath \n";
- $this->stringCommands .= "stroke \n";
+ $this->stringCommands .= $lineWidth . " setlinewidth \n";
+ $this->stringCommands .= "newpath \n";
+ $this->stringCommands .= $x_from . " " . $y_from . " moveto \n";
+ $this->stringCommands .= "0 " . $y_to . " rlineto \n";
+ $this->stringCommands .= $x_to . " 0 rlineto \n";
+ $this->stringCommands .= "0 -" . $y_to . " rlineto \n";
+ $this->stringCommands .= "closepath \n";
+ $this->stringCommands .= "stroke \n";
}
/**
@@ -201,11 +215,11 @@ class PMA_EPS
* them as x and y coordinates to which to move. The coordinates
* specified become the current point.
*
- * @param integer x The x attribute defines the
- left position of the element
- * @param integer y The y attribute defines the
- right position of the element
+ * @param integer $x The x attribute defines the left position of the element
+ * @param integer $y The y attribute defines the right position of the element
+ *
* @return void
+ *
* @access public
*/
function moveTo($x, $y)
@@ -216,31 +230,33 @@ class PMA_EPS
/**
* Output/Display the text
*
- * @param string text The string to be displayed
+ * @param string $text The string to be displayed
+ *
* @return void
+ *
* @access public
*/
- function show($text)
- {
- $this->stringCommands .= '(' . $text . ") show \n";
- }
+ function show($text)
+ {
+ $this->stringCommands .= '(' . $text . ") show \n";
+ }
/**
* Output the text at specified co-ordinates
*
- * @param string text The string to be displayed
- * @param integer x The x attribute defines the
- left position of the element
- * @param integer y The y attribute defines the
- right position of the element
+ * @param string $text String to be displayed
+ * @param integer $x X attribute defines the left position of the element
+ * @param integer $y Y attribute defines the right position of the element
+ *
* @return void
+ *
* @access public
*/
- function showXY($text, $x, $y)
- {
- $this->moveTo($x, $y);
- $this->show($text);
- }
+ function showXY($text, $x, $y)
+ {
+ $this->moveTo($x, $y);
+ $this->show($text);
+ }
/**
* get width of string/text
@@ -252,10 +268,12 @@ class PMA_EPS
* This is a bit hardcore method. I didn't found any other better than this.
* if someone found better than this. would love to hear that method
*
- * @param string text string that width will be calculated
- * @param integer font name of the font like Arial,sans-serif etc
- * @param integer fontSize size of font
+ * @param string $text string that width will be calculated
+ * @param integer $font name of the font like Arial,sans-serif etc
+ * @param integer $fontSize size of font
+ *
* @return integer width of the text
+ *
* @access public
*/
function getStringWidth($text,$font,$fontSize)
@@ -264,22 +282,22 @@ class PMA_EPS
* Start by counting the width, giving each character a modifying value
*/
$count = 0;
- $count = $count + ((strlen($text) - strlen(str_replace(array("i","j","l"),"",$text)))*0.23);//ijl
- $count = $count + ((strlen($text) - strlen(str_replace(array("f"),"",$text)))*0.27);//f
- $count = $count + ((strlen($text) - strlen(str_replace(array("t","I"),"",$text)))*0.28);//tI
- $count = $count + ((strlen($text) - strlen(str_replace(array("r"),"",$text)))*0.34);//r
- $count = $count + ((strlen($text) - strlen(str_replace(array("1"),"",$text)))*0.49);//1
- $count = $count + ((strlen($text) - strlen(str_replace(array("c","k","s","v","x","y","z","J"),"",$text)))*0.5);//cksvxyzJ
- $count = $count + ((strlen($text) - strlen(str_replace(array("a","b","d","e","g","h","n","o","p","q","u","L","0","2","3","4","5","6","7","8","9"),"",$text)))*0.56);//abdeghnopquL023456789
- $count = $count + ((strlen($text) - strlen(str_replace(array("F","T","Z"),"",$text)))*0.61);//FTZ
- $count = $count + ((strlen($text) - strlen(str_replace(array("A","B","E","K","P","S","V","X","Y"),"",$text)))*0.67);//ABEKPSVXY
- $count = $count + ((strlen($text) - strlen(str_replace(array("w","C","D","H","N","R","U"),"",$text)))*0.73);//wCDHNRU
- $count = $count + ((strlen($text) - strlen(str_replace(array("G","O","Q"),"",$text)))*0.78);//GOQ
- $count = $count + ((strlen($text) - strlen(str_replace(array("m","M"),"",$text)))*0.84);//mM
- $count = $count + ((strlen($text) - strlen(str_replace("W","",$text)))*.95);//W
- $count = $count + ((strlen($text) - strlen(str_replace(" ","",$text)))*.28);//" "
- $text = str_replace(" ","",$text);//remove the " "'s
- $count = $count + (strlen(preg_replace("/[a-z0-9]/i","",$text))*0.3); //all other chrs
+ $count = $count + ((strlen($text) - strlen(str_replace(array("i", "j", "l"), "", $text))) * 0.23);//ijl
+ $count = $count + ((strlen($text) - strlen(str_replace(array("f"), "", $text))) * 0.27);//f
+ $count = $count + ((strlen($text) - strlen(str_replace(array("t", "I"), "", $text))) * 0.28);//tI
+ $count = $count + ((strlen($text) - strlen(str_replace(array("r"), "", $text))) * 0.34);//r
+ $count = $count + ((strlen($text) - strlen(str_replace(array("1"), "", $text))) * 0.49);//1
+ $count = $count + ((strlen($text) - strlen(str_replace(array("c", "k", "s", "v", "x", "y", "z", "J"), "", $text))) * 0.5);//cksvxyzJ
+ $count = $count + ((strlen($text) - strlen(str_replace(array("a", "b", "d", "e", "g", "h", "n", "o", "p", "q", "u", "L", "0", "2", "3", "4", "5", "6", "7", "8", "9"), "", $text))) * 0.56);//abdeghnopquL023456789
+ $count = $count + ((strlen($text) - strlen(str_replace(array("F", "T", "Z"), "", $text))) * 0.61);//FTZ
+ $count = $count + ((strlen($text) - strlen(str_replace(array("A", "B", "E", "K", "P", "S", "V", "X", "Y"), "", $text))) * 0.67);//ABEKPSVXY
+ $count = $count + ((strlen($text) - strlen(str_replace(array("w", "C", "D", "H", "N", "R", "U"), "", $text))) * 0.73);//wCDHNRU
+ $count = $count + ((strlen($text) - strlen(str_replace(array("G", "O", "Q"), "", $text))) * 0.78);//GOQ
+ $count = $count + ((strlen($text) - strlen(str_replace(array("m", "M"), "", $text))) * 0.84);//mM
+ $count = $count + ((strlen($text) - strlen(str_replace("W", "", $text))) * .95);//W
+ $count = $count + ((strlen($text) - strlen(str_replace(" ", "", $text))) * .28);//" "
+ $text = str_replace(" ", "", $text);//remove the " "'s
+ $count = $count + (strlen(preg_replace("/[a-z0-9]/i", "", $text)) * 0.3); //all other chrs
$modifier = 1;
$font = strtolower($font);
@@ -289,7 +307,7 @@ class PMA_EPS
*/
case 'arial':
case 'sans-serif':
- break;
+ break;
/*
* .92 modifer for time, serif, brushscriptstd, and californian fb
*/
@@ -298,13 +316,13 @@ class PMA_EPS
case 'brushscriptstd':
case 'californian fb':
$modifier = .92;
- break;
+ break;
/*
* 1.23 modifier for broadway
*/
case 'broadway':
$modifier = 1.23;
- break;
+ break;
}
$textWidth = $count*$fontSize;
return ceil($textWidth*$modifier);
@@ -324,8 +342,10 @@ class PMA_EPS
/**
* Output EPS Document for download
*
- * @param string fileName name of the eps document
+ * @param string $fileName name of the eps document
+ *
* @return void
+ *
* @access public
*/
function showOutput($fileName)
@@ -368,30 +388,37 @@ class Table_Stats
/**
* The "Table_Stats" constructor
*
- * @param string tableName The table name
- * @param string font The font name
- * @param integer fontSize The font size
- * @param integer same_wide_width The max width among tables
- * @param boolean showKeys Whether to display keys or not
- * @param boolean showInfo Whether to display table position or not
+ * @param string $tableName The table name
+ * @param string $font The font name
+ * @param integer $fontSize The font size
+ * @param integer $pageNumber Page number
+ * @param integer &$same_wide_width The max width among tables
+ * @param boolean $showKeys Whether to display keys or not
+ * @param boolean $showInfo Whether to display table position or not
+ *
* @global object The current eps document
* @global integer The current page number (from the
* $cfg['Servers'][$i]['table_coords'] table)
* @global array The relations settings
* @global string The current db name
+ *
* @access private
* @see PMA_EPS, Table_Stats::Table_Stats_setWidth,
- Table_Stats::Table_Stats_setHeight
+ * Table_Stats::Table_Stats_setHeight
*/
- function __construct($tableName, $font, $fontSize, $pageNumber, &$same_wide_width, $showKeys = false, $showInfo = false)
+ function __construct($tableName, $font, $fontSize, $pageNumber, &$same_wide_width,
+ $showKeys = false, $showInfo = false)
{
global $eps, $cfgRelation, $db;
$this->_tableName = $tableName;
$sql = 'DESCRIBE ' . PMA_backquote($tableName);
$result = PMA_DBI_try_query($sql, null, PMA_DBI_QUERY_STORE);
- if (!$result || !PMA_DBI_num_rows($result)) {
- $eps->dieSchema($pageNumber,"EPS",sprintf(__('The %s table doesn\'t exist!'), $tableName));
+ if (! $result || ! PMA_DBI_num_rows($result)) {
+ $eps->dieSchema(
+ $pageNumber, "EPS",
+ sprintf(__('The %s table doesn\'t exist!'), $tableName)
+ );
}
/*
@@ -402,7 +429,10 @@ class Table_Stats
$indexes = PMA_Index::getFromTable($this->_tableName, $db);
$all_columns = array();
foreach ($indexes as $index) {
- $all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));
+ $all_columns = array_merge(
+ $all_columns,
+ array_flip(array_keys($index->getColumns()))
+ );
}
$this->fields = array_keys($all_columns);
} else {
@@ -418,21 +448,28 @@ class Table_Stats
// setWidth must me after setHeight, because title
// can include table height which changes table width
- $this->_setWidthTable($font,$fontSize);
+ $this->_setWidthTable($font, $fontSize);
if ($same_wide_width < $this->width) {
$same_wide_width = $this->width;
}
// x and y
$sql = 'SELECT x, y FROM '
- . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
- . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
- . ' AND table_name = \'' . PMA_sqlAddSlashes($tableName) . '\''
- . ' AND pdf_page_number = ' . $pageNumber;
+ . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_backquote($cfgRelation['table_coords'])
+ . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
+ . ' AND table_name = \'' . PMA_sqlAddSlashes($tableName) . '\''
+ . ' AND pdf_page_number = ' . $pageNumber;
$result = PMA_query_as_controluser($sql, false, PMA_DBI_QUERY_STORE);
- if (!$result || !PMA_DBI_num_rows($result)) {
- $eps->dieSchema($pageNumber,"EPS",sprintf(__('Please configure the coordinates for table %s'), $tableName));
+ if (! $result || ! PMA_DBI_num_rows($result)) {
+ $eps->dieSchema(
+ $pageNumber, "EPS",
+ sprintf(
+ __('Please configure the coordinates for table %s'),
+ $tableName
+ )
+ );
}
list($this->x, $this->y) = PMA_DBI_fetch_row($result);
$this->x = (double) $this->x;
@@ -440,7 +477,10 @@ class Table_Stats
// displayfield
$this->displayfield = PMA_getDisplayField($db, $tableName);
// index
- $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($tableName) . ';', null, PMA_DBI_QUERY_STORE);
+ $result = PMA_DBI_query(
+ 'SHOW INDEX FROM ' . PMA_backquote($tableName) . ';',
+ null, PMA_DBI_QUERY_STORE
+ );
if (PMA_DBI_num_rows($result) > 0) {
while ($row = PMA_DBI_fetch_assoc($result)) {
if ($row['Key_name'] == 'PRIMARY') {
@@ -459,16 +499,21 @@ class Table_Stats
*/
private function _getTitle()
{
- return ($this->_showInfo ? sprintf('%.0f', $this->width) . 'x' . sprintf('%.0f', $this->heightCell) : '') . ' ' . $this->_tableName;
+ return ($this->_showInfo
+ ? sprintf('%.0f', $this->width) . 'x' . sprintf('%.0f', $this->heightCell)
+ : '') . ' ' . $this->_tableName;
}
/**
* Sets the width of the table
*
- * @param string font The font name
- * @param integer fontSize The font size
+ * @param string $font The font name
+ * @param integer $fontSize The font size
+ *
* @global object The current eps document
+ *
* @return void
+ *
* @access private
* @see PMA_EPS
*/
@@ -477,14 +522,17 @@ class Table_Stats
global $eps;
foreach ($this->fields as $field) {
- $this->width = max($this->width, $eps->getStringWidth($field,$font,$fontSize));
+ $this->width = max(
+ $this->width,
+ $eps->getStringWidth($field, $font, $fontSize)
+ );
}
- $this->width += $eps->getStringWidth(' ',$font,$fontSize);
+ $this->width += $eps->getStringWidth(' ', $font, $fontSize);
/*
* it is unknown what value must be added, because
* table title is affected by the tabe width value
*/
- while ($this->width < $eps->getStringWidth($this->_getTitle(),$font,$fontSize)) {
+ while ($this->width < $eps->getStringWidth($this->_getTitle(), $font, $fontSize)) {
$this->width += 7;
}
}
@@ -492,7 +540,8 @@ class Table_Stats
/**
* Sets the height of the table
*
- * @param integer fontSize The font size
+ * @param integer $fontSize The font size
+ *
* @return void
* @access private
*/
@@ -505,9 +554,12 @@ class Table_Stats
/**
* Draw the table
*
- * @param boolean showColor Whether to display color
+ * @param boolean $showColor Whether to display color
+ *
* @global object The current eps document
+ *
* @return void
+ *
* @access public
* @see PMA_EPS,PMA_EPS::line,PMA_EPS::rect
*/
@@ -515,25 +567,24 @@ class Table_Stats
{
global $eps;
//echo $this->_tableName.'<br />';
- $eps->rect($this->x,$this->y + 12,
- $this->width,$this->heightCell,
- 1
- );
- $eps->showXY($this->_getTitle(),$this->x + 5,$this->y + 14);
+ $eps->rect($this->x, $this->y + 12, $this->width, $this->heightCell, 1);
+ $eps->showXY($this->_getTitle(), $this->x + 5, $this->y + 14);
foreach ($this->fields as $field) {
- $this->currentCell += $this->heightCell;
- $showColor = 'none';
- if ($showColor) {
- if (in_array($field, $this->primary)) {
- $showColor = '#0c0';
- }
- if ($field == $this->displayfield) {
- $showColor = 'none';
- }
+ $this->currentCell += $this->heightCell;
+ $showColor = 'none';
+ if ($showColor) {
+ if (in_array($field, $this->primary)) {
+ $showColor = '#0c0';
+ }
+ if ($field == $this->displayfield) {
+ $showColor = 'none';
}
- $eps->rect($this->x,$this->y + 12 + $this->currentCell,
- $this->width, $this->heightCell,1);
- $eps->showXY($field, $this->x + 5, $this->y + 14 + $this->currentCell);
+ }
+ $eps->rect(
+ $this->x, $this->y + 12 + $this->currentCell,
+ $this->width, $this->heightCell, 1
+ );
+ $eps->showXY($field, $this->x + 5, $this->y + 14 + $this->currentCell);
}
}
}
@@ -563,10 +614,11 @@ class Relation_Stats
/**
* The "Relation_Stats" constructor
*
- * @param string master_table The master table name
- * @param string master_field The relation field in the master table
- * @param string foreign_table The foreign table name
- * @param string foreigh_field The relation field in the foreign table
+ * @param string $master_table The master table name
+ * @param string $master_field The relation field in the master table
+ * @param string $foreign_table The foreign table name
+ * @param string $foreign_field The relation field in the foreign table
+ *
* @see Relation_Stats::_getXy
*/
function __construct($master_table, $master_field, $foreign_table, $foreign_field)
@@ -617,26 +669,36 @@ class Relation_Stats
/**
* Gets arrows coordinates
*
- * @param string table The current table name
- * @param string column The relation column name
+ * @param string $table The current table name
+ * @param string $column The relation column name
+ *
* @return array Arrows coordinates
+ *
* @access private
*/
private function _getXy($table, $column)
{
$pos = array_search($column, $table->fields);
// x_left, x_right, y
- return array($table->x, $table->x + $table->width, $table->y + ($pos + 1.5) * $table->heightCell);
+ return array(
+ $table->x,
+ $table->x + $table->width,
+ $table->y + ($pos + 1.5) * $table->heightCell
+ );
}
/**
* draws relation links and arrows
* shows foreign key relations
*
- * @param boolean changeColor Whether to use one color per relation or not
- * @global object The current EPS document
+ * @param boolean $changeColor Whether to use one color per relation or not
+ *
+ * @global object The current EPS document
+ *
* @access public
* @see PMA_EPS
+ *
+ * @return void
*/
public function relationDraw($changeColor)
{
@@ -658,40 +720,58 @@ class Relation_Stats
$color = 'black';
}
// draw a line like -- to foreign field
- $eps->line($this->xSrc,$this->ySrc,
- $this->xSrc + $this->srcDir * $this->wTick,$this->ySrc,
+ $eps->line(
+ $this->xSrc,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * $this->wTick,
+ $this->ySrc,
1
- );
+ );
// draw a line like -- to master field
- $eps->line($this->xDest + $this->destDir * $this->wTick, $this->yDest,
- $this->xDest, $this->yDest,
+ $eps->line(
+ $this->xDest + $this->destDir * $this->wTick,
+ $this->yDest,
+ $this->xDest,
+ $this->yDest,
1
- );
+ );
// draw a line that connects to master field line and foreign field line
- $eps->line($this->xSrc + $this->srcDir * $this->wTick,$this->ySrc,
- $this->xDest + $this->destDir * $this->wTick, $this->yDest,
+ $eps->line(
+ $this->xSrc + $this->srcDir * $this->wTick,
+ $this->ySrc,
+ $this->xDest + $this->destDir * $this->wTick,
+ $this->yDest,
1
- );
+ );
$root2 = 2 * sqrt(2);
- $eps->line($this->xSrc + $this->srcDir * $this->wTick * 0.75, $this->ySrc,
- $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick ,
- $this->ySrc + $this->wTick / $root2 ,
+ $eps->line(
+ $this->xSrc + $this->srcDir * $this->wTick * 0.75,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick,
+ $this->ySrc + $this->wTick / $root2,
1
- );
- $eps->line($this->xSrc + $this->srcDir * $this->wTick * 0.75, $this->ySrc,
- $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick ,
- $this->ySrc - $this->wTick / $root2 ,
+ );
+ $eps->line(
+ $this->xSrc + $this->srcDir * $this->wTick * 0.75,
+ $this->ySrc,
+ $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick,
+ $this->ySrc - $this->wTick / $root2,
1
- );
- $eps->line($this->xDest + $this->destDir * $this->wTick / 2 , $this->yDest ,
+ );
+ $eps->line(
+ $this->xDest + $this->destDir * $this->wTick / 2,
+ $this->yDest,
$this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick,
- $this->yDest + $this->wTick / $root2 ,
- 1);
- $eps->line($this->xDest + $this->destDir * $this->wTick / 2 ,
- $this->yDest , $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick ,
- $this->yDest - $this->wTick / $root2 ,
+ $this->yDest + $this->wTick / $root2,
1
- );
+ );
+ $eps->line(
+ $this->xDest + $this->destDir * $this->wTick / 2,
+ $this->yDest,
+ $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick,
+ $this->yDest - $this->wTick / $root2,
+ 1
+ );
}
}
/*
@@ -738,19 +818,26 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
$this->setExportType($_POST['export_type']);
$eps = new PMA_EPS();
- $eps->setTitle(sprintf(__('Schema of the %s database - Page %s'), $db, $this->pageNumber));
+ $eps->setTitle(
+ sprintf(
+ __('Schema of the %s database - Page %s'),
+ $db,
+ $this->pageNumber
+ )
+ );
$eps->setAuthor('phpMyAdmin ' . PMA_VERSION);
$eps->setDate(date("j F Y, g:i a"));
$eps->setOrientation($this->orientation);
- $eps->setFont('Verdana','10');
-
+ $eps->setFont('Verdana', '10');
-
- $alltables = $this->getAllTables($db,$this->pageNumber);
+ $alltables = $this->getAllTables($db, $this->pageNumber);
foreach ($alltables AS $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);
+ $this->tables[$table] = new Table_Stats(
+ $table, $eps->getFont(), $eps->getFontSize(), $this->pageNumber,
+ $this->_tablewidth, $this->showKeys, $this->tableDimension
+ );
}
if ($this->sameWide) {
@@ -770,7 +857,11 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
* to do a === false and this is not PHP3 compatible)
*/
if (in_array($rel['foreign_table'], $alltables)) {
- $this->_addRelation($one_table,$eps->getFont(),$eps->getFontSize(), $master_field, $rel['foreign_table'], $rel['foreign_field'], $this->tableDimension);
+ $this->_addRelation(
+ $one_table, $eps->getFont(), $eps->getFontSize(),
+ $master_field, $rel['foreign_table'],
+ $rel['foreign_field'], $this->tableDimension
+ );
}
}
}
@@ -788,33 +879,48 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Defines relation objects
*
- * @param string masterTable The master table name
- * @param string masterField The relation field in the master table
- * @param string foreignTable The foreign table name
- * @param string foreignField The relation field in the foreign table
- * @param boolean showInfo Whether to display table position or not
+ * @param string $masterTable The master table name
+ * @param string $font The font
+ * @param int $fontSize The font size
+ * @param string $masterField The relation field in the master table
+ * @param string $foreignTable The foreign table name
+ * @param string $foreignField The relation field in the foreign table
+ * @param boolean $showInfo Whether to display table position or not
+ *
* @return void
+ *
* @access private
* @see _setMinMax,Table_Stats::__construct(),Relation_Stats::__construct()
*/
- private function _addRelation($masterTable,$font,$fontSize, $masterField, $foreignTable, $foreignField, $showInfo)
+ private function _addRelation($masterTable, $font, $fontSize, $masterField,
+ $foreignTable, $foreignField, $showInfo)
{
if (! isset($this->tables[$masterTable])) {
- $this->tables[$masterTable] = new Table_Stats($masterTable, $font, $fontSize, $this->pageNumber, $this->_tablewidth, false, $showInfo);
+ $this->tables[$masterTable] = new Table_Stats(
+ $masterTable, $font, $fontSize, $this->pageNumber,
+ $this->_tablewidth, false, $showInfo
+ );
}
if (! isset($this->tables[$foreignTable])) {
- $this->tables[$foreignTable] = new Table_Stats($foreignTable,$font,$fontSize,$this->pageNumber, $this->_tablewidth, false, $showInfo);
+ $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);
+ $this->_relations[] = new Relation_Stats(
+ $this->tables[$masterTable], $masterField,
+ $this->tables[$foreignTable], $foreignField
+ );
}
/**
- * Draws relation arrows and lines
- * connects master table's master field to
+ * Draws relation arrows and lines connects master table's master field to
* foreign table's forein field
*
- * @param boolean changeColor Whether to use one color per relation or not
+ * @param boolean $changeColor Whether to use one color per relation or not
+ *
* @return void
+ *
* @access private
* @see Relation_Stats::relationDraw()
*/
@@ -828,8 +934,10 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
/**
* Draws tables
*
- * @param boolean changeColor Whether to show color for primary fields or not
+ * @param boolean $changeColor Whether to show color for primary fields or not
+ *
* @return void
+ *
* @access private
* @see Table_Stats::Table_Stats_tableDraw()
*/
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16220-ge3a3e26
by Madhura Jayaratne 20 Aug '11
by Madhura Jayaratne 20 Aug '11
20 Aug '11
The branch, master has been updated
via e3a3e26146c5856f1593656aefe73de7a6da683d (commit)
via 4db9c176b3be2325a7b824de8c2409fc4390640d (commit)
from 9b2570b0cfa73860fd150d741535991308b5b199 (commit)
- Log -----------------------------------------------------------------
commit e3a3e26146c5856f1593656aefe73de7a6da683d
Merge: 4db9c17 9b2570b
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Aug 20 07:22:16 2011 +0530
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 4db9c176b3be2325a7b824de8c2409fc4390640d
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Aug 20 07:19:17 2011 +0530
bug #3385954 - unknown table status:Create_time on dispalying view (again)
-----------------------------------------------------------------------
Summary of changes:
libraries/display_tbl.lib.php | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index ddcfb7a..e7488ff 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -578,8 +578,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
echo '<input id="col_visib" type="hidden" value="' . implode(',', $col_visib) . '" />';
}
// generate table create time
- echo '<input id="table_create_time" type="hidden" value="' .
- PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'Create_time') . '" />';
+ if (! PMA_Table::isView($GLOBALS['table'], $GLOBALS['db'])) {
+ echo '<input id="table_create_time" type="hidden" value="' .
+ PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'Create_time') . '" />';
+ }
}
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin website branch, master, updated. a2dcd2803c51cf685016b95ce373ada53c2c0a99
by Dieter Adriaenssens 19 Aug '11
by Dieter Adriaenssens 19 Aug '11
19 Aug '11
The branch, master has been updated
via a2dcd2803c51cf685016b95ce373ada53c2c0a99 (commit)
from 953e782275d775d1995707294cb0e7e4e41765fe (commit)
- Log -----------------------------------------------------------------
commit a2dcd2803c51cf685016b95ce373ada53c2c0a99
Author: Dieter Adriaenssens <ruleant(a)users.sourceforge.net>
Date: Sat Aug 20 01:42:18 2011 +0200
remove mention of Excel export from features
-----------------------------------------------------------------------
Summary of changes:
templates/index.tpl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/templates/index.tpl b/templates/index.tpl
index c175908..8d9652c 100644
--- a/templates/index.tpl
+++ b/templates/index.tpl
@@ -102,7 +102,7 @@ href="${base_url}about.${file_ext}">separate page</a>.
title="International Electrotechnical Commission">IEC</abbr> 26300 -
OpenDocument Text and Spreadsheet,
<abbr title="Microsoft Word 2000">Word</abbr>,
- <abbr title="Microsoft Excel 2000">Excel</abbr>, L<sup>A</sup>T<sub><big>E</big></sub>X
+ L<sup>A</sup>T<sub><big>E</big></sub>X
and others
</li>
<li>Administering multiple servers</li>
hooks/post-receive
--
phpMyAdmin website
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16218-g9b2570b
by Piotr Przybylski 19 Aug '11
by Piotr Przybylski 19 Aug '11
19 Aug '11
The branch, master has been updated
via 9b2570b0cfa73860fd150d741535991308b5b199 (commit)
via 9be1bad63ca9eb61ed8dcc249b45079f018f73ad (commit)
from 80daf344942c5b60b0c244771b7c18c309edf06d (commit)
- Log -----------------------------------------------------------------
commit 9b2570b0cfa73860fd150d741535991308b5b199
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Sat Aug 20 00:59:11 2011 +0200
Advisor: mark that 'Rate of reading fixed position' may be wrong, requires further investigation
commit 9be1bad63ca9eb61ed8dcc249b45079f018f73ad
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Sat Aug 20 00:56:06 2011 +0200
Advisor: link to MySQL 5.5 documentation, it's better and more complete
-----------------------------------------------------------------------
Summary of changes:
libraries/advisory_rules.txt | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/libraries/advisory_rules.txt b/libraries/advisory_rules.txt
index 97f4454..c3445e0 100644
--- a/libraries/advisory_rules.txt
+++ b/libraries/advisory_rules.txt
@@ -131,7 +131,7 @@ rule 'Query cache usage' [!fired('Query cache disabled')]
Questions / Uptime
value > 100
Suboptimal caching method.
- You are using the MySQL Query cache with a fairly high traffic database. It might be worth considering to use <a href="http://dev.mysql.com/doc/refman/5.1/en/ha-memcached.html">memcached</a> instead of the MySQL Query cache, especially if you have multiple slaves.
+ You are using the MySQL Query cache with a fairly high traffic database. It might be worth considering to use <a href="http://dev.mysql.com/doc/refman/5.5/en/ha-memcached.html">memcached</a> instead of the MySQL Query cache, especially if you have multiple slaves.
The query cache is enabled and the server receives %d queries per second. This rule fires if there is more than 100 queries per second. | round(value,1)
rule 'Query cache efficiency (%)' [Com_select + Qcache_hits > 0 && !fired('Query cache disabled')]
@@ -214,6 +214,7 @@ rule 'Rate of reading first index entry'
This usually indicates frequent full index scans. Full index scans are faster than table scans but require lots of CPU cycles in big tables, if those tables that have or had high volumes of UPDATEs and DELETEs, running 'OPTIMIZE TABLE' might reduce the amount of and/or speed up full index scans. Other than that full index scans can only be reduced by rewriting queries.
Index scans average: %s, this value should be less than 1 per hour | PMA_bytime(value,2)
+# This rule may be applicable to MyISAM-only workloads, but completely wrong for InnoDB - http://www.mysqlperformanceblog.com/2010/06/15/what-does-handler_read_rnd-m…
rule 'Rate of reading fixed position'
Handler_read_rnd / Uptime
value * 60 * 60 > 1
@@ -247,19 +248,19 @@ rule 'Temp disk rate'
Created_tmp_disk_tables / Uptime
value * 60 * 60 > 1
Many temporary tables are being written to disk instead of being kept in memory.
- Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temprorary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in in the <a href="http://dev.mysql.com/doc/refman/5.0/en/internal-temporary-tables.html">MySQL Documentation</a>
+ Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temprorary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in in the <a href="http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html">MySQL Documentation</a>
Rate of temporay tables being written to disk: %s, this value should be less than 1 per hour | PMA_bytime(value,2)
# I couldn't find any source on the internet that suggests a direct relation between high counts of temporary tables and any of these variables.
# Several independent Blog entries suggest (http://ronaldbradford.com/blog/more-on-understanding-sort_buffer_size-2010-… and http://www.xaprb.com/blog/2010/05/09/how-to-tune-mysqls-sort_buffer_size/)
# that sort_buffer_size should be left as it is. And increasing read_buffer_size is only suggested when there are a lot of
-# table scans (http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_… and other sources) though
+# table scans (http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_… and other sources) though
# setting it too high is bad too (http://www.mysqlperformanceblog.com/2007/09/17/mysql-what-read_buffer_size-…)
#rule 'Temp table rate'
# Created_tmp_tables / Uptime
# value * 60 * 60 > 1
# Many intermediate temporary tables are being created.
-# This may be caused by queries under certain conditions as mentioned in the <a href="http://dev.mysql.com/doc/refman/5.0/en/internal-temporary-tables.html">MySQL Documentation</a>. Consider increasing {sort_buffer_size} (sorting), {read_rnd_buffer_size} (random read buffer, ie, post-sort), {read_buffer_size} (sequential scan).
+# This may be caused by queries under certain conditions as mentioned in the <a href="http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html">MySQL Documentation</a>. Consider increasing {sort_buffer_size} (sorting), {read_rnd_buffer_size} (random read buffer, ie, post-sort), {read_buffer_size} (sequential scan).
#
# MyISAM index cache
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16216-g80daf34
by Piotr Przybylski 19 Aug '11
by Piotr Przybylski 19 Aug '11
19 Aug '11
The branch, master has been updated
via 80daf344942c5b60b0c244771b7c18c309edf06d (commit)
from c39e7bb14f371736977c250baef03d418166cb1e (commit)
- Log -----------------------------------------------------------------
commit 80daf344942c5b60b0c244771b7c18c309edf06d
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Sat Aug 20 00:43:51 2011 +0200
Advisor: properly handle concurrent_insert on MySQL 5.5.3
-----------------------------------------------------------------------
Summary of changes:
libraries/advisory_rules.txt | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libraries/advisory_rules.txt b/libraries/advisory_rules.txt
index b2aa21d..97f4454 100644
--- a/libraries/advisory_rules.txt
+++ b/libraries/advisory_rules.txt
@@ -74,9 +74,9 @@ rule 'Slow query logging'
#
# versions
-rule 'Release Series'
+rule 'Release Series' [!PMA_DRIZZLE]
version
- !PMA_DRIZZLE && substr(value,0,1) <= 5 && substr(value,2,1) < 1
+ substr(value,0,1) <= 5 && substr(value,2,1) < 1
The MySQL server version less then 5.1.
You should upgrade, as MySQL 5.1 has improved performance, and MySQL 5.5 even more so.
Current version: %s | value
@@ -428,9 +428,9 @@ rule 'InnoDB buffer pool size' [system_memory > 0]
# other
rule 'MyISAM concurrent inserts'
concurrent_insert
- value == 0
+ value === 0 || value === 'NEVER'
Enable concurrent_insert by setting it to 1
- Setting {concurrent_insert} to 1 reduces contention between readers and writers for a given table. See also <a href="http://dev.mysql.com/doc/refman/5.0/en/concurrent-inserts.html">MySQL Documentation</a>
+ Setting {concurrent_insert} to 1 reduces contention between readers and writers for a given table. See also <a href="http://dev.mysql.com/doc/refman/5.5/en/concurrent-inserts.html">MySQL Documentation</a>
concurrent_insert is set to 0
# INSERT DELAYED USAGE
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-16215-gc39e7bb
by Marc Delisle 19 Aug '11
by Marc Delisle 19 Aug '11
19 Aug '11
The branch, master has been updated
via c39e7bb14f371736977c250baef03d418166cb1e (commit)
via 7e814a711aa5d2ca0a50b9da62bbd7ea004fed29 (commit)
via 29b694c2256c90b3d8413b071e11bf992d6afddb (commit)
from b527bd916c67849acc89c8cfd500461d9155d9b3 (commit)
- Log -----------------------------------------------------------------
commit c39e7bb14f371736977c250baef03d418166cb1e
Merge: 7e814a7 b527bd9
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Aug 19 16:23:14 2011 -0400
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 7e814a711aa5d2ca0a50b9da62bbd7ea004fed29
Merge: 8b607b4 29b694c
Author: Marc Delisle <marc(a)infomarc.info>
Date: Fri Aug 19 16:17:25 2011 -0400
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/tbl_replace_fields.inc.php | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f70eae5..85e45ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,7 @@ phpMyAdmin - ChangeLog
- [core] Remove library PHPExcel, due to license issues
- [export] Remove native Excel export modules (xls and xlsx formats)
- [import] Remove native Excel import modules (xls and xlsx formats)
+- bug #3392920 [edit] BLOB emptied after editing another column
3.4.4.0 (not yet released)
- bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
diff --git a/libraries/tbl_replace_fields.inc.php b/libraries/tbl_replace_fields.inc.php
index f1a0b9e..b408e6c 100644
--- a/libraries/tbl_replace_fields.inc.php
+++ b/libraries/tbl_replace_fields.inc.php
@@ -101,7 +101,7 @@ if (false !== $possibly_uploaded_val) {
}
// The Null checkbox was unchecked for this field
- if (empty($val) && isset($me_fields_null_prev[$key]) && ! isset($me_fields_null[$key])) {
+ if (empty($val) && ! empty($me_fields_null_prev[$key]) && ! isset($me_fields_null[$key])) {
$val = "''";
}
} // end else (field value in the form)
hooks/post-receive
--
phpMyAdmin
1
0