' . __('phpMyAdmin Demo Server') . '
'; + echo ''; + printf( + __( + 'You are using the demo server. You can do anything here, but ' + . 'please do not change root, debian-sys-maint and pma users. ' + . 'More information is available at %s.' + ), + 'demo.phpmyadmin.net' + ); + echo '
'; + echo '' . __('General Settings') . '
'; echo '- ';
diff --git a/js/ajax.js b/js/ajax.js
index 5b99c3f198..f9b4f5993a 100644
--- a/js/ajax.js
+++ b/js/ajax.js
@@ -59,10 +59,12 @@ var AJAX = {
registerOnload: function (file, func) {
var eventName = 'onload_' + AJAX.hash(file);
$(document).bind(eventName, func);
- this._debug && console.log(
- // no need to translate
- "Registered event " + eventName + " for file " + file
- );
+ if (this._debug) {
+ console.log(
+ // no need to translate
+ "Registered event " + eventName + " for file " + file
+ );
+ }
return this;
},
/**
@@ -78,10 +80,12 @@ var AJAX = {
registerTeardown: function (file, func) {
var eventName = 'teardown_' + AJAX.hash(file);
$(document).bind(eventName, func);
- this._debug && console.log(
- // no need to translate
- "Registered event " + eventName + " for file " + file
- );
+ if (this._debug) {
+ console.log(
+ // no need to translate
+ "Registered event " + eventName + " for file " + file
+ );
+ }
return this;
},
/**
@@ -95,10 +99,12 @@ var AJAX = {
fireOnload: function (file) {
var eventName = 'onload_' + AJAX.hash(file);
$(document).trigger(eventName);
- this._debug && console.log(
- // no need to translate
- "Fired event " + eventName + " for file " + file
- );
+ if (this._debug) {
+ console.log(
+ // no need to translate
+ "Fired event " + eventName + " for file " + file
+ );
+ }
},
/**
* Called just before a page is torn down, once for every
@@ -111,10 +117,12 @@ var AJAX = {
fireTeardown: function (file) {
var eventName = 'teardown_' + AJAX.hash(file);
$(document).triggerHandler(eventName);
- this._debug && console.log(
- // no need to translate
- "Fired event " + eventName + " for file " + file
- );
+ if (this._debug) {
+ console.log(
+ // no need to translate
+ "Fired event " + eventName + " for file " + file
+ );
+ }
},
/**
* Event handler for clicks on links and form submissions
@@ -169,7 +177,9 @@ var AJAX = {
// Add a list of menu hashes that we have in the cache to the request
params += AJAX.cache.menus.getRequestParam();
- AJAX._debug && console.log("Loading: " + url); // no need to translate
+ if (AJAX._debug) {
+ console.log("Loading: " + url); // no need to translate
+ }
if (isLink) {
AJAX.active = true;
diff --git a/js/cross_framing_protection.js b/js/cross_framing_protection.js
index 1e1caf0fd4..5952ab7130 100644
--- a/js/cross_framing_protection.js
+++ b/js/cross_framing_protection.js
@@ -2,8 +2,8 @@
/**
* Conditionally included if framing is not allowed
*/
-if(self == top) {
- document.documentElement.style.display = 'block' ;
+if (self == top) {
+ document.documentElement.style.display = 'block';
} else {
- top.location = self.location ;
+ top.location = self.location;
}
diff --git a/js/export.js b/js/export.js
index 35f554c196..f9fe774c78 100644
--- a/js/export.js
+++ b/js/export.js
@@ -4,6 +4,28 @@
*
*/
+/**
+ * Disables the "Dump some row(s)" sub-options
+ */
+function disable_dump_some_rows_sub_options()
+{
+ $("label[for='limit_to']").fadeTo('fast', 0.4);
+ $("label[for='limit_from']").fadeTo('fast', 0.4);
+ $("input[type='text'][name='limit_to']").prop('disabled', 'disabled');
+ $("input[type='text'][name='limit_from']").prop('disabled', 'disabled');
+}
+
+/**
+ * Enables the "Dump some row(s)" sub-options
+ */
+function enable_dump_some_rows_sub_options()
+{
+ $("label[for='limit_to']").fadeTo('fast', 1);
+ $("label[for='limit_from']").fadeTo('fast', 1);
+ $("input[type='text'][name='limit_to']").prop('disabled', '');
+ $("input[type='text'][name='limit_from']").prop('disabled', '');
+}
+
/**
* Unbind all event handlers before tearing down a page
*/
@@ -221,7 +243,7 @@ AJAX.registerOnload('export.js', function () {
* Initially disables the "Dump some row(s)" sub-options
*/
disable_dump_some_rows_sub_options();
-
+
/**
* Disables the "Dump some row(s)" sub-options when it is not selected
*/
@@ -233,25 +255,3 @@ AJAX.registerOnload('export.js', function () {
}
});
});
-
-/**
- * Disables the "Dump some row(s)" sub-options
- */
-function disable_dump_some_rows_sub_options()
-{
- $("label[for='limit_to']").fadeTo('fast', 0.4);
- $("label[for='limit_from']").fadeTo('fast', 0.4);
- $("input[type='text'][name='limit_to']").prop('disabled', 'disabled');
- $("input[type='text'][name='limit_from']").prop('disabled', 'disabled');
-}
-
-/**
- * Enables the "Dump some row(s)" sub-options
- */
-function enable_dump_some_rows_sub_options()
-{
- $("label[for='limit_to']").fadeTo('fast', 1);
- $("label[for='limit_from']").fadeTo('fast', 1);
- $("input[type='text'][name='limit_to']").prop('disabled', '');
- $("input[type='text'][name='limit_from']").prop('disabled', '');
-}
diff --git a/js/keyhandler.js b/js/keyhandler.js
index 9a1b325427..a308da6b07 100644
--- a/js/keyhandler.js
+++ b/js/keyhandler.js
@@ -4,21 +4,6 @@
*
* @param object event data
*/
-
-AJAX.registerTeardown('keyhandler.js', function() {
- $('#table_columns').die('keydown keyup');
- $('table.insertRowTable').die('keydown keyup');
-});
-
-AJAX.registerOnload('keyhandler.js', function() {
- $('#table_columns').live('keydown keyup', function(event) {
- onKeyDownArrowsHandler(event.originalEvent);
- });
- $('table.insertRowTable').live('keydown keyup', function(event) {
- onKeyDownArrowsHandler(event.originalEvent);
- });
-});
-
function onKeyDownArrowsHandler(e)
{
e = e || window.event;
@@ -28,7 +13,8 @@ function onKeyDownArrowsHandler(e)
}
if (o.tagName != "TEXTAREA" && o.tagName != "INPUT" && o.tagName != "SELECT") {
return;
- }console.log(e);
+ }
+ console.log(e);
if (navigator.userAgent.toLowerCase().indexOf('applewebkit/') != -1) {
if (e.ctrlKey || e.shiftKey || !e.altKey) {
return;
@@ -101,3 +87,17 @@ function onKeyDownArrowsHandler(e)
}
e.returnValue = false;
}
+
+AJAX.registerTeardown('keyhandler.js', function () {
+ $('#table_columns').die('keydown keyup');
+ $('table.insertRowTable').die('keydown keyup');
+});
+
+AJAX.registerOnload('keyhandler.js', function () {
+ $('#table_columns').live('keydown keyup', function (event) {
+ onKeyDownArrowsHandler(event.originalEvent);
+ });
+ $('table.insertRowTable').live('keydown keyup', function (event) {
+ onKeyDownArrowsHandler(event.originalEvent);
+ });
+});
diff --git a/js/navigation.js b/js/navigation.js
index 5f95808094..260128de6a 100644
--- a/js/navigation.js
+++ b/js/navigation.js
@@ -15,7 +15,7 @@ $(function () {
}
// Do not let the page reload on submitting the fast filter
- $(document).on('submit', '.fast_filter', function(event) {
+ $(document).on('submit', '.fast_filter', function (event) {
event.preventDefault();
});
@@ -220,7 +220,7 @@ $(function () {
event.preventDefault();
$.ajax({
url: $(this).attr('href') + '&ajax_request=true',
- success: function(data) {
+ success: function (data) {
if (data.success === true) {
PMA_reloadNavigation();
} else {
@@ -267,7 +267,7 @@ $(function () {
var $msg = PMA_ajaxShowMessage();
$.ajax({
url: $(this).attr('href') + '&ajax_request=true',
- success: function(data) {
+ success: function (data) {
PMA_ajaxRemoveMessage($msg);
if (data.success === true) {
$tr.remove();
diff --git a/js/server_privileges.js b/js/server_privileges.js
index 935c99f0c5..ebfbc971c5 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -188,7 +188,7 @@ AJAX.registerOnload('server_privileges.js', function () {
$("#fieldset_add_user_login input[name='username']").live("focusout", function () {
var username = $(this).val();
var $warning = $("#user_exists_warning");
- if ($("#select_pred_username").val() == 'userdefined' && username != '') {
+ if ($("#select_pred_username").val() == 'userdefined' && username !== '') {
var href = $("form[name='usersForm']").attr('action');
var params = {
'ajax_request' : true,
@@ -410,7 +410,7 @@ AJAX.registerOnload('server_privileges.js', function () {
}
$div.html(data.message);
PMA_highlightSQL($div);
- var $div = $('#edit_user_dialog');
+ $div = $('#edit_user_dialog');
displayPasswordGenerateButton();
$(checkboxes_sel).trigger("change");
PMA_ajaxRemoveMessage($msgbox);
@@ -456,14 +456,16 @@ AJAX.registerOnload('server_privileges.js', function () {
// If any option other than 'keep the old one'(option 4) is chosen, we need to remove
// the old one from the table.
var $row_to_remove;
- if (curr_submit_name == 'change_copy'
- && $('input[name=mode]:checked', '#fieldset_mode').val() != '4') {
+ if (curr_submit_name == 'change_copy' &&
+ $('input[name=mode]:checked', '#fieldset_mode').val() != '4'
+ ) {
var old_username = $t.find('input[name="old_username"]').val();
var old_hostname = $t.find('input[name="old_hostname"]').val();
$('#usersForm tbody tr').each(function () {
var $tr = $(this);
- if ($tr.find('td:nth-child(2) label').text() == old_username
- && $tr.find('td:nth-child(3)').text() == old_hostname) {
+ if ($tr.find('td:nth-child(2) label').text() == old_username &&
+ $tr.find('td:nth-child(3)').text() == old_hostname
+ ) {
$row_to_remove = $tr;
return false;
}
@@ -584,9 +586,7 @@ AJAX.registerOnload('server_privileges.js', function () {
); //end $.post
});
// if exporting non-ajax, highlight anyways
- if ($("textarea.export").length > 0
- && typeof CodeMirror != 'undefined')
- {
+ if ($("textarea.export").length > 0 && typeof CodeMirror != 'undefined') {
CodeMirror.fromTextArea(
$('textarea.export')[0],
{
diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js
index 91765bc5a1..1051cf5b5a 100644
--- a/js/server_status_monitor.js
+++ b/js/server_status_monitor.js
@@ -1205,7 +1205,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|| settings.title === PMA_messages.strConnections
) {
settings.axes.yaxis.tickOptions = {
- formatter: function(format, val) {
+ formatter: function (format, val) {
if (Math.abs(val) >= 1000000)
return $.jqplot.sprintf("%.3g M", val/1000000);
else if (Math.abs(val) >= 1000)
diff --git a/js/server_variables.js b/js/server_variables.js
index d7e1147651..56370b8a70 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -56,9 +56,8 @@ AJAX.registerOnload('server_variables.js', function () {
var mark_next = false, $row, odd_row = false;
$('#serverVariables .var-row').not('.var-header').each(function () {
$row = $(this);
- if (mark_next
- || textFilter === null
- || textFilter.exec($row.find('.var-name').text())
+ if (mark_next || textFilter === null ||
+ textFilter.exec($row.find('.var-name').text())
) {
// If current global value is different from session value
// (has class diffSession), then display that one too
diff --git a/js/sql.js b/js/sql.js
index 18c26d4296..f9df4db2b6 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -104,7 +104,7 @@ AJAX.registerTeardown('sql.js', function () {
*/
AJAX.registerOnload('sql.js', function () {
// Delete row from SQL results
- $('a.delete_row.ajax').live('click',function (e) {
+ $('a.delete_row.ajax').live('click', function (e) {
e.preventDefault();
var question = $.sprintf(PMA_messages.strDoYouReally, $(this).closest('td').find('div').text());
var $link = $(this);
@@ -589,11 +589,9 @@ AJAX.registerOnload('sql.js', function () {
*/
function makeProfilingChart()
{
- if ($('#profilingchart').length === 0
- || $('#profilingchart').html().length !== 0
- || !$.jqplot
- || !$.jqplot.Highlighter
- || !$.jqplot.PieRenderer
+ if ($('#profilingchart').length === 0 ||
+ $('#profilingchart').html().length !== 0 ||
+ !$.jqplot || !$.jqplot.Highlighter || !$.jqplot.PieRenderer
) {
return;
}
@@ -621,7 +619,7 @@ function initProfilingTables()
$('#profiletable').tablesorter({
widgets: ['zebra'],
- sortList: [[0,0]],
+ sortList: [[0, 0]],
textExtraction: function (node) {
if (node.children.length > 0) {
return node.children[0].innerHTML;
@@ -630,10 +628,10 @@ function initProfilingTables()
}
}
});
-
+
$('#profilesummarytable').tablesorter({
widgets: ['zebra'],
- sortList: [[1,1]],
+ sortList: [[1, 1]],
textExtraction: function (node) {
if (node.children.length > 0) {
return node.children[0].innerHTML;
diff --git a/js/tbl_chart.js b/js/tbl_chart.js
index c555a6dc35..51b4f397e6 100644
--- a/js/tbl_chart.js
+++ b/js/tbl_chart.js
@@ -54,9 +54,10 @@ AJAX.registerOnload('tbl_chart.js', function () {
$('input[name="chartType"]').click(function () {
currentSettings.type = $(this).val();
drawChart();
- if ($(this).val() == 'bar' || $(this).val() == 'column'
- || $(this).val() == 'line' || $(this).val() == 'area'
- || $(this).val() == 'timeline' || $(this).val() == 'spline') {
+ if ($(this).val() == 'bar' || $(this).val() == 'column' ||
+ $(this).val() == 'line' || $(this).val() == 'area' ||
+ $(this).val() == 'timeline' || $(this).val() == 'spline'
+ ) {
$('span.barStacked').show();
} else {
$('span.barStacked').hide();
@@ -151,8 +152,9 @@ AJAX.registerOnload('tbl_chart.js', function () {
*
*/
$("#tblchartform").live('submit', function (event) {
- if (!checkFormElementInRange(this, 'session_max_rows', PMA_messages.strNotValidRowNumber, 1)
- || !checkFormElementInRange(this, 'pos', PMA_messages.strNotValidRowNumber, 0 - 1)) {
+ if (!checkFormElementInRange(this, 'session_max_rows', PMA_messages.strNotValidRowNumber, 1) ||
+ !checkFormElementInRange(this, 'pos', PMA_messages.strNotValidRowNumber, 0 - 1)
+ ) {
return false;
}
diff --git a/js/tbl_find_replace.js b/js/tbl_find_replace.js
index 1bcf57dcf7..975648f1cf 100644
--- a/js/tbl_find_replace.js
+++ b/js/tbl_find_replace.js
@@ -17,7 +17,7 @@ AJAX.registerOnload('tbl_find_replace.js', function () {
$('#toggle_find')
.html(PMA_messages.strHideFindNReplaceCriteria)
- .click(function() {
+ .click(function () {
var $link = $(this);
$('#find_replace_form').slideToggle();
if ($link.text() == PMA_messages.strHideFindNReplaceCriteria) {
@@ -25,10 +25,10 @@ AJAX.registerOnload('tbl_find_replace.js', function () {
} else {
$link.text(PMA_messages.strHideFindNReplaceCriteria);
}
- return false
+ return false;
});
- $('#find_replace_form').submit(function(e) {
+ $('#find_replace_form').submit(function (e) {
e.preventDefault();
var findReplaceForm = $('#find_replace_form');
PMA_prepareForAjaxRequest(findReplaceForm);
@@ -44,4 +44,4 @@ AJAX.registerOnload('tbl_find_replace.js', function () {
}
});
});
-});
\ No newline at end of file
+});
diff --git a/js/tbl_relation.js b/js/tbl_relation.js
index 2925096ceb..a2b6bddf01 100644
--- a/js/tbl_relation.js
+++ b/js/tbl_relation.js
@@ -60,13 +60,13 @@ function getDropdownValues($dropdown) {
+ '&table=' + $form.find('input[name="table"]').val()
+ '&foreign=' + (foreign != '')
+ '&foreignDb=' + encodeURIComponent(foreignDb)
- + (foreignTable !== null ?
+ + (foreignTable !== null ?
'&foreignTable=' + encodeURIComponent(foreignTable) : ''
);
$.ajax({
url: url,
datatype: 'json',
- success: function(data) {
+ success: function (data) {
PMA_ajaxRemoveMessage($msgbox);
if (data.success) {
// if the changed dropdown is a database selector
@@ -90,7 +90,7 @@ function setDropdownValues($dropdown, values) {
var optionsAsString = '';
// add an empty string to the beginning for empty selection
values.unshift('');
- $.each(values, function() {
+ $.each(values, function () {
optionsAsString += "";
})
$dropdown.append($(optionsAsString));
@@ -121,7 +121,7 @@ AJAX.registerOnload('tbl_relation.js', function () {
+ ' select[name^="destination_table"],'
+ ' select[name^="destination_foreign_db"],'
+ ' select[name^="destination_foreign_table"]')
- .change(function() {
+ .change(function () {
getDropdownValues($(this));
});
});
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 3f45583d2f..03ea6e94fe 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -18,6 +18,38 @@
*
*/
+/**
+ * This function returns the horizontal space available for the menu in pixels.
+ * To calculate this value we start we the width of the main panel, then we
+ * substract the margin of the page content, then we substract any cellspacing
+ * that the table may have (original theme only) and finally we substract the
+ * width of all columns of the table except for the last one (which is where
+ * the menu will go). What we should end up with is the distance between the
+ * start of the last column on the table and the edge of the page, again this
+ * is the space available for the menu.
+ *
+ * In the case where the table cell where the menu will be displayed is already
+ * off-screen (the table is wider than the page), a negative value will be returned,
+ * but this will be treated as a zero by the menuResizer plugin.
+ *
+ * @return int
+ */
+function PMA_tbl_structure_menu_resizer_callback() {
+ var pagewidth = $('body').width();
+ var $page = $('#page_content');
+ pagewidth -= $page.outerWidth(true) - $page.outerWidth();
+ var columnsWidth = 0;
+ var $columns = $('#tablestructure').find('tr:eq(1)').find('td,th');
+ $columns.not(':last').each(function () {
+ columnsWidth += $(this).outerWidth(true);
+ });
+ var totalCellSpacing = $('#tablestructure').width();
+ $columns.each(function () {
+ totalCellSpacing -= $(this).outerWidth(true);
+ });
+ return pagewidth - columnsWidth - totalCellSpacing - 15; // 15px extra margin
+}
+
/**
* Reload fields table
*/
@@ -74,12 +106,12 @@ AJAX.registerOnload('tbl_structure.js', function () {
//User wants to submit the form
$msg = PMA_ajaxShowMessage();
$.post($form.attr('action'), $form.serialize() + '&do_save_data=1', function (data) {
- if ($("#sqlqueryresults").length != 0) {
+ if ($("#sqlqueryresults").length !== 0) {
$("#sqlqueryresults").remove();
- } else if ($(".error:not(.tab)").length != 0) {
+ } else if ($(".error:not(.tab)").length !== 0) {
$(".error:not(.tab)").remove();
}
- if (data.success == true) {
+ if (data.success === true) {
$("#page_content")
.empty()
.append(data.message)
@@ -174,7 +206,7 @@ AJAX.registerOnload('tbl_structure.js', function () {
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingColumn, false);
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true, 'ajax_page_request' : true}, function (data) {
- if (data.success == true) {
+ if (data.success === true) {
PMA_ajaxRemoveMessage($msg);
if ($('#result_query').length) {
$('#result_query').remove();
@@ -372,38 +404,6 @@ AJAX.registerOnload('tbl_structure.js', function () {
});
});
-/**
- * This function returns the horizontal space available for the menu in pixels.
- * To calculate this value we start we the width of the main panel, then we
- * substract the margin of the page content, then we substract any cellspacing
- * that the table may have (original theme only) and finally we substract the
- * width of all columns of the table except for the last one (which is where
- * the menu will go). What we should end up with is the distance between the
- * start of the last column on the table and the edge of the page, again this
- * is the space available for the menu.
- *
- * In the case where the table cell where the menu will be displayed is already
- * off-screen (the table is wider than the page), a negative value will be returned,
- * but this will be treated as a zero by the menuResizer plugin.
- *
- * @return int
- */
-function PMA_tbl_structure_menu_resizer_callback() {
- var pagewidth = $('body').width();
- var $page = $('#page_content');
- pagewidth -= $page.outerWidth(true) - $page.outerWidth();
- var columnsWidth = 0;
- var $columns = $('#tablestructure').find('tr:eq(1)').find('td,th');
- $columns.not(':last').each(function () {
- columnsWidth += $(this).outerWidth(true);
- });
- var totalCellSpacing = $('#tablestructure').width();
- $columns.each(function () {
- totalCellSpacing -= $(this).outerWidth(true);
- });
- return pagewidth - columnsWidth - totalCellSpacing - 15; // 15px extra margin
-}
-
/** Handler for "More" dropdown in structure table rows */
AJAX.registerOnload('tbl_structure.js', function () {
if ($('#fieldsForm').hasClass('HideStructureActions')) {
diff --git a/js/tbl_zoom_plot_jqplot.js b/js/tbl_zoom_plot_jqplot.js
index fe7dcf35f3..7b37c7bfbd 100644
--- a/js/tbl_zoom_plot_jqplot.js
+++ b/js/tbl_zoom_plot_jqplot.js
@@ -1,4 +1,4 @@
-// todo: change the axis
+// TODO: change the axis
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
** @fileoverview JavaScript functions used on tbl_select.php
@@ -57,7 +57,9 @@ function isEmpty(obj) {
** @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) {
+ if (type.toString().search(/datetime/i) != -1 ||
+ type.toString().search(/timestamp/i) != -1
+ ) {
return $.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', val);
}
else if (type.toString().search(/time/i) != -1) {
@@ -73,10 +75,14 @@ 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) {
+ 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) {
+ } else if (field.toString().search(/time/i) != -1 ||
+ field.toString().search(/date/i) != -1
+ ) {
return 'time';
} else {
return 'text';
@@ -320,10 +326,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
series[0][searchedDataKey][0] =
getTimeStamp(selectedRow[xLabel], $('#types_0').val());
} else {
- // todo: text values
+ // TODO: text values
}
currentChart.series[0].data = series[0];
- // todo: axis changing
+ // TODO: axis changing
currentChart.replot();
}
@@ -336,10 +342,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
series[0][searchedDataKey][1] =
getTimeStamp(selectedRow[yLabel], $('#types_1').val());
} else {
- // todo: text values
+ // TODO: text values
}
currentChart.series[0].data = series[0];
- // todo: axis changing
+ // TODO: axis changing
currentChart.replot();
}
} //End plot update
@@ -448,6 +454,9 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
var xMin; // xAxis extreme min
var yMax; // yAxis extreme max
var yMin; // yAxis extreme min
+ var xVal;
+ var yVal;
+ var format;
var options = {
series: [
@@ -497,11 +506,10 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
if (xType == 'time') {
var originalXType = $('#types_0').val();
- var format;
if (originalXType == 'date') {
format = '%Y-%m-%d';
}
- // todo: does not seem to work
+ // TODO: does not seem to work
//else if (originalXType == 'time') {
// format = '%H:%M';
//} else {
@@ -516,7 +524,6 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
}
if (yType == 'time') {
var originalYType = $('#types_1').val();
- var format;
if (originalYType == 'date') {
format = '%Y-%m-%d';
}
@@ -530,16 +537,16 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
$.each(searchedData, function (key, value) {
if (xType == 'numeric') {
- var xVal = parseFloat(value[xLabel]);
+ xVal = parseFloat(value[xLabel]);
}
if (xType == 'time') {
- var xVal = getTimeStamp(value[xLabel], originalXType);
+ xVal = getTimeStamp(value[xLabel], originalXType);
}
if (yType == 'numeric') {
- var yVal = parseFloat(value[yLabel]);
+ yVal = parseFloat(value[yLabel]);
}
if (yType == 'time') {
- var yVal = getTimeStamp(value[yLabel], originalYType);
+ yVal = getTimeStamp(value[yLabel], originalYType);
}
series[0].push([
xVal,
diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php
index fabb04fabd..b5685337ee 100644
--- a/libraries/DisplayResults.class.php
+++ b/libraries/DisplayResults.class.php
@@ -535,19 +535,11 @@ class PMA_DisplayResults
) {
$caption_output = '';
- if (in_array(
- $GLOBALS['cfg']['TableNavigationLinksMode'],
- array('icons', 'both')
- )
- ) {
+ if (PMA_Util::showIcons('TableNavigationLinksMode')) {
$caption_output .= $caption;
}
- if (in_array(
- $GLOBALS['cfg']['TableNavigationLinksMode'],
- array('text', 'both')
- )
- ) {
+ if (PMA_Util::showText('TableNavigationLinksMode')) {
$caption_output .= ' ' . $title;
}
$title_output = ' title="' . $title . '"';
diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php
index 1bf725f868..c845c826f8 100644
--- a/libraries/Footer.class.php
+++ b/libraries/Footer.class.php
@@ -62,6 +62,36 @@ class PMA_Footer
$this->_isMinimal = false;
}
+ /**
+ * Adds the message for demo server to error messages
+ *
+ * @return string
+ */
+ private function _addDemoMessage()
+ {
+ $message = '' . __('phpMyAdmin Demo Server') . ': ';
+ if (file_exists('./revision-info.php')) {
+ include './revision-info.php';
+ $message .= sprintf(
+ __('Currently running Git revision %1$s from the %2$s branch.'),
+ ''
+ . $revision .'',
+ ''
+ . $branch . ''
+ );
+ } else {
+ $message .= __('Git information missing!');
+ }
+
+ $GLOBALS['error_handler']->addError(
+ $message,
+ E_USER_NOTICE,
+ '',
+ '',
+ false
+ );
+ }
+
/**
* Renders the debug messages
*
@@ -131,11 +161,7 @@ class PMA_Footer
$retval .= '";
}
+ if ($GLOBALS['cfg']['DBG']['demo']) {
+ $this->_addDemoMessage();
+ }
if (! $this->_isAjax && ! $this->_isMinimal) {
if (PMA_getenv('SCRIPT_NAME')
&& empty($_POST)
diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php
index cb48a2a6d4..ad5eb52e17 100644
--- a/libraries/Menu.class.php
+++ b/libraries/Menu.class.php
@@ -178,13 +178,13 @@ class PMA_Menu
$item = '';
- if (in_array($GLOBALS['cfg']['TabsMode'], array('text', 'both'))) {
+ if (PMA_Util::showText('TabsMode')) {
$item .= '%4$s: ';
}
$item .= '%3$s';
$retval .= "";
$retval .= "