Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/common.js33
-rw-r--r--js/config.js48
-rw-r--r--js/db_search.js6
-rw-r--r--js/db_structure.js3
-rw-r--r--js/export.js24
-rw-r--r--js/functions.js108
-rw-r--r--js/import.js14
-rw-r--r--js/keyhandler.js3
-rw-r--r--js/navigation.js18
-rw-r--r--js/replication.js19
-rw-r--r--js/server_privileges.js3
-rw-r--r--js/server_variables.js55
-rw-r--r--js/sql.js21
-rw-r--r--js/tbl_change.js34
-rw-r--r--js/tbl_chart.js98
-rw-r--r--js/tbl_gis_visualization.js9
-rw-r--r--js/tbl_relation.js5
-rw-r--r--js/tbl_structure.js11
-rw-r--r--js/update-location.js9
-rw-r--r--libraries/advisor.lib.php3
-rw-r--r--libraries/auth/cookie.auth.lib.php3
-rw-r--r--libraries/auth/signon.auth.lib.php3
-rw-r--r--libraries/build_html_for_db.lib.php6
-rw-r--r--libraries/charset_conversion.lib.php3
-rw-r--r--libraries/common.lib.php57
-rw-r--r--libraries/core.lib.php15
-rw-r--r--libraries/database_interface.lib.php15
-rw-r--r--libraries/dbi/mysql.dbi.lib.php11
-rw-r--r--libraries/dbi/mysqli.dbi.lib.php8
-rw-r--r--libraries/display_export.lib.php6
-rw-r--r--libraries/display_import_ajax.lib.php26
-rw-r--r--libraries/display_select_lang.lib.php6
-rw-r--r--libraries/display_tbl.lib.php64
-rw-r--r--libraries/header.inc.php3
-rw-r--r--libraries/iconv_wrapper.lib.php3
-rw-r--r--libraries/import.lib.php24
-rw-r--r--libraries/import/upload/apc.php3
-rw-r--r--libraries/import/upload/noplugin.php3
-rw-r--r--libraries/import/upload/uploadprogress.php3
-rw-r--r--libraries/js_escape.lib.php3
-rw-r--r--libraries/kanji-encoding.lib.php15
-rw-r--r--libraries/logging.lib.php3
-rw-r--r--libraries/mime.lib.php3
-rw-r--r--libraries/mysql_charsets.lib.php12
-rw-r--r--libraries/opendocument.lib.php3
-rw-r--r--libraries/relation.lib.php3
-rw-r--r--libraries/replication.inc.php21
-rw-r--r--libraries/replication_gui.lib.php15
-rw-r--r--libraries/select_lang.lib.php6
-rw-r--r--libraries/server_synchronize.lib.php9
-rw-r--r--libraries/sql_query_form.lib.php3
-rw-r--r--libraries/sysinfo.lib.php41
-rw-r--r--libraries/tbl_properties.inc.php3
-rw-r--r--libraries/transformations/TEMPLATE6
-rw-r--r--libraries/transformations/application_octetstream__download.inc.php6
-rw-r--r--libraries/transformations/application_octetstream__hex.inc.php6
-rw-r--r--libraries/transformations/global.inc.php9
-rw-r--r--libraries/transformations/image_jpeg__inline.inc.php6
-rw-r--r--libraries/transformations/image_jpeg__link.inc.php6
-rw-r--r--libraries/transformations/image_png__inline.inc.php6
-rw-r--r--libraries/transformations/text_plain__dateformat.inc.php6
-rw-r--r--libraries/transformations/text_plain__external.inc.php9
-rw-r--r--libraries/transformations/text_plain__formatted.inc.php6
-rw-r--r--libraries/transformations/text_plain__imagelink.inc.php6
-rw-r--r--libraries/transformations/text_plain__link.inc.php6
-rw-r--r--libraries/transformations/text_plain__longToIpv4.inc.php3
-rw-r--r--libraries/transformations/text_plain__sql.inc.php6
-rw-r--r--libraries/transformations/text_plain__substr.inc.php6
-rw-r--r--navigation.php3
-rw-r--r--pmd/scripts/history.js60
-rw-r--r--pmd/scripts/move.js6
-rw-r--r--pmd_save_pos.php3
-rw-r--r--scripts/openid.php3
-rw-r--r--scripts/signon-script.php3
-rw-r--r--server_privileges.php3
-rw-r--r--server_status.php18
-rw-r--r--server_variables.php13
-rw-r--r--setup/lib/form_processing.lib.php3
-rw-r--r--setup/scripts.js5
-rw-r--r--themes.php3
80 files changed, 710 insertions, 432 deletions
diff --git a/js/common.js b/js/common.js
index 97fa7d97dc..9b5dcf6d31 100644
--- a/js/common.js
+++ b/js/common.js
@@ -19,7 +19,8 @@ var query_to_load = '';
*
* @param string db name
*/
-function setDb(new_db) {
+function setDb(new_db)
+{
//alert('setDb(' + new_db + ')');
if (new_db != db) {
// db has changed
@@ -51,7 +52,8 @@ function setDb(new_db) {
*
* @param string table name
*/
-function setTable(new_table) {
+function setTable(new_table)
+{
//alert('setTable(' + new_table + ')');
if (new_table != table) {
// table has changed
@@ -86,7 +88,8 @@ function setTable(new_table) {
* @uses encodeURIComponent()
* @param string url name of page to be loaded
*/
-function refreshMain(url) {
+function refreshMain(url)
+{
if (! url) {
if (db) {
url = opendb_url;
@@ -117,7 +120,8 @@ function refreshMain(url) {
* @uses encodeURIComponent()
* @param boolean force force reloading
*/
-function refreshNavigation(force) {
+function refreshNavigation(force)
+{
// The goTo() function won't refresh in case the target
// url is the same as the url given as parameter, but sometimes
// we want to refresh anyway.
@@ -174,7 +178,8 @@ function markDbTable(db, table)
/**
* sets current selected server, table and db (called from libraries/footer.inc.php)
*/
-function setAll( new_lang, new_collation_connection, new_server, new_db, new_table, new_token ) {
+function setAll( new_lang, new_collation_connection, new_server, new_db, new_table, new_token )
+{
//alert('setAll( ' + new_lang + ', ' + new_collation_connection + ', ' + new_server + ', ' + new_db + ', ' + new_table + ', ' + new_token + ' )');
if (new_server != server || new_lang != lang
|| new_collation_connection != collation_connection) {
@@ -257,7 +262,8 @@ function focus_querywindow(sql_query)
* inserts query string into query window textarea
* called from script tag in querywindow
*/
-function insertQuery() {
+function insertQuery()
+{
if (query_to_load != '' && querywindow.document && querywindow.document.getElementById && querywindow.document.getElementById('sqlquery')) {
querywindow.document.getElementById('sqlquery').value = query_to_load;
query_to_load = '';
@@ -266,7 +272,8 @@ function insertQuery() {
return false;
}
-function open_querywindow( url ) {
+function open_querywindow( url )
+{
if ( ! url ) {
url = 'querywindow.php?' + common_query + '&db=' + encodeURIComponent(db) + '&table=' + encodeURIComponent(table);
}
@@ -293,7 +300,8 @@ function open_querywindow( url ) {
return true;
}
-function refreshQuerywindow( url ) {
+function refreshQuerywindow( url )
+{
if ( ! querywindow.closed && querywindow.location ) {
if ( ! querywindow.document.sqlform.LockFromUpdate
@@ -310,7 +318,8 @@ function refreshQuerywindow( url ) {
* @param string targeturl new url to load
* @param string target frame where to load the new url
*/
-function goTo(targeturl, target) {
+function goTo(targeturl, target)
+{
//alert(targeturl);
if ( target == 'main' ) {
target = window.frame_content;
@@ -339,7 +348,8 @@ function goTo(targeturl, target) {
}
// opens selected db in main frame
-function openDb(new_db) {
+function openDb(new_db)
+{
//alert('opendb(' + new_db + ')');
setDb(new_db);
setTable('');
@@ -347,7 +357,8 @@ function openDb(new_db) {
return true;
}
-function updateTableTitle( table_link_id, new_title ) {
+function updateTableTitle( table_link_id, new_title )
+{
//alert('updateTableTitle');
if ( window.parent.frame_navigation.document && window.parent.frame_navigation.document.getElementById(table_link_id) ) {
var left = window.parent.frame_navigation.document;
diff --git a/js/config.js b/js/config.js
index 94b2650616..53702e3938 100644
--- a/js/config.js
+++ b/js/config.js
@@ -14,7 +14,8 @@ var PMA_messages = {};
*
* @param {Element} field
*/
-function getFieldType(field) {
+function getFieldType(field)
+{
field = $(field);
var tagName = field.prop('tagName');
if (tagName == 'INPUT') {
@@ -40,7 +41,8 @@ function getFieldType(field) {
* @param {String} field_type see {@link #getFieldType}
* @param {String|Boolean} [value]
*/
-function setFieldValue(field, field_type, value) {
+function setFieldValue(field, field_type, value)
+{
field = $(field);
switch (field_type) {
case 'text':
@@ -78,7 +80,8 @@ function setFieldValue(field, field_type, value) {
* @param {String} field_type returned by {@link #getFieldType}
* @type Boolean|String|String[]
*/
-function getFieldValue(field, field_type) {
+function getFieldValue(field, field_type)
+{
field = $(field);
switch (field_type) {
case 'text':
@@ -101,7 +104,8 @@ function getFieldValue(field, field_type) {
/**
* Returns values for all fields in fieldsets
*/
-function getAllValues() {
+function getAllValues()
+{
var elements = $('fieldset input, fieldset select, fieldset textarea');
var values = {};
var type, value;
@@ -126,7 +130,8 @@ function getAllValues() {
* @param {String} type
* @return boolean
*/
-function checkFieldDefault(field, type) {
+function checkFieldDefault(field, type)
+{
field = $(field);
var field_id = field.attr('id');
if (typeof defaultValues[field_id] == 'undefined') {
@@ -157,7 +162,8 @@ function checkFieldDefault(field, type) {
* Returns element's id prefix
* @param {Element} element
*/
-function getIdPrefix(element) {
+function getIdPrefix(element)
+{
return $(element).attr('id').replace(/[^-]+$/, '');
}
@@ -254,7 +260,8 @@ var validators = {
* @param {boolean} onKeyUp whether fire on key up
* @param {Array} params validation function parameters
*/
-function validateField(id, type, onKeyUp, params) {
+function validateField(id, type, onKeyUp, params)
+{
if (typeof validators[type] == 'undefined') {
return;
}
@@ -272,7 +279,8 @@ function validateField(id, type, onKeyUp, params) {
* @type Array
* @return array of [function, paramseters to be passed to function]
*/
-function getFieldValidators(field_id, onKeyUpOnly) {
+function getFieldValidators(field_id, onKeyUpOnly)
+{
// look for field bound validator
var name = field_id.match(/[^-]+$/)[0];
if (typeof validators._field[name] != 'undefined') {
@@ -302,7 +310,8 @@ function getFieldValidators(field_id, onKeyUpOnly) {
*
* @param {Object} error_list list of errors in the form {field id: error array}
*/
-function displayErrors(error_list) {
+function displayErrors(error_list)
+{
for (var field_id in error_list) {
var errors = error_list[field_id];
var field = $('#'+field_id);
@@ -354,7 +363,8 @@ function displayErrors(error_list) {
* @param {boolean} isKeyUp
* @param {Object} errors
*/
-function validate_fieldset(fieldset, isKeyUp, errors) {
+function validate_fieldset(fieldset, isKeyUp, errors)
+{
fieldset = $(fieldset);
if (fieldset.length && typeof validators._fieldset[fieldset.attr('id')] != 'undefined') {
var fieldset_errors = validators._fieldset[fieldset.attr('id')].apply(fieldset[0], [isKeyUp]);
@@ -377,7 +387,8 @@ function validate_fieldset(fieldset, isKeyUp, errors) {
* @param {boolean} isKeyUp
* @param {Object} errors
*/
-function validate_field(field, isKeyUp, errors) {
+function validate_field(field, isKeyUp, errors)
+{
field = $(field);
var field_id = field.attr('id');
errors[field_id] = [];
@@ -403,7 +414,8 @@ function validate_field(field, isKeyUp, errors) {
* @param {Element} field
* @param {boolean} isKeyUp
*/
-function validate_field_and_fieldset(field, isKeyUp) {
+function validate_field_and_fieldset(field, isKeyUp)
+{
field = $(field);
var errors = {};
validate_field(field, isKeyUp, errors);
@@ -416,7 +428,8 @@ function validate_field_and_fieldset(field, isKeyUp) {
*
* @param {Element} field
*/
-function markField(field) {
+function markField(field)
+{
field = $(field);
var type = getFieldType(field);
var isDefault = checkFieldDefault(field, type);
@@ -433,7 +446,8 @@ function markField(field) {
* @param {Element} field
* @param {boolean} display
*/
-function setRestoreDefaultBtn(field, display) {
+function setRestoreDefaultBtn(field, display)
+{
var el = $(field).closest('td').find('.restore-default img');
el[display ? 'show' : 'hide']();
}
@@ -495,7 +509,8 @@ $(function() {
*
* @param {String} tab_id
*/
-function setTab(tab_id) {
+function setTab(tab_id)
+{
$('.tabs a').removeClass('active').filter('[href=' + tab_id + ']').addClass('active');
$('.tabs_contents fieldset').hide().filter(tab_id).show();
location.hash = 'tab_' + tab_id.substr(1);
@@ -562,7 +577,8 @@ $(function() {
*
* @param {String} field_id
*/
-function restoreField(field_id) {
+function restoreField(field_id)
+{
var field = $('#'+field_id);
if (field.length == 0 || defaultValues[field_id] == undefined) {
return;
diff --git a/js/db_search.js b/js/db_search.js
index 72b30463d4..3e2eeb40a7 100644
--- a/js/db_search.js
+++ b/js/db_search.js
@@ -15,7 +15,8 @@
*/
/** Loads the database search results */
-function loadResult(result_path , table_name , link , ajaxEnable){
+function loadResult(result_path , table_name , link , ajaxEnable)
+{
$(document).ready(function() {
if(ajaxEnable)
{
@@ -43,7 +44,8 @@ function loadResult(result_path , table_name , link , ajaxEnable){
}
/** Delete the selected search results */
-function deleteResult(result_path , msg , ajaxEnable){
+function deleteResult(result_path , msg , ajaxEnable)
+{
$(document).ready(function() {
/** Hides the results shown by the browse criteria */
$("#table-info").hide();
diff --git a/js/db_structure.js b/js/db_structure.js
index 559819e11c..c3b280a651 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -24,7 +24,8 @@
*
* @param jQuery object $this_anchor
*/
-function PMA_adjustTotals($this_anchor) {
+function PMA_adjustTotals($this_anchor)
+{
var $parent_tr = $this_anchor.closest('tr');
var $rows_td = $parent_tr.find('.tbl_rows');
var $size_td = $parent_tr.find('.tbl_size');
diff --git a/js/export.js b/js/export.js
index 3fd3c00e9d..a356d4526c 100644
--- a/js/export.js
+++ b/js/export.js
@@ -3,7 +3,7 @@
* Functions used in the export tab
*
*/
-
+
/**
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
@@ -19,7 +19,7 @@
});
/**
- * Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
+ * Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
*/
$(document).ready(function() {
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
@@ -50,7 +50,8 @@ $(document).ready(function() {
* options
*/
-function toggle_structure_data_opts(pluginName) {
+function toggle_structure_data_opts(pluginName)
+{
var radioFormName = pluginName + "_structure_or_data";
var dataDiv = "#" + pluginName + "_data";
var structureDiv = "#" + pluginName + "_structure";
@@ -89,7 +90,8 @@ $(document).ready(function() {
/**
* Toggles the disabling of the "save to file" options
*/
-function toggle_save_to_file() {
+function toggle_save_to_file()
+{
if($("#radio_dump_asfile:checked").length == 0) {
$("#ul_save_asfile > li").fadeTo('fast', 0.4);
$("#ul_save_asfile > li > input").attr('disabled', 'disabled');
@@ -111,7 +113,8 @@ $(document).ready(function() {
/**
* For SQL plugin, toggles the disabling of the "display comments" options
*/
-function toggle_sql_include_comments() {
+function toggle_sql_include_comments()
+{
$("#checkbox_sql_include_comments").change(function() {
if($("#checkbox_sql_include_comments:checked").length == 0) {
$("#ul_include_comments > li").fadeTo('fast', 0.4);
@@ -130,8 +133,8 @@ function toggle_sql_include_comments() {
}
/**
- * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
- */
+ * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options
+ */
$(document).ready(function() {
$("#checkbox_sql_create_table_statements").change(function() {
if($("#checkbox_sql_create_table_statements:checked").length == 0) {
@@ -144,7 +147,7 @@ $(document).ready(function() {
});
});
-/**
+/**
* Disables the view output as text option if the output must be saved as a file
*/
$(document).ready(function() {
@@ -164,7 +167,8 @@ $(document).ready(function() {
/**
* Toggles display of options when quick and custom export are selected
*/
-function toggle_quick_or_custom() {
+function toggle_quick_or_custom()
+{
if($("$(this):checked").attr("value") == "custom") {
$("#databases_and_tables").show();
$("#rows").show();
@@ -222,4 +226,4 @@ $(document).ready(function() {
$("input[type='text'][name='limit_from']").removeAttr('disabled');
}
});
-}); \ No newline at end of file
+});
diff --git a/js/functions.js b/js/functions.js
index 0cca1d1d6b..bb976ce91f 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -35,7 +35,8 @@ var chart_activeTimeouts = new Object();
*
* @param object the form
*/
-function PMA_prepareForAjaxRequest($form) {
+function PMA_prepareForAjaxRequest($form)
+{
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
@@ -48,7 +49,8 @@ function PMA_prepareForAjaxRequest($form) {
*
* @return boolean always true
*/
-function suggestPassword(passwd_form) {
+function suggestPassword(passwd_form)
+{
// restrict the password to just letters and numbers to avoid problems:
// "editors and viewers regard the password as multiple words and
// things like double click no longer work"
@@ -68,7 +70,8 @@ function suggestPassword(passwd_form) {
/**
* Version string to integer conversion.
*/
-function parseVersionString (str) {
+function parseVersionString (str)
+{
if (typeof(str) != 'string') { return false; }
var add = 0;
// Parse possible alpha/beta/rc/
@@ -98,7 +101,8 @@ function parseVersionString (str) {
/**
* Indicates current available version on main page.
*/
-function PMA_current_version() {
+function PMA_current_version()
+{
var current = parseVersionString(pmaversion);
var latest = parseVersionString(PMA_latest_version);
var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version;
@@ -124,7 +128,8 @@ function PMA_current_version() {
*
*/
-function displayPasswordGenerateButton() {
+function displayPasswordGenerateButton()
+{
$('#tr_element_before_generate_password').parent().append('<tr><td>' + PMA_messages['strGeneratePassword'] + '</td><td><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /><input type="text" name="generated_pw" id="generated_pw" /></td></tr>');
$('#div_element_before_generate_password').parent().append('<div class="item"><label for="button_generate_password">' + PMA_messages['strGeneratePassword'] + ':</label><span class="options"><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /></span><input type="text" name="generated_pw" id="generated_pw" /></div>');
}
@@ -134,7 +139,8 @@ function displayPasswordGenerateButton() {
*
* @param object $this_element a jQuery object pointing to the element
*/
-function PMA_addDatepicker($this_element, options) {
+function PMA_addDatepicker($this_element, options)
+{
var showTimeOption = false;
if ($this_element.is('.datetimefield')) {
showTimeOption = true;
@@ -176,7 +182,8 @@ function PMA_addDatepicker($this_element, options) {
* @param boolean only_once if true this is only done once
* f.e. only on first focus
*/
-function selectContent( element, lock, only_once ) {
+function selectContent( element, lock, only_once )
+{
if ( only_once && only_once_elements[element.name] ) {
return;
}
@@ -720,7 +727,8 @@ var marked_row = new Array;
*
* @param container DOM element
*/
-function markAllRows( container_id ) {
+function markAllRows( container_id )
+{
$("#"+container_id).find("input:checkbox:enabled").attr('checked', 'checked')
.parents("tr").addClass("marked");
@@ -733,7 +741,8 @@ function markAllRows( container_id ) {
*
* @param container DOM element
*/
-function unMarkAllRows( container_id ) {
+function unMarkAllRows( container_id )
+{
$("#"+container_id).find("input:checkbox:enabled").removeAttr('checked')
.parents("tr").removeClass("marked");
@@ -747,7 +756,8 @@ function unMarkAllRows( container_id ) {
* @param boolean state new value for checkbox (true or false)
* @return boolean always true
*/
-function setCheckboxes( container_id, state ) {
+function setCheckboxes( container_id, state )
+{
if(state) {
$("#"+container_id).find("input:checkbox").attr('checked', 'checked');
@@ -777,7 +787,8 @@ function setSelectOptions(the_form, the_select, do_check)
/**
* Sets current value for query box.
*/
-function setQuery(query) {
+function setQuery(query)
+{
if (codemirror_editor) {
codemirror_editor.setValue(query);
} else {
@@ -790,7 +801,8 @@ function setQuery(query) {
* Create quick sql statements.
*
*/
-function insertQuery(queryType) {
+function insertQuery(queryType)
+{
if (queryType == "clear") {
setQuery('');
return;
@@ -839,7 +851,8 @@ function insertQuery(queryType) {
* Inserts multiple fields.
*
*/
-function insertValueQuery() {
+function insertValueQuery()
+{
var myQuery = document.sqlform.sql_query;
var myListBox = document.sqlform.dummy;
@@ -884,14 +897,16 @@ function insertValueQuery() {
/**
* listbox redirection
*/
-function goToUrl(selObj, goToLocation) {
+function goToUrl(selObj, goToLocation)
+{
eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
}
/**
* getElement
*/
-function getElement(e,f){
+function getElement(e,f)
+{
if(document.layers){
f=(f)?f:self;
if(f.document.layers[e]) {
@@ -910,7 +925,8 @@ function getElement(e,f){
/**
* Refresh the WYSIWYG scratchboard after changes have been made
*/
-function refreshDragOption(e) {
+function refreshDragOption(e)
+{
var elm = $('#' + e);
if (elm.css('visibility') == 'visible') {
refreshLayout();
@@ -921,7 +937,8 @@ function refreshDragOption(e) {
/**
* Refresh/resize the WYSIWYG scratchboard
*/
-function refreshLayout() {
+function refreshLayout()
+{
var elm = $('#pdflayout')
var orientation = $('#orientation_opt').val();
if($('#paper_opt').length==1){
@@ -943,7 +960,8 @@ function refreshLayout() {
/**
* Show/hide the WYSIWYG scratchboard
*/
-function ToggleDragDrop(e) {
+function ToggleDragDrop(e)
+{
var elm = $('#' + e);
if (elm.css('visibility') == 'hidden') {
PDFinit(); /* Defined in pdf_pages.php */
@@ -961,7 +979,8 @@ function ToggleDragDrop(e) {
* PDF scratchboard: When a position is entered manually, update
* the fields inside the scratchboard.
*/
-function dragPlace(no, axis, value) {
+function dragPlace(no, axis, value)
+{
var elm = $('#table_' + no);
if (axis == 'x') {
elm.css('left', value + 'px');
@@ -973,7 +992,8 @@ function dragPlace(no, axis, value) {
/**
* Returns paper sizes for a given format
*/
-function pdfPaperSize(format, axis) {
+function pdfPaperSize(format, axis)
+{
switch (format.toUpperCase()) {
case '4A0':
if (axis == 'x') return 4767.87; else return 6740.79;
@@ -1301,7 +1321,8 @@ $(document).ready(function(){
* optional, defaults to 5000
* @return jQuery object jQuery Element that holds the message div
*/
-function PMA_ajaxShowMessage(message, timeout) {
+function PMA_ajaxShowMessage(message, timeout)
+{
//Handle the case when a empty data.message is passed. We don't want the empty message
if (message == '') {
@@ -1351,7 +1372,8 @@ function PMA_ajaxShowMessage(message, timeout) {
/**
* Removes the message shown for an Ajax operation when it's completed
*/
-function PMA_ajaxRemoveMessage($this_msgbox) {
+function PMA_ajaxRemoveMessage($this_msgbox)
+{
if ($this_msgbox != undefined && $this_msgbox instanceof jQuery) {
$this_msgbox
.stop(true, true)
@@ -1362,7 +1384,8 @@ function PMA_ajaxRemoveMessage($this_msgbox) {
/**
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
*/
-function PMA_showNoticeForEnum(selectElement) {
+function PMA_showNoticeForEnum(selectElement)
+{
var enum_notice_id = selectElement.attr("id").split("_")[1];
enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1);
var selectedType = selectElement.attr("value");
@@ -1376,7 +1399,8 @@ function PMA_showNoticeForEnum(selectElement) {
/**
* Generates a dialog box to pop up the create_table form
*/
-function PMA_createTableDialog( div, url , target) {
+function PMA_createTableDialog( div, url , target)
+{
/**
* @var button_options Object that stores the options passed to jQueryUI
* dialog
@@ -1439,7 +1463,8 @@ function PMA_createTableDialog( div, url , target) {
*
* @return object The created highcharts instance
*/
-function PMA_createChart(passedSettings) {
+function PMA_createChart(passedSettings)
+{
var container = passedSettings.chart.renderTo;
var settings = {
@@ -1574,7 +1599,8 @@ function PMA_createChart(passedSettings) {
/*
* Creates a Profiling Chart. Used in sql.php and server_status.js
*/
-function PMA_createProfilingChart(data, options) {
+function PMA_createProfilingChart(data, options)
+{
return PMA_createChart($.extend(true, {
chart: {
renderTo: 'profilingchart',
@@ -1608,7 +1634,8 @@ function PMA_createProfilingChart(data, options) {
}
// Formats a profiling duration nicely. Used in PMA_createProfilingChart() and server_status.js
-function PMA_prettyProfilingNum(num, acc) {
+function PMA_prettyProfilingNum(num, acc)
+{
if (!acc) {
acc = 2;
}
@@ -2203,7 +2230,8 @@ $(document).ready(function() {
});
});
-function PMA_verifyTypeOfAllColumns() {
+function PMA_verifyTypeOfAllColumns()
+{
$("select[class='column_type']").each(function() {
PMA_showNoticeForEnum($(this));
});
@@ -2212,7 +2240,8 @@ function PMA_verifyTypeOfAllColumns() {
/**
* Closes the ENUM/SET editor and removes the data in it
*/
-function disable_popup() {
+function disable_popup()
+{
$("#popup_background").fadeOut("fast");
$("#enum_editor").fadeOut("fast");
// clear the data from the text boxes
@@ -2308,7 +2337,8 @@ $(document).ready(function() {
displayMoreTableOpts();
});
-function displayMoreTableOpts() {
+function displayMoreTableOpts()
+{
// Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers)
// if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point)
if($("input[type='hidden'][name='table_type']").val() == "table") {
@@ -2425,7 +2455,8 @@ function checkIndexName(form_id)
* ommit this parameter the function searches
* the footnotes in the whole body
**/
-function PMA_convertFootnotesToTooltips($div) {
+function PMA_convertFootnotesToTooltips($div)
+{
// Hide the footnotes from the footer (which are displayed for
// JavaScript-disabled browsers) since the tooltip is sufficient
@@ -2571,14 +2602,16 @@ $(function() {
/**
* Get the row number from the classlist (for example, row_1)
*/
-function PMA_getRowNumber(classlist) {
+function PMA_getRowNumber(classlist)
+{
return parseInt(classlist.split(/\s+row_/)[1]);
}
/**
* Changes status of slider
*/
-function PMA_set_status_label(id) {
+function PMA_set_status_label(id)
+{
if ($('#' + id).css('display') == 'none') {
$('#anchor_status_' + id).text('+ ');
} else {
@@ -2589,7 +2622,8 @@ function PMA_set_status_label(id) {
/**
* Initializes slider effect.
*/
-function PMA_init_slider() {
+function PMA_init_slider()
+{
$('.pma_auto_slider').each(function(idx, e) {
if ($(e).hasClass('slider_init_done')) return;
$(e).addClass('slider_init_done');
@@ -2870,7 +2904,8 @@ $(document).ready(function() {
*
* @return bool True on success, false on failure
*/
-function PMA_slidingMessage(msg, $obj) {
+function PMA_slidingMessage(msg, $obj)
+{
if (msg == undefined || msg.length == 0) {
// Don't show an empty message
return false;
@@ -3041,7 +3076,8 @@ $(document).ready(function() {
* Create default PMA tooltip for the element specified. The default appearance
* can be overriden by specifying optional "options" parameter (see qTip options).
*/
-function PMA_createqTip($elements, content, options) {
+function PMA_createqTip($elements, content, options)
+{
var o = {
content: content,
style: {
diff --git a/js/import.js b/js/import.js
index 84457163a3..68a3793a97 100644
--- a/js/import.js
+++ b/js/import.js
@@ -9,10 +9,11 @@
* Toggles the hiding and showing of each plugin's options
* according to the currently selected plugin from the dropdown list
*/
-function changePluginOpts() {
- $(".format_specific_options").each(function() {
+function changePluginOpts()
+{
+ $(".format_specific_options").each(function() {
$(this).hide();
- });
+ });
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
@@ -26,7 +27,8 @@ function changePluginOpts() {
* Toggles the hiding and showing of each plugin's options and sets the selected value
* in the plugin dropdown list according to the format of the selected file
*/
-function matchFile(fname) {
+function matchFile(fname)
+{
var fname_array = fname.toLowerCase().split(".");
var len = fname_array.length;
if(len != 0) {
@@ -43,7 +45,7 @@ function matchFile(fname) {
}
}
$(document).ready(function() {
- // Initially display the options for the selected plugin
+ // Initially display the options for the selected plugin
changePluginOpts();
// Whenever the selected plugin changes, change the options displayed
@@ -79,4 +81,4 @@ $(document).ready(function() {
$("#scroll_to_options_msg").hide();
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 });
$(".format_specific_options h3").remove();
-}); \ No newline at end of file
+});
diff --git a/js/keyhandler.js b/js/keyhandler.js
index f92c7fb340..63a13facfd 100644
--- a/js/keyhandler.js
+++ b/js/keyhandler.js
@@ -3,7 +3,8 @@
*
* @param object event data
*/
-function onKeyDownArrowsHandler(e) {
+function onKeyDownArrowsHandler(e)
+{
e = e||window.event;
var o = (e.srcElement||e.target);
if (!o) return;
diff --git a/js/navigation.js b/js/navigation.js
index 5ce805c278..c70d428c18 100644
--- a/js/navigation.js
+++ b/js/navigation.js
@@ -17,7 +17,8 @@ var pma_saveframesize_timeout = null;
* @param string id id of the element in the DOM
* @param boolean only_open do not close/hide element
*/
-function toggle(id, only_open) {
+function toggle(id, only_open)
+{
var el = document.getElementById('subel' + id);
if (! el) {
return false;
@@ -104,7 +105,8 @@ function PMA_setFrameSize()
* @param string name name of the value to retrieve
* @return string value value for the given name from cookie
*/
-function PMA_getCookie(name) {
+function PMA_getCookie(name)
+{
var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) && (name != document.cookie.substring(0, name.length))) {
@@ -130,7 +132,8 @@ function PMA_getCookie(name) {
* @param string domain
* @param boolean secure
*/
-function PMA_setCookie(name, value, expires, path, domain, secure) {
+function PMA_setCookie(name, value, expires, path, domain, secure)
+{
document.cookie = name + "=" + escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
@@ -144,7 +147,8 @@ function PMA_setCookie(name, value, expires, path, domain, secure) {
* @param string value requested value
*
*/
-function fast_filter(value){
+function fast_filter(value)
+{
lowercase_value = value.toLowerCase();
$("#subel0 a[class!='tableicon']").each(function(idx,elem){
$elem = $(elem);
@@ -160,7 +164,8 @@ function fast_filter(value){
/**
* Clears fast filter.
*/
-function clear_fast_filter() {
+function clear_fast_filter()
+{
var elm = $('#NavFilter input');
elm.val('');
fast_filter('');
@@ -170,7 +175,8 @@ function clear_fast_filter() {
/**
* Reloads the recent tables list.
*/
-function PMA_reloadRecentTable() {
+function PMA_reloadRecentTable()
+{
$.get('navigation.php', {
'token': window.parent.token,
'server': window.parent.server,
diff --git a/js/replication.js b/js/replication.js
index 1a7c785b03..04cf86e21e 100644
--- a/js/replication.js
+++ b/js/replication.js
@@ -1,13 +1,14 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
- * for server_replication.php
+ * for server_replication.php
*
*/
var random_server_id = Math.floor(Math.random() * 10000000);
var conf_prefix = "server-id=" + random_server_id + "<br />log-bin=mysql-bin<br />log-error=mysql-bin.err<br />";
-function update_config() {
+function update_config()
+{
var conf_ignore = "binlog_ignore_db=";
var conf_do = "binlog_do_db=";
var database_list = $('#db_select option:selected:first').val();
@@ -30,24 +31,24 @@ $(document).ready(function() {
$('#db_select').change(update_config);
$('#master_status_href').click(function() {
- $('#replication_master_section').toggle();
+ $('#replication_master_section').toggle();
});
$('#master_slaves_href').click(function() {
- $('#replication_slaves_section').toggle();
+ $('#replication_slaves_section').toggle();
});
$('#slave_status_href').click(function() {
- $('#replication_slave_section').toggle();
+ $('#replication_slave_section').toggle();
});
$('#slave_control_href').click(function() {
- $('#slave_control_gui').toggle();
+ $('#slave_control_gui').toggle();
});
$('#slave_errormanagement_href').click(function() {
- $('#slave_errormanagement_gui').toggle();
+ $('#slave_errormanagement_gui').toggle();
});
$('#slave_synchronization_href').click(function() {
- $('#slave_synchronization_gui').toggle();
+ $('#slave_synchronization_gui').toggle();
});
$('#db_reset_href').click(function() {
- $('#db_select option:selected').attr('selected', false);
+ $('#db_select option:selected').attr('selected', false);
});
});
diff --git a/js/server_privileges.js b/js/server_privileges.js
index 35c34aa34e..c695dab478 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -81,7 +81,8 @@ function checkAddUser(the_form)
* @param new_user_initial the first alphabet of the user's name
* @param new_user_initial_string html to replace the initial for pagination
*/
-function appendNewUser(new_user_string, new_user_initial, new_user_initial_string) {
+function appendNewUser(new_user_string, new_user_initial, new_user_initial_string)
+{
//Append the newly retrived user to the table now
//Calculate the index for the new row
diff --git a/js/server_variables.js b/js/server_variables.js
index 8776440079..1aded3b43c 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -1,13 +1,14 @@
-function editVariable(link) {
+function editVariable(link)
+{
var varName = $(link).parent().parent().find('th:first').first().text().replace(/ /g,'_');
var mySaveLink = $(saveLink);
var myCancelLink = $(cancelLink);
var $cell = $(link).parent();
-
+
$cell.addClass('edit');
// remove edit link
$cell.find('a.editLink').remove();
-
+
mySaveLink.click(function() {
$.get('server_variables.php?' + url_query,
{ ajax_request: true, type: 'setval', varName: varName, varValue: $cell.find('input').attr('value') },
@@ -23,14 +24,14 @@ function editVariable(link) {
);
return false;
});
-
+
myCancelLink.click(function() {
$cell.html($cell.find('span.oldContent').html());
$cell.removeClass('edit');
return false;
});
-
-
+
+
$.get('server_variables.php?' + url_query,
{ ajax_request: true, type: 'getval', varName: varName },
function(data) {
@@ -42,17 +43,17 @@ function editVariable(link) {
$cell.find('table td:first').append(myCancelLink);
}
);
-
+
return false;
}
-$(function() {
+$(function() {
var textFilter=null;
var odd_row=false;
var testString = 'abcdefghijklmnopqrstuvwxyz0123456789,ABCEFGHIJKLMOPQRSTUVWXYZ';
var $tmpDiv;
var charWidth;
-
+
// Global vars
editLink = '<a href="#" class="editLink" onclick="return editVariable(this);"><img class="icon ic_b_edit" src="themes/dot.gif" alt=""> '+PMA_messages['strEdit']+'</a>';
saveLink = '<a href="#" class="saveLink"><img class="icon ic_b_save" src="themes/dot.gif" alt=""> '+PMA_messages['strSave']+'</a> ';
@@ -62,7 +63,7 @@ $(function() {
$.ajaxSetup({
cache:false
});
-
+
/* Variable editing */
if(isSuperuser) {
$('table.data tbody tr td:nth-child(2)').hover(
@@ -76,36 +77,36 @@ $(function() {
}
);
}
-
+
/*** This code snippet takes care that the table stays readable. It cuts off long strings the table overlaps the window size ***/
$('table.data').after($tmpDiv=$('<span>'+testString+'</span>'));
charWidth = $tmpDiv.width() / testString.length;
$tmpDiv.remove();
-
+
$(window).resize(limitTableWidth);
limitTableWidth();
-
+
function limitTableWidth() {
var fulltext;
var charDiff;
var maxTableWidth;
var $tmpTable;
-
+
$('table.data').after($tmpTable=$('<table id="testTable" style="width:100%;"><tr><td>'+testString+'</td></tr></table>'));
- maxTableWidth = $('#testTable').width();
+ maxTableWidth = $('#testTable').width();
$tmpTable.remove();
charDiff = ($('table.data').width()-maxTableWidth) / charWidth;
-
+
if($('body').innerWidth() < $('table.data').width()+10 || $('body').innerWidth() > $('table.data').width()+20) {
var maxChars=0;
-
+
$('table.data tbody tr td:nth-child(2)').each(function() {
maxChars=Math.max($(this).text().length,maxChars);
});
-
+
// Do not resize smaller if there's only 50 chars displayed already
if(charDiff > 0 && maxChars < 50) return;
-
+
$('table.data tbody tr td:nth-child(2)').each(function() {
if((charDiff>0 && $(this).text().length > maxChars-charDiff) || (charDiff<0 && $(this).find('abbr.cutoff').length>0)) {
if($(this).find('abbr.cutoff').length > 0)
@@ -115,7 +116,7 @@ $(function() {
// Do not cut off elements with html in it and hope they are not too long
if(fulltext.length != $(this).html().length) return 0;
}
-
+
if(fulltext.length < maxChars-charDiff)
$(this).html(fulltext);
else $(this).html('<abbr class="cutoff" title="'+fulltext+'">'+fulltext.substr(0,maxChars-charDiff-3)+'...</abbr>');
@@ -123,31 +124,31 @@ $(function() {
});
}
}
-
+
// Filter options are invisible for disabled js users
$('fieldset#tableFilter').css('display','');
-
+
$('#filterText').keyup(function(e) {
if($(this).val().length==0) textFilter=null;
else textFilter = new RegExp("(^| )"+$(this).val().replace(/_/g,' '),'i');
filterVariables();
});
-
+
function filterVariables() {
odd_row=false;
var mark_next=false;
var firstCell;
-
+
$('table.filteredData tbody tr').each(function() {
firstCell = $(this).children(':first');
-
+
if(mark_next || textFilter==null || textFilter.exec(firstCell.text())) {
// If current row is 'marked', also display next row
if($(this).hasClass('marked') && !mark_next)
mark_next=true;
else mark_next=false;
- odd_row = !odd_row;
+ odd_row = !odd_row;
$(this).css('display','');
if(odd_row) {
$(this).addClass('odd');
@@ -161,4 +162,4 @@ $(function() {
}
});
}
-}); \ No newline at end of file
+});
diff --git a/js/sql.js b/js/sql.js
index e762bb53c0..2b77af12f0 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -15,11 +15,13 @@ var $data_a;
* @param string str
* @return string the URL-decoded string
*/
-function PMA_urldecode(str) {
+function PMA_urldecode(str)
+{
return decodeURIComponent(str.replace(/\+/g, '%20'));
}
-function PMA_urlencode(str) {
+function PMA_urlencode(str)
+{
return encodeURIComponent(str.replace(/\%20/g, '+'));
}
@@ -29,7 +31,8 @@ function PMA_urlencode(str) {
*
* @param $this_field jQuery object that points to the current field's tr
*/
-function getFieldName($this_field) {
+function getFieldName($this_field)
+{
var this_field_index = $this_field.index();
// ltr or rtl direction does not impact how the DOM was generated
@@ -52,7 +55,8 @@ function getFieldName($this_field) {
* new inline edit anchor to each table row.
*
*/
-function appendInlineAnchor() {
+function appendInlineAnchor()
+{
// TODO: remove two lines below if vertical display mode has been completely removed
var disp_mode = $("#top_direction_dropdown").val();
@@ -1090,7 +1094,8 @@ $(document).ready(function() {
* (when called in the situation where no posting was done, the data
* parameter is empty)
*/
-function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data) {
+function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data)
+{
// deleting the hide button. remove <br><br><a> tags
$del_hide.find('a, br').remove();
@@ -1183,7 +1188,8 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
* Starting from some th, change the class of all td under it.
* If isAddClass is specified, it will be used to determine whether to add or remove the class.
*/
-function PMA_changeClassForColumn($this_th, newclass, isAddClass) {
+function PMA_changeClassForColumn($this_th, newclass, isAddClass)
+{
// index 0 is the th containing the big T
var th_index = $this_th.index();
var has_big_t = !$this_th.closest('tr').children(':first').hasClass('column_heading');
@@ -1232,7 +1238,8 @@ $(document).ready(function() {
/*
* Profiling Chart
*/
-function makeProfilingChart() {
+function makeProfilingChart()
+{
if ($('#profilingchart').length == 0) {
return;
}
diff --git a/js/tbl_change.js b/js/tbl_change.js
index 5e6ce842e0..17677b97ee 100644
--- a/js/tbl_change.js
+++ b/js/tbl_change.js
@@ -64,7 +64,8 @@ function nullify(theType, urlField, md5Field, multi_edit)
* Start of validation part
*/
//function checks the number of days in febuary
-function daysInFebruary (year){
+function daysInFebruary (year)
+{
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
//function to convert single digit to double digit
@@ -143,7 +144,8 @@ function isTime(val)
return true;
}
-function verificationsAfterFieldChange(urlField, multi_edit, theType){
+function verificationsAfterFieldChange(urlField, multi_edit, theType)
+{
var evt = window.event || arguments.callee.caller.arguments[0];
var target = evt.target || evt.srcElement;
@@ -226,23 +228,23 @@ $(document).ready(function() {
/**
* Handles all current checkboxes for Null; this only takes care of the
- * checkboxes on currently displayed rows as the rows generated by
- * "Continue insertion" are handled in the "Continue insertion" code
- *
+ * checkboxes on currently displayed rows as the rows generated by
+ * "Continue insertion" are handled in the "Continue insertion" code
+ *
*/
$('.checkbox_null').bind('click', function(e) {
nullify(
// use hidden fields populated by tbl_change.php
$(this).siblings('.nullify_code').val(),
- $(this).closest('tr').find('input:hidden').first().val(),
+ $(this).closest('tr').find('input:hidden').first().val(),
$(this).siblings('.hashed_field').val(),
$(this).siblings('.multi_edit').val()
);
});
/**
- * Submission of data to be inserted or updated
- *
+ * Submission of data to be inserted or updated
+ *
* @uses PMA_ajaxShowMessage()
*
* This section has been deactivated. Here are the problems that I've
@@ -257,9 +259,9 @@ $(document).ready(function() {
* 2. This code can be called if we are editing or inserting. If editing,
* the "and then" action can be "go back to this page" or "edit next
* row", in which cases it makes sense to use AJAX. But the "go back
- * to previous page" and "insert another new row" actions, using AJAX
+ * to previous page" and "insert another new row" actions, using AJAX
* has no obvious advantage. If inserting, the "go back to previous"
- * action needs a page refresh anyway.
+ * action needs a page refresh anyway.
*/
$("#insertFormDEACTIVATED").live('submit', function(event) {
@@ -388,8 +390,8 @@ $(document).ready(function() {
.bind('change', function(e) {
var $changed_element = $(this);
verificationsAfterFieldChange(
- $changed_element.data('hashed_field'),
- $changed_element.data('new_row_index'),
+ $changed_element.data('hashed_field'),
+ $changed_element.data('new_row_index'),
$changed_element.closest('tr').find('span.column_type').html()
);
});
@@ -401,15 +403,15 @@ $(document).ready(function() {
// to the original row, not the cloned one, so unbind()
.unbind('click')
// Keep these values to be used when the element
- // will be clicked
+ // will be clicked
.data('hashed_field', hashed_field)
.data('new_row_index', new_row_index)
.bind('click', function(e) {
var $changed_element = $(this);
nullify(
$changed_element.siblings('.nullify_code').val(),
- $this_element.closest('tr').find('input:hidden').first().val(),
- $changed_element.data('hashed_field'),
+ $this_element.closest('tr').find('input:hidden').first().val(),
+ $changed_element.data('hashed_field'),
'[multi_edit][' + $changed_element.data('new_row_index') + ']'
);
});
@@ -461,7 +463,7 @@ $(document).ready(function() {
// IMO it's not really important to handle the tabindex for
// function and Null
var tabindex = 0;
- $('.textfield')
+ $('.textfield')
.each(function() {
tabindex++;
$(this).attr('tabindex', tabindex);
diff --git a/js/tbl_chart.js b/js/tbl_chart.js
index 16a83b0f81..bec9a5cc59 100644
--- a/js/tbl_chart.js
+++ b/js/tbl_chart.js
@@ -7,25 +7,25 @@ $(document).ready(function() {
var chart_data = jQuery.parseJSON($('#querychart').html());
chart_series = 'columns';
chart_xaxis_idx = $('select[name="chartXAxis"]').attr('value');
-
+
$('#resizer').resizable({
minHeight:240,
minWidth:300,
- // On resize, set the chart size to that of the
+ // On resize, set the chart size to that of the
// resizer minus padding. If your chart has a lot of data or other
- // content, the redrawing might be slow. In that case, we recommend
+ // content, the redrawing might be slow. In that case, we recommend
// that you use the 'stop' event instead of 'resize'.
resize: function() {
currentChart.setSize(
- this.offsetWidth - 20,
+ this.offsetWidth - 20,
this.offsetHeight - 20,
false
);
}
- });
-
+ });
+
var currentSettings = {
- chart: {
+ chart: {
type: 'line',
width: $('#resizer').width() - 20,
height: $('#resizer').height() - 20
@@ -36,28 +36,28 @@ $(document).ready(function() {
yAxis: {
title: { text: $('input[name="yaxis_label"]').attr('value') }
},
- title: {
- text: $('input[name="chartTitle"]').attr('value'),
- margin:20
+ title: {
+ text: $('input[name="chartTitle"]').attr('value'),
+ margin:20
},
plotOptions: {
series: {}
}
}
-
+
$('#querychart').html('');
-
+
$('input[name="chartType"]').click(function() {
currentSettings.chart.type = $(this).attr('value');
-
+
drawChart();
-
+
if($(this).attr('value') == 'bar' || $(this).attr('value') == 'column')
$('span.barStacked').show();
else
$('span.barStacked').hide();
});
-
+
$('input[name="barStacked"]').click(function() {
if(this.checked)
$.extend(true,currentSettings,{ plotOptions: { series: { stacking:'normal' } } });
@@ -65,13 +65,13 @@ $(document).ready(function() {
$.extend(true,currentSettings,{ plotOptions: { series: { stacking:null } } });
drawChart();
});
-
+
$('input[name="chartTitle"]').keyup(function() {
var title = $(this).attr('value');
if(title.length == 0) title = ' ';
currentChart.setTitle({ text: title });
});
-
+
$('select[name="chartXAxis"]').change(function() {
chart_xaxis_idx = this.value;
drawChart();
@@ -81,7 +81,7 @@ $(document).ready(function() {
chart_series_index = this.selectedIndex;
drawChart();
});
-
+
/* Sucks, we cannot just set axis labels, we have to redraw the chart completely */
$('input[name="xaxis_label"]').keyup(function() {
currentSettings.xAxis.title.text = $(this).attr('value');
@@ -91,56 +91,58 @@ $(document).ready(function() {
currentSettings.yAxis.title.text = $(this).attr('value');
drawChart(true);
});
-
+
function drawChart(noAnimation) {
currentSettings.chart.width = $('#resizer').width() - 20;
currentSettings.chart.height = $('#resizer').height() - 20;
-
+
if(currentChart != null) currentChart.destroy();
-
+
if(noAnimation) currentSettings.plotOptions.series.animation = false;
currentChart = PMA_queryChart(chart_data,currentSettings);
if(noAnimation) currentSettings.plotOptions.series.animation = true;
}
-
+
drawChart();
$('#querychart').show();
});
-function in_array(element,array) {
+function in_array(element,array)
+{
for(var i=0; i < array.length; i++)
if(array[i] == element) return true;
return false;
}
-function PMA_queryChart(data,passedSettings) {
+function PMA_queryChart(data,passedSettings)
+{
if($('#querychart').length == 0) return;
-
+
var columnNames = Array();
-
+
var series = new Array();
var xaxis = { type: 'linear' };
var yaxis = new Object();
-
+
$.each(data[0],function(index,element) {
columnNames.push(index);
- });
-
+ });
+
switch(passedSettings.chart.type) {
case 'column':
case 'spline':
case 'line':
case 'bar':
xaxis.categories = new Array();
-
+
if(chart_series == 'columns') {
var j = 0;
- for(var i=0; i<columnNames.length; i++)
+ for(var i=0; i<columnNames.length; i++)
if(i != chart_xaxis_idx) {
series[j] = new Object();
series[j].data = new Array();
series[j].name = columnNames[i];
-
+
$.each(data,function(key,value) {
series[j].data.push(parseFloat(value[columnNames[i]]));
if( j== 0 && chart_xaxis_idx != -1 && ! xaxis.categories[value[columnNames[chart_xaxis_idx]]])
@@ -156,7 +158,7 @@ function PMA_queryChart(data,passedSettings) {
var contains = false;
for(var i=0; i < series.length; i++)
if(series[i].name == element[chart_series]) contains = true;
-
+
if(!contains) {
seriesIndex[element[chart_series]] = j;
series[j] = new Object();
@@ -165,24 +167,24 @@ function PMA_queryChart(data,passedSettings) {
j++;
}
});
-
+
var type;
// Get series points from query data
$.each(data,function(key,value) {
type = value[chart_series];
series[seriesIndex[type]].data.push(parseFloat(value[columnNames[0]]));
-
+
if( !in_array(value[columnNames[chart_xaxis_idx]],xaxis.categories))
xaxis.categories.push(value[columnNames[chart_xaxis_idx]]);
});
}
-
-
-
+
+
+
if(columnNames.length == 2)
yaxis.title = { text: columnNames[0] };
break;
-
+
case 'pie':
series[0] = new Object();
series[0].data = new Array();
@@ -194,17 +196,17 @@ function PMA_queryChart(data,passedSettings) {
});
break;
}
-
+
// Prevent the user from seeing the JSON code
$('div#profilingchart').html('').show();
var settings = {
- chart: {
+ chart: {
renderTo: 'querychart'
},
- title: {
- text: '',
- margin: 0
+ title: {
+ text: '',
+ margin: 0
},
series: series,
xAxis: xaxis,
@@ -224,17 +226,17 @@ function PMA_queryChart(data,passedSettings) {
},
tooltip: {
formatter: function() {
- if(this.point.name) return '<b>'+this.series.name+'</b><br/>'+this.point.name+'<br/>'+this.y;
- return '<b>'+this.series.name+'</b><br/>'+this.y;
+ if(this.point.name) return '<b>'+this.series.name+'</b><br/>'+this.point.name+'<br/>'+this.y;
+ return '<b>'+this.series.name+'</b><br/>'+this.y;
}
}
};
if(passedSettings.chart.type == 'pie')
settings.tooltip.formatter = function() { return '<b>'+columnNames[0]+'</b><br/>'+this.y; }
-
+
// Overwrite/Merge default settings with passedsettings
$.extend(true,settings,passedSettings);
-
+
return PMA_createChart(settings);
}
diff --git a/js/tbl_gis_visualization.js b/js/tbl_gis_visualization.js
index 81a86c480a..978cd69308 100644
--- a/js/tbl_gis_visualization.js
+++ b/js/tbl_gis_visualization.js
@@ -15,7 +15,8 @@ var svg;
/**
* Zooms and pans the visualization.
*/
-function zoomAndPan() {
+function zoomAndPan()
+{
var g = svg.getElementById('groupPanel');
g.setAttribute('transform', 'translate(' + x + ', ' + y + ') scale(' + scale + ')');
@@ -173,7 +174,7 @@ $(document).ready(function() {
y = height / 2 - (height / 2 - y) * 1.5;
zoomAndPan();
});
-
+
$('#zoom_world').live('click', function(e) {
e.preventDefault();
scale = 1;
@@ -181,7 +182,7 @@ $(document).ready(function() {
y = 0;
zoomAndPan();
});
-
+
$('#zoom_out').live('click', function(e) {
e.preventDefault();
//zoom out
@@ -239,7 +240,7 @@ $(document).ready(function() {
}).appendTo("body").fadeIn(200);
}
});
-
+
/**
* Detect the mouseout event and hide tooltips.
*/
diff --git a/js/tbl_relation.js b/js/tbl_relation.js
index 5cdb0d7d9f..74cb4092ef 100644
--- a/js/tbl_relation.js
+++ b/js/tbl_relation.js
@@ -1,9 +1,10 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
- * for tbl_relation.php
+ * for tbl_relation.php
*
*/
-function show_hide_clauses(thisDropdown) {
+function show_hide_clauses(thisDropdown)
+{
// here, one span contains the label and the clause dropdown
// and we have one span for ON DELETE and one for ON UPDATE
//
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 897cad8ade..63fa60f90f 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -341,7 +341,7 @@ $(document).ready(function() {
**/
$("#addColumns.ajax input[value=Go]").live('click', function(event){
event.preventDefault();
-
+
/*Remove the hidden dialogs if there are*/
if ($('#add_columns').length != 0) {
$('#add_columns').remove();
@@ -349,7 +349,7 @@ $(document).ready(function() {
var $div = $('<div id="add_columns"></div>');
var $form = $("#addColumns");
-
+
/**
* @var button_options Object that stores the options passed to jQueryUI
* dialog
@@ -389,7 +389,7 @@ $(document).ready(function() {
//Remove the top menu container from the dialog
.find("#topmenucontainer").hide()
; // end dialog options
-
+
$div = $("#add_columns");
/*changed the z-index of the enum editor to allow the edit*/
$("#enum_editor").css("z-index", "1100");
@@ -399,7 +399,7 @@ $(document).ready(function() {
}) // end $.get()
});
-
+
}) // end $(document).ready()
@@ -411,7 +411,8 @@ $(document).ready(function() {
* @param string $url Variable which parses the data for the
* post action
*/
-function changeColumns(action,url) {
+function changeColumns(action,url)
+{
/*Remove the hidden dialogs if there are*/
if ($('#change_column_dialog').length != 0) {
$('#change_column_dialog').remove();
diff --git a/js/update-location.js b/js/update-location.js
index d271cc82ea..3b9c51d86d 100644
--- a/js/update-location.js
+++ b/js/update-location.js
@@ -10,13 +10,14 @@ var hash_init_done = 0;
/**
* Sets hash part in URL, either calls itself in parent frame or does the
- * work itself. The hash is not set directly if we did not yet process old
+ * work itself. The hash is not set directly if we did not yet process old
* one.
*/
-function setURLHash(hash) {
+function setURLHash(hash)
+{
if (jQuery.browser.webkit) {
- /*
- * Setting hash leads to reload in webkit:
+ /*
+ * Setting hash leads to reload in webkit:
* http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anomaly_with_windowlocationhref.html
*/
return;
diff --git a/libraries/advisor.lib.php b/libraries/advisor.lib.php
index 660f90dfd9..1f00a13d1b 100644
--- a/libraries/advisor.lib.php
+++ b/libraries/advisor.lib.php
@@ -169,7 +169,8 @@ class Advisor {
}
}
-function PMA_bytime($num, $precision) {
+function PMA_bytime($num, $precision)
+{
$per = '';
if ($num >= 1) { # per second
$per = "per second";
diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php
index 9360b9aae0..4615c55ff9 100644
--- a/libraries/auth/cookie.auth.lib.php
+++ b/libraries/auth/cookie.auth.lib.php
@@ -81,7 +81,8 @@ if (function_exists('mcrypt_encrypt')) {
*
* @access public
*/
-function PMA_get_blowfish_secret() {
+function PMA_get_blowfish_secret()
+{
if (empty($GLOBALS['cfg']['blowfish_secret'])) {
if (empty($_SESSION['auto_blowfish_secret'])) {
// this returns 23 characters
diff --git a/libraries/auth/signon.auth.lib.php b/libraries/auth/signon.auth.lib.php
index 0a079b26a1..976845ccfc 100644
--- a/libraries/auth/signon.auth.lib.php
+++ b/libraries/auth/signon.auth.lib.php
@@ -18,7 +18,8 @@
*
* @access public
*/
-function PMA_auth() {
+function PMA_auth()
+{
unset($_SESSION['LAST_SIGNON_URL']);
if (empty($GLOBALS['cfg']['Server']['SignonURL'])) {
PMA_fatalError('You must set SignonURL!');
diff --git a/libraries/build_html_for_db.lib.php b/libraries/build_html_for_db.lib.php
index 6f4357c4cb..8d64549c31 100644
--- a/libraries/build_html_for_db.lib.php
+++ b/libraries/build_html_for_db.lib.php
@@ -13,7 +13,8 @@ if (! defined('PHPMYADMIN')) {
*
* @return array
*/
-function PMA_getColumnOrder() {
+function PMA_getColumnOrder()
+{
$column_order['DEFAULT_COLLATION_NAME'] = array(
'disp_name' => __('Collation'),
@@ -70,7 +71,8 @@ function PMA_getColumnOrder() {
*
* @return array $column_order, $out
*/
-function PMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query, $column_order, $replication_types, $replication_info) {
+function PMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query, $column_order, $replication_types, $replication_info)
+{
$out = '';
if ($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) {
diff --git a/libraries/charset_conversion.lib.php b/libraries/charset_conversion.lib.php
index b3ae693030..8d19ad436f 100644
--- a/libraries/charset_conversion.lib.php
+++ b/libraries/charset_conversion.lib.php
@@ -67,7 +67,8 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) {
* @access public
*
*/
-function PMA_convert_string($src_charset, $dest_charset, $what) {
+function PMA_convert_string($src_charset, $dest_charset, $what)
+{
if ($src_charset == $dest_charset) {
return $what;
}
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 13983de635..cc89c85254 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -410,7 +410,8 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
*
* @access public
*/
-function PMA_showDocu($anchor) {
+function PMA_showDocu($anchor)
+{
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
return '<a href="Documentation.html#' . $anchor . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';
} else {
@@ -426,7 +427,8 @@ function PMA_showDocu($anchor) {
*
* @access public
*/
-function PMA_showPHPDocu($target) {
+function PMA_showPHPDocu($target)
+{
$url = PMA_getPHPDocLink($target);
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
@@ -2142,7 +2144,8 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1,
*
* @access public
*/
-function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_count) {
+function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_count)
+{
if ($max_count < $count) {
echo 'frame_navigation' == $frame ? '<div id="navidbpageselector">' . "\n" : '';
@@ -2279,7 +2282,8 @@ function PMA_externalBug($functionality, $component, $minimum_version, $bugref)
* @param boolean $checked is it initially checked?
* @param boolean $onclick should it submit the form on click?
*/
-function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick) {
+function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick)
+{
echo '<input type="checkbox" name="' . $html_field_name . '" id="' . $html_field_name . '"' . ($checked ? ' checked="checked"' : '') . ($onclick ? ' onclick="this.form.submit();"' : '') . ' /><label for="' . $html_field_name . '">' . $label . '</label>';
}
@@ -2294,7 +2298,8 @@ function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick)
* @param boolean $escape_label whether to use htmlspecialchars() on label
* @param string $class enclose each choice with a div of this class
*/
-function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='') {
+function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='')
+{
foreach ($choices as $choice_value => $choice_label) {
if (! empty($class)) {
echo '<div class="' . $class . '">';
@@ -2452,7 +2457,8 @@ function PMA_toggleButton($action, $select_name, $options, $callback)
/**
* Clears cache content which needs to be refreshed on user change.
*/
-function PMA_clearUserCache() {
+function PMA_clearUserCache()
+{
PMA_cacheUnset('is_superuser', true);
}
@@ -2529,7 +2535,8 @@ function PMA_cacheUnset($var, $server = 0)
* @param integer $length
* @return string the printable value
*/
-function PMA_printable_bit_value($value, $length) {
+function PMA_printable_bit_value($value, $length)
+{
$printable = '';
for ($i = 0, $len_ceiled = ceil($length / 8); $i < $len_ceiled; $i++) {
$printable .= sprintf('%08d', decbin(ord(substr($value, $i, 1))));
@@ -2544,7 +2551,8 @@ function PMA_printable_bit_value($value, $length) {
* @param string $value
* @return boolean
*/
-function PMA_contains_nonprintable_ascii($value) {
+function PMA_contains_nonprintable_ascii($value)
+{
return preg_match('@[^[:print:]]@', $value);
}
@@ -2555,7 +2563,8 @@ function PMA_contains_nonprintable_ascii($value) {
* @param string $bit_default_value
* @return string the converted value
*/
-function PMA_convert_bit_default_value($bit_default_value) {
+function PMA_convert_bit_default_value($bit_default_value)
+{
return strtr($bit_default_value, array("b" => "", "'" => ""));
}
@@ -2566,7 +2575,8 @@ function PMA_convert_bit_default_value($bit_default_value) {
* @return array associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
*/
-function PMA_extractFieldSpec($fieldspec) {
+function PMA_extractFieldSpec($fieldspec)
+{
$first_bracket_pos = strpos($fieldspec, '(');
if ($first_bracket_pos) {
$spec_in_brackets = chop(substr($fieldspec, $first_bracket_pos + 1, (strrpos($fieldspec, ')') - $first_bracket_pos - 1)));
@@ -2679,7 +2689,8 @@ function PMA_extractFieldSpec($fieldspec) {
* @param string $engine
* @return boolean
*/
-function PMA_foreignkey_supported($engine) {
+function PMA_foreignkey_supported($engine)
+{
$engine = strtoupper($engine);
if ('INNODB' == $engine || 'PBXT' == $engine) {
return true;
@@ -2694,7 +2705,8 @@ function PMA_foreignkey_supported($engine) {
* @param string $content
* @return string the content with characters replaced
*/
-function PMA_replace_binary_contents($content) {
+function PMA_replace_binary_contents($content)
+{
$result = str_replace("\x00", '\0', $content);
$result = str_replace("\x08", '\b', $result);
$result = str_replace("\x0a", '\n', $result);
@@ -2710,7 +2722,8 @@ function PMA_replace_binary_contents($content) {
* @return string with the chars replaced
*/
-function PMA_duplicateFirstNewline($string) {
+function PMA_duplicateFirstNewline($string)
+{
$first_occurence = strpos($string, "\r\n");
if ($first_occurence === 0) {
$string = "\n".$string;
@@ -2726,7 +2739,8 @@ function PMA_duplicateFirstNewline($string) {
* or $cfg['DefaultTabDatabase']
* @return array
*/
-function PMA_getTitleForTarget($target) {
+function PMA_getTitleForTarget($target)
+{
$mapping = array(
// Values for $cfg['DefaultTabTable']
'tbl_structure.php' => __('Structure'),
@@ -2752,7 +2766,8 @@ function PMA_getTitleForTarget($target) {
* @param array $updates Array with overrides for default parameters (obtained from GLOBALS).
* @return string
*/
-function PMA_expandUserString($string, $escape = null, $updates = array()) {
+function PMA_expandUserString($string, $escape = null, $updates = array())
+{
/* Content */
$vars['http_host'] = PMA_getenv('HTTP_HOST') ? PMA_getenv('HTTP_HOST') : '';
$vars['server_name'] = $GLOBALS['cfg']['Server']['host'];
@@ -2868,7 +2883,8 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
*
* @param $max_upload_size
*/
-function PMA_browseUploadFile($max_upload_size) {
+function PMA_browseUploadFile($max_upload_size)
+{
echo '<label for="radio_import_file">' . __("Browse your computer:") . '</label>';
echo '<div id="upload_form_status" style="display: none;"></div>';
echo '<div id="upload_form_status_info" style="display: none;"></div>';
@@ -2884,7 +2900,8 @@ function PMA_browseUploadFile($max_upload_size) {
* @param $import_list
* @param $uploaddir
*/
-function PMA_selectUploadFile($import_list, $uploaddir) {
+function PMA_selectUploadFile($import_list, $uploaddir)
+{
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
$extensions = '';
foreach ($import_list as $key => $val) {
@@ -2914,7 +2931,8 @@ function PMA_selectUploadFile($import_list, $uploaddir) {
*
* @return array the action titles
*/
-function PMA_buildActionTitles() {
+function PMA_buildActionTitles()
+{
$titles = array();
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'));
@@ -3007,7 +3025,8 @@ function PMA_getSupportedDatatypes($html = false, $selected = '')
* @return array list of datatypes
*/
-function PMA_unsupportedDatatypes() {
+function PMA_unsupportedDatatypes()
+{
// These GIS data types are not yet supported.
$no_support_types = array('geometry',
'point',
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 7befffbc52..e0210cd91e 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -239,7 +239,8 @@ function PMA_fatalError($error_message, $message_args = null)
*
* @access public
*/
-function PMA_getPHPDocLink($target) {
+function PMA_getPHPDocLink($target)
+{
/* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */
$lang = _pgettext('PHP documentation language', 'en');
@@ -463,7 +464,8 @@ function PMA_checkPageValidity(&$page, $whitelist)
* @param string $var_name variable name
* @return string value of $var or empty string
*/
-function PMA_getenv($var_name) {
+function PMA_getenv($var_name)
+{
if (isset($_SERVER[$var_name])) {
return $_SERVER[$var_name];
} elseif (isset($_ENV[$var_name])) {
@@ -569,7 +571,8 @@ function PMA_no_cache_header()
*
* @return nothing
*/
-function PMA_download_header($filename, $mimetype, $length = 0, $no_cache = true) {
+function PMA_download_header($filename, $mimetype, $length = 0, $no_cache = true)
+{
if ($no_cache) {
PMA_no_cache_header();
}
@@ -675,7 +678,8 @@ function PMA_array_remove($path, &$array)
*
* @return string URL for a link.
*/
-function PMA_linkURL($url) {
+function PMA_linkURL($url)
+{
if (!preg_match('#^https?://#', $url) || defined('PMA_SETUP')) {
return $url;
} else {
@@ -692,7 +696,8 @@ function PMA_linkURL($url) {
*
* @return string HTML code for javascript inclusion.
*/
-function PMA_includeJS($url) {
+function PMA_includeJS($url)
+{
if (strpos($url, '?') === false) {
return '<script src="./js/' . $url . '?ts=' . filemtime('./js/' . $url) . '" type="text/javascript"></script>' . "\n";
} else {
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php
index 54b4af385d..6514393132 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -24,7 +24,8 @@ define('PMA_DBI_GETVAR_GLOBAL', 2);
*
* @param string $extension mysql extension to check
*/
-function PMA_DBI_checkMysqlExtension($extension = 'mysql') {
+function PMA_DBI_checkMysqlExtension($extension = 'mysql')
+{
if (! function_exists($extension . '_connect')) {
return false;
}
@@ -75,7 +76,8 @@ require_once './libraries/dbi/' . $GLOBALS['cfg']['Server']['extension'] . '.dbi
* @param bool $cache_affected_rows
* @return mixed
*/
-function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true) {
+function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true)
+{
$res = PMA_DBI_try_query($query, $link, $options, $cache_affected_rows)
or PMA_mysqlDie(PMA_DBI_getError($link), $query);
return $res;
@@ -155,7 +157,8 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_r
* @param string $message
* @return string $message
*/
-function PMA_DBI_convert_message($message) {
+function PMA_DBI_convert_message($message)
+{
// latin always last!
$encodings = array(
'japanese' => 'EUC-JP', //'ujis',
@@ -950,7 +953,8 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
* @return mixed value of first field in first row from result
* or false if not found
*/
-function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null, $options = 0) {
+function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null, $options = 0)
+{
$value = false;
if (is_string($result)) {
@@ -1004,7 +1008,8 @@ function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null,
* @return array|boolean first row from result
* or false if result is empty
*/
-function PMA_DBI_fetch_single_row($result, $type = 'ASSOC', $link = null, $options = 0) {
+function PMA_DBI_fetch_single_row($result, $type = 'ASSOC', $link = null, $options = 0)
+{
if (is_string($result)) {
$result = PMA_DBI_try_query($result, $link, $options | PMA_DBI_QUERY_STORE, false);
}
diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php
index 0d6c6976f7..d745f1ba81 100644
--- a/libraries/dbi/mysql.dbi.lib.php
+++ b/libraries/dbi/mysql.dbi.lib.php
@@ -53,7 +53,7 @@ function PMA_DBI_real_connect($server, $user, $password, $client_flags, $persist
/**
* connects to the database server
- *
+ *
* @param string $user mysql user name
* @param string $password mysql user password
* @param bool $is_controluser
@@ -188,7 +188,8 @@ function PMA_DBI_fetch_array($result)
* @param resource $result
* @return array
*/
-function PMA_DBI_fetch_assoc($result) {
+function PMA_DBI_fetch_assoc($result)
+{
return mysql_fetch_array($result, MYSQL_ASSOC);
}
@@ -232,7 +233,8 @@ function PMA_DBI_free_result($result)
*
* @return bool false
*/
-function PMA_DBI_more_results() {
+function PMA_DBI_more_results()
+{
// N.B.: PHP's 'mysql' extension does not support
// multi_queries so this function will always
// return false. Use the 'mysqli' extension, if
@@ -245,7 +247,8 @@ function PMA_DBI_more_results() {
*
* @return boo false
*/
-function PMA_DBI_next_result() {
+function PMA_DBI_next_result()
+{
// N.B.: PHP's 'mysql' extension does not support
// multi_queries so this function will always
// return false. Use the 'mysqli' extension, if
diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php
index e3f017b119..d3829588c7 100644
--- a/libraries/dbi/mysqli.dbi.lib.php
+++ b/libraries/dbi/mysqli.dbi.lib.php
@@ -256,7 +256,8 @@ function PMA_DBI_free_result($result)
* @param mysqli $link the mysqli object
* @return bool true or false
*/
-function PMA_DBI_more_results($link = null) {
+function PMA_DBI_more_results($link = null)
+{
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
@@ -273,7 +274,8 @@ function PMA_DBI_more_results($link = null) {
* @param mysqli $link the mysqli object
* @return bool true or false
*/
-function PMA_DBI_next_result($link = null) {
+function PMA_DBI_next_result($link = null)
+{
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
@@ -286,7 +288,7 @@ function PMA_DBI_next_result($link = null) {
/**
* Returns a string representing the type of connection used
- *
+ *
* @param resource $link mysql link
* @return string type of connection used
*/
diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php
index 75ec919f25..1a0a86f45d 100644
--- a/libraries/display_export.lib.php
+++ b/libraries/display_export.lib.php
@@ -15,13 +15,15 @@ $cfgRelation = PMA_getRelationsParam();
require_once './libraries/file_listing.php';
require_once './libraries/plugin_interface.lib.php';
-function PMA_exportCheckboxCheck($str) {
+function PMA_exportCheckboxCheck($str)
+{
if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
echo ' checked="checked"';
}
}
-function PMA_exportIsActive($what, $val) {
+function PMA_exportIsActive($what, $val)
+{
if (isset($GLOBALS['cfg']['Export'][$what]) && $GLOBALS['cfg']['Export'][$what] == $val) {
echo ' checked="checked"';
}
diff --git a/libraries/display_import_ajax.lib.php b/libraries/display_import_ajax.lib.php
index e10a9ea658..f0c271df7f 100644
--- a/libraries/display_import_ajax.lib.php
+++ b/libraries/display_import_ajax.lib.php
@@ -11,7 +11,7 @@ if (!defined('PHPMYADMIN')) {
/**
* constant for differenciating array in $_SESSION variable
*/
-$SESSION_KEY = '__upload_status';
+$SESSION_KEY = '__upload_status';
/**
* sets default plugin for handling the import process
@@ -35,12 +35,12 @@ $plugins = array(
// select available plugin
foreach ($plugins as $plugin) {
$check = "PMA_import_" . $plugin . "Check";
-
+
if ($check()) {
$_SESSION[$SESSION_KEY]["handler"] = $plugin;
include_once("import/upload/" . $plugin . ".php");
break;
- }
+ }
}
/**
@@ -48,7 +48,8 @@ foreach ($plugins as $plugin) {
*
* @return true if APC extension is available and if rfc1867 is enabled, false if it is not
*/
-function PMA_import_apcCheck() {
+function PMA_import_apcCheck()
+{
if (! extension_loaded('apc') || ! function_exists('apc_fetch') || ! function_exists('getallheaders')) {
return false;
}
@@ -57,10 +58,11 @@ function PMA_import_apcCheck() {
/**
* Checks if UploadProgress bar extension is available.
- *
+ *
* @return true if UploadProgress extension is available, false if it is not
*/
-function PMA_import_uploadprogressCheck() {
+function PMA_import_uploadprogressCheck()
+{
if (! function_exists("uploadprogress_get_info") || ! function_exists('getallheaders')) {
return false;
}
@@ -68,19 +70,21 @@ function PMA_import_uploadprogressCheck() {
}
/**
* Default plugin for handling import. If no other plugin is available, noplugin is used.
- *
- * @return true
+ *
+ * @return true
*/
-function PMA_import_nopluginCheck() {
+function PMA_import_nopluginCheck()
+{
return true;
}
/**
* The function outputs json encoded status of uploaded. It uses PMA_getUploadStatus, which is defined in plugin's file.
- *
+ *
* @param $id - ID of transfer, usually $upload_id from display_import_ajax.lib.php
*/
-function PMA_importAjaxStatus($id) {
+function PMA_importAjaxStatus($id)
+{
header('Content-type: application/json');
echo json_encode(PMA_getUploadStatus($id));
}
diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php
index 4ed3ec2b83..202378dbfe 100644
--- a/libraries/display_select_lang.lib.php
+++ b/libraries/display_select_lang.lib.php
@@ -17,7 +17,8 @@ if (! defined('PHPMYADMIN')) {
* @return the sorted array
* @access private
*/
-function PMA_language_cmp(&$a, &$b) {
+function PMA_language_cmp(&$a, &$b)
+{
return (strcmp($a[1], $b[1]));
} // end of the 'PMA_language_cmp()' function
@@ -26,7 +27,8 @@ function PMA_language_cmp(&$a, &$b) {
*
* @access public
*/
-function PMA_select_language($use_fieldset = false, $show_doc = true) {
+function PMA_select_language($use_fieldset = false, $show_doc = true)
+{
global $cfg, $lang;
?>
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 5243dff9c0..454f888c1b 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -28,12 +28,12 @@ require_once './libraries/Index.class.php';
* the "display printable view" option.
* Of course '0'/'1' means the feature won't/will be enabled.
*
- * @param string &$the_disp_mode the synthetic value for display_mode (see a few
- * lines above for explanations)
- * @param integer &$the_total the total number of rows returned by the SQL query
- * without any programmatically appended "LIMIT" clause
- * (just a copy of $unlim_num_rows if it exists, else
- * computed inside this function)
+ * @param string &$the_disp_mode the synthetic value for display_mode (see a few
+ * lines above for explanations)
+ * @param integer &$the_total the total number of rows returned by the SQL query
+ * without any programmatically appended "LIMIT" clause
+ * (just a copy of $unlim_num_rows if it exists, else
+ * computed inside this function)
*
* @return array an array with explicit indexes for all the display
* elements
@@ -80,7 +80,9 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$do_display['bkm_form'] = (string) '0';
$do_display['text_btn'] = (string) '0';
$do_display['pview_lnk'] = (string) '0';
- } elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse'] || $GLOBALS['is_maint'] || $GLOBALS['is_explain']) {
+ } elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse']
+ || $GLOBALS['is_maint'] || $GLOBALS['is_explain']
+ ) {
// 2.1 Statement is a "SELECT COUNT", a
// "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or
// contains a "PROC ANALYSE" part
@@ -131,7 +133,8 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|| $do_display['ins_row'] != '0');
// 2.3.2 Displays edit/delete/sort/insert links?
if ($is_link
- && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)) {
+ && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)
+ ) {
$do_display['edit_lnk'] = 'nn'; // don't display links
$do_display['del_lnk'] = 'nn';
/**
@@ -220,7 +223,8 @@ function PMA_isSelect()
*
* @see PMA_displayTableNavigation()
*/
-function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') {
+function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '')
+{
global $db, $table, $goto;
@@ -1071,7 +1075,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
*
* @return string the td
*/
-function PMA_buildValueDisplay($class, $condition_field, $value) {
+function PMA_buildValueDisplay($class, $condition_field, $value)
+{
return '<td align="left"' . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $value . '</td>';
}
@@ -1083,7 +1088,8 @@ function PMA_buildValueDisplay($class, $condition_field, $value) {
*
* @return string the td
*/
-function PMA_buildNullDisplay($class, $condition_field) {
+function PMA_buildNullDisplay($class, $condition_field)
+{
// the null class is needed for inline editing
return '<td align="right"' . ' class="' . $class . ($condition_field ? ' condition' : '') . ' null"><i>NULL</i></td>';
}
@@ -1097,7 +1103,8 @@ function PMA_buildNullDisplay($class, $condition_field) {
*
* @return string the td
*/
-function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') {
+function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '')
+{
$nowrap = ' nowrap';
return '<td ' . $align . ' class="' . PMA_addClass($class, $condition_field, $meta, $nowrap) . '"></td>';
}
@@ -1115,7 +1122,8 @@ function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') {
*
* @return string the list of classes
*/
-function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated = false, $transform_function = '', $default_function = '') {
+function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated = false, $transform_function = '', $default_function = '')
+{
// Define classes to be added to this data field based on the type of data
$enum_class = '';
if (strpos($meta->flags, 'enum') !== false) {
@@ -1171,7 +1179,8 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_trunca
*
* @see PMA_displayTable()
*/
-function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
+function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
+{
global $db, $table, $goto;
global $sql_query, $fields_meta, $fields_cnt;
global $vertical_display, $highlight_columns;
@@ -2385,7 +2394,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
}
} // end of the 'PMA_displayTable()' function
-function default_function($buffer) {
+function default_function($buffer)
+{
$buffer = htmlspecialchars($buffer);
$buffer = str_replace("\011", ' &nbsp;&nbsp;&nbsp;',
str_replace(' ', ' &nbsp;', $buffer));
@@ -2413,7 +2423,8 @@ function default_function($buffer) {
* PMA_displayTableNavigation(), PMA_displayTableHeaders(),
* PMA_displayTableBody(), PMA_displayResultsOperations()
*/
-function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
+function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
+{
global $db, $table, $sql_query, $unlim_num_rows, $fields_meta;
$header_shown = false;
@@ -2548,7 +2559,8 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
* @param object $meta the meta-information about this field
* @return mixed string or float
*/
-function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array()) {
+function PMA_handle_non_printable_contents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array())
+{
$result = '[' . $category;
if (is_null($content)) {
$result .= ' - NULL';
@@ -2598,7 +2610,8 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
* @param bool $is_field_truncated
* @return string formatted data
*/
-function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $data, $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated ) {
+function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $data, $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated )
+{
$result = ' class="' . PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated, $transform_function, $default_function) . '">';
@@ -2696,7 +2709,8 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
* @return string the generated HTML
*/
-function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix, $class) {
+function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_clause_html, $del_query, $id_suffix, $class)
+{
$ret = '';
if (! empty($del_url) && $is_display['del_lnk'] != 'kp') {
$ret .= '<td ';
@@ -2722,7 +2736,8 @@ function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_cla
* @param string $where_clause_html
* @return string the generated HTML
*/
-function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html) {
+function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html)
+{
$ret = '';
if (! empty($edit_url)) {
$ret .= '<td class="' . $class . '" align="center" ' . ' ><span class="nowrap">'
@@ -2748,7 +2763,8 @@ function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, $wher
* @param string $where_clause_html
* @return string the generated HTML
*/
-function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class) {
+function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class)
+{
$ret = '';
if (! empty($copy_url)) {
$ret .= '<td ';
@@ -2778,7 +2794,8 @@ function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, $where_clause
* @param string $class
* @return string the generated HTML
*/
-function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class) {
+function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class)
+{
$ret = '';
if (! empty($del_url)) {
$ret .= '<td ';
@@ -2812,7 +2829,8 @@ function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class) {
* @param string $js_conf
* @return string the generated HTML
*/
-function PMA_generateCheckboxAndLinks($position, $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf) {
+function PMA_generateCheckboxAndLinks($position, $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf)
+{
$ret = '';
if ($position == 'left') {
diff --git a/libraries/header.inc.php b/libraries/header.inc.php
index a6ed8edc45..3fbfc0d7fd 100644
--- a/libraries/header.inc.php
+++ b/libraries/header.inc.php
@@ -18,7 +18,8 @@ require_once './libraries/RecentTable.class.php';
* @param string $db Database name where the table is located.
* @param string $table The table name
*/
-function PMA_addRecentTable($db, $table) {
+function PMA_addRecentTable($db, $table)
+{
$tmp_result = PMA_RecentTable::getInstance()->add($db, $table);
if ($tmp_result === true) {
echo '<span class="hide" id="update_recent_tables"></span>';
diff --git a/libraries/iconv_wrapper.lib.php b/libraries/iconv_wrapper.lib.php
index 61e6875b4e..1b05e04b5e 100644
--- a/libraries/iconv_wrapper.lib.php
+++ b/libraries/iconv_wrapper.lib.php
@@ -49,7 +49,8 @@ $gnu_iconv_to_aix_iconv_codepage_map = array (
* @access public
*
*/
-function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str) {
+function PMA_aix_iconv_wrapper($in_charset, $out_charset, $str)
+{
global $gnu_iconv_to_aix_iconv_codepage_map;
diff --git a/libraries/import.lib.php b/libraries/import.lib.php
index 0ab9d5a320..f4577890c5 100644
--- a/libraries/import.lib.php
+++ b/libraries/import.lib.php
@@ -381,7 +381,8 @@ function PMA_getColumnAlphaName($num)
* @param string $name (i.e. "A", or "BC", etc.)
* @return int The column number
*/
-function PMA_getColumnNumberFromName($name) {
+function PMA_getColumnNumberFromName($name)
+{
if (!empty($name)) {
$name = strtoupper($name);
$num_chars = strlen($name);
@@ -440,7 +441,8 @@ define("SIZES", 1);
* @param string $last_cumulative_size
* @return int Precision of the given decimal size notation
*/
-function PMA_getM($last_cumulative_size) {
+function PMA_getM($last_cumulative_size)
+{
return (int)substr($last_cumulative_size, 0, strpos($last_cumulative_size, ","));
}
@@ -452,7 +454,8 @@ function PMA_getM($last_cumulative_size) {
* @param string $last_cumulative_size
* @return int Scale of the given decimal size notation
*/
-function PMA_getD($last_cumulative_size) {
+function PMA_getD($last_cumulative_size)
+{
return (int)substr($last_cumulative_size, (strpos($last_cumulative_size, ",") + 1), (strlen($last_cumulative_size) - strpos($last_cumulative_size, ",")));
}
@@ -464,7 +467,8 @@ function PMA_getD($last_cumulative_size) {
* @param string &$cell
* @return array Contains the precision, scale, and full size representation of the given decimal cell
*/
-function PMA_getDecimalSize(&$cell) {
+function PMA_getDecimalSize(&$cell)
+{
$curr_size = strlen((string)$cell);
$decPos = strpos($cell, ".");
$decPrecision = ($curr_size - 1) - $decPos;
@@ -488,7 +492,8 @@ function PMA_getDecimalSize(&$cell) {
* @param string &$cell The current cell
* @return string Size of the given cell in the type-appropriate format
*/
-function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type, &$cell) {
+function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type, &$cell)
+{
$curr_size = strlen((string)$cell);
/**
@@ -697,7 +702,8 @@ function PMA_detectSize($last_cumulative_size, $last_cumulative_type, $curr_type
* @param string &$cell String representation of the cell for which a best-fit type is to be determined
* @return int The MySQL type representation (VARCHAR or INT or BIGINT or DECIMAL or NONE)
*/
-function PMA_detectType($last_cumulative_type, &$cell) {
+function PMA_detectType($last_cumulative_type, &$cell)
+{
/**
* If numeric, determine if decimal, int or bigint
* Else, we call it varchar for simplicity
@@ -736,7 +742,8 @@ function PMA_detectType($last_cumulative_type, &$cell) {
* @param &$table array(string $table_name, array $col_names, array $rows)
* @return array array(array $types, array $sizes)
*/
-function PMA_analyzeTable(&$table) {
+function PMA_analyzeTable(&$table)
+{
/* Get number of rows in table */
$numRows = count($table[ROWS]);
/* Get number of columns */
@@ -833,7 +840,8 @@ $import_notice = null;
* @param array $options Associative array of options
* @return void
*/
-function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql = null, $options = null) {
+function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql = null, $options = null)
+{
/* Take care of the options */
if (isset($options['db_collation'])&& ! is_null($options['db_collation'])) {
$collation = $options['db_collation'];
diff --git a/libraries/import/upload/apc.php b/libraries/import/upload/apc.php
index a308b1b67c..5250c92255 100644
--- a/libraries/import/upload/apc.php
+++ b/libraries/import/upload/apc.php
@@ -16,7 +16,8 @@ $ID_KEY = 'APC_UPLOAD_PROGRESS';
*
* This is implementation for APC extension.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/import/upload/noplugin.php b/libraries/import/upload/noplugin.php
index a3cb19ad4f..fa7796c686 100644
--- a/libraries/import/upload/noplugin.php
+++ b/libraries/import/upload/noplugin.php
@@ -16,7 +16,8 @@ $ID_KEY = 'noplugin';
*
* This is implementation when no webserver support exists, so it returns just zeroes.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/import/upload/uploadprogress.php b/libraries/import/upload/uploadprogress.php
index 797ade70f9..a3ec60b1de 100644
--- a/libraries/import/upload/uploadprogress.php
+++ b/libraries/import/upload/uploadprogress.php
@@ -15,7 +15,8 @@ $ID_KEY = "UPLOAD_IDENTIFIER";
*
* This is implementation for uploadprogress extension.
*/
-function PMA_getUploadStatus($id) {
+function PMA_getUploadStatus($id)
+{
global $SESSION_KEY;
global $ID_KEY;
diff --git a/libraries/js_escape.lib.php b/libraries/js_escape.lib.php
index 53e5052223..25b832f04a 100644
--- a/libraries/js_escape.lib.php
+++ b/libraries/js_escape.lib.php
@@ -64,7 +64,8 @@ function PMA_escapeJsString($string)
* @param string $key Name of value to set
* @param mixed $value Value to set, can be either string or array of strings
*/
-function PMA_printJsValue($key, $value) {
+function PMA_printJsValue($key, $value)
+{
echo $key . ' = ';
if (is_array($value)) {
echo '[';
diff --git a/libraries/kanji-encoding.lib.php b/libraries/kanji-encoding.lib.php
index 59891f53c3..6ee78c61eb 100644
--- a/libraries/kanji-encoding.lib.php
+++ b/libraries/kanji-encoding.lib.php
@@ -25,7 +25,8 @@ if (! defined('PHPMYADMIN')) {
*
* @return boolean always true
*/
-function PMA_internal_enc_check() {
+function PMA_internal_enc_check()
+{
global $internal_enc, $enc_list;
$internal_enc = mb_internal_encoding();
@@ -47,7 +48,8 @@ function PMA_internal_enc_check() {
*
* @return boolean always true
*/
-function PMA_change_enc_order() {
+function PMA_change_enc_order()
+{
global $enc_list;
$p = explode(',', $enc_list);
@@ -73,7 +75,8 @@ function PMA_change_enc_order() {
*
* @return string the converted string
*/
-function PMA_kanji_str_conv($str, $enc, $kana) {
+function PMA_kanji_str_conv($str, $enc, $kana)
+{
global $enc_list;
if ($enc == '' && $kana == '') {
@@ -104,7 +107,8 @@ function PMA_kanji_str_conv($str, $enc, $kana) {
*
* @return string the name of the converted file
*/
-function PMA_kanji_file_conv($file, $enc, $kana) {
+function PMA_kanji_file_conv($file, $enc, $kana)
+{
if ($enc == '' && $kana == '') {
return $file;
}
@@ -135,7 +139,8 @@ function PMA_kanji_file_conv($file, $enc, $kana) {
*
* @return string xhtml code for the radio controls
*/
-function PMA_set_enc_form($spaces) {
+function PMA_set_enc_form($spaces)
+{
return "\n"
/* l10n: This is currently used only in Japanese locales */
. $spaces . '<ul>' . "\n" . '<li>'
diff --git a/libraries/logging.lib.php b/libraries/logging.lib.php
index 1dabc9a118..e58f96de48 100644
--- a/libraries/logging.lib.php
+++ b/libraries/logging.lib.php
@@ -11,7 +11,8 @@
/**
* Logs user information to webserver logs.
*/
-function PMA_log_user($user, $status = 'ok') {
+function PMA_log_user($user, $status = 'ok')
+{
if (function_exists('apache_note')) {
apache_note('userID', $user);
apache_note('userStatus', $status);
diff --git a/libraries/mime.lib.php b/libraries/mime.lib.php
index b8d035a7b5..f394b8fcfd 100644
--- a/libraries/mime.lib.php
+++ b/libraries/mime.lib.php
@@ -10,7 +10,8 @@
/**
* Tries to detect MIME type of content.
*/
-function PMA_detectMIME(&$test) {
+function PMA_detectMIME(&$test)
+{
$len = strlen($test);
if ($len >= 2 && $test[0] == chr(0xff) && $test[1] == chr(0xd8)) {
return 'image/jpeg';
diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php
index fc6b18fe87..4eec97eb2b 100644
--- a/libraries/mysql_charsets.lib.php
+++ b/libraries/mysql_charsets.lib.php
@@ -145,7 +145,8 @@ function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION,
return $return_str;
}
-function PMA_generateCharsetQueryPart($collation) {
+function PMA_generateCharsetQueryPart($collation)
+{
list($charset) = explode('_', $collation);
return ' CHARACTER SET ' . $charset . ($charset == $collation ? '' : ' COLLATE ' . $collation);
}
@@ -156,7 +157,8 @@ function PMA_generateCharsetQueryPart($collation) {
* @param string $db name of db
* @return string collation of $db
*/
-function PMA_getDbCollation($db) {
+function PMA_getDbCollation($db)
+{
if ($db == 'information_schema') {
// We don't have to check the collation of the virtual
// information_schema database: We know it!
@@ -181,7 +183,8 @@ function PMA_getDbCollation($db) {
*
* @return string $server_collation
*/
-function PMA_getServerCollation() {
+function PMA_getServerCollation()
+{
return PMA_DBI_fetch_value(
'SHOW VARIABLES LIKE \'collation_server\'', 0, 1);
}
@@ -193,7 +196,8 @@ function PMA_getServerCollation() {
* @param string $collation MySQL collation string
* @return string collation description
*/
-function PMA_getCollationDescr($collation) {
+function PMA_getCollationDescr($collation)
+{
if ($collation == 'binary') {
return __('Binary');
}
diff --git a/libraries/opendocument.lib.php b/libraries/opendocument.lib.php
index 4af590aee9..c161f22a01 100644
--- a/libraries/opendocument.lib.php
+++ b/libraries/opendocument.lib.php
@@ -30,7 +30,8 @@ $GLOBALS['OpenDocumentNS'] = 'xmlns:office="urn:oasis:names:tc:opendocument:xmln
*
* @access public
*/
-function PMA_createOpenDocument($mime, $data) {
+function PMA_createOpenDocument($mime, $data)
+{
$zipfile = new zipfile();
$zipfile -> addFile($mime, 'mimetype');
$zipfile -> addFile($data, 'content.xml');
diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php
index 3534840afe..c24c2491e7 100644
--- a/libraries/relation.lib.php
+++ b/libraries/relation.lib.php
@@ -1071,7 +1071,8 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
* @param string $query_default_option
* @return string $pdf_page_number
*/
-function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option) {
+function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option)
+{
if (! isset($newpage) || $newpage == '') {
$newpage = __('no description');
}
diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php
index 36e656c457..7327075688 100644
--- a/libraries/replication.inc.php
+++ b/libraries/replication.inc.php
@@ -140,7 +140,8 @@ foreach ($replication_types as $type) {
* @param $what what to extract (db|table)
* @return $string the extracted part
*/
-function PMA_extract_db_or_table($string, $what = 'db') {
+function PMA_extract_db_or_table($string, $what = 'db')
+{
$list = explode(".", $string);
if ('db' == $what) {
return $list[0];
@@ -155,7 +156,8 @@ function PMA_extract_db_or_table($string, $what = 'db') {
*
* @return mixed output of PMA_DBI_try_query
*/
-function PMA_replication_slave_control($action, $control = null, $link = null) {
+function PMA_replication_slave_control($action, $control = null, $link = null)
+{
$action = strtoupper($action);
$control = strtoupper($control);
@@ -180,7 +182,8 @@ function PMA_replication_slave_control($action, $control = null, $link = null) {
*
* @return output of CHANGE MASTER mysql command
*/
-function PMA_replication_slave_change_master($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null) {
+function PMA_replication_slave_change_master($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null)
+{
if ($stop) {
PMA_replication_slave_control("STOP", null, $link);
}
@@ -211,7 +214,8 @@ function PMA_replication_slave_change_master($user, $password, $host, $port, $po
*
* @return mixed $link mysql link on success
*/
-function PMA_replication_connect_to_master($user, $password, $host = null, $port = null, $socket = null) {
+function PMA_replication_connect_to_master($user, $password, $host = null, $port = null, $socket = null)
+{
$server = array();
$server["host"] = $host;
$server["port"] = $port;
@@ -226,7 +230,8 @@ function PMA_replication_connect_to_master($user, $password, $host = null, $port
*
* @return array - containing File and Position in MySQL replication on master server, useful for PMA_replication_slave_change_master
*/
-function PMA_replication_slave_bin_log_master($link = null) {
+function PMA_replication_slave_bin_log_master($link = null)
+{
$data = PMA_DBI_fetch_result('SHOW MASTER STATUS', null, null, $link);
$output = array();
@@ -245,7 +250,8 @@ function PMA_replication_slave_bin_log_master($link = null) {
* @return array array of replicated databases
*/
-function PMA_replication_master_replicated_dbs($link = null) {
+function PMA_replication_master_replicated_dbs($link = null)
+{
$data = PMA_DBI_fetch_result('SHOW MASTER STATUS', null, null, $link); // let's find out, which databases are replicated
$do_db = array();
@@ -287,7 +293,8 @@ function PMA_replication_master_replicated_dbs($link = null) {
* @param boolean $data - if true, then data will be copied as well
*/
-function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true) {
+function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true)
+{
$src_db = $trg_db = $db;
$src_connection = PMA_DBI_select_db($src_db, $src_link);
diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php
index 3e8e6877df..91b284f189 100644
--- a/libraries/replication_gui.lib.php
+++ b/libraries/replication_gui.lib.php
@@ -43,7 +43,8 @@ function PMA_replication_db_multibox()
* @param String $submitname - submit button name
*/
-function PMA_replication_gui_changemaster($submitname) {
+function PMA_replication_gui_changemaster($submitname)
+{
list($username_length, $hostname_length) = PMA_replication_get_username_hostname_length();
@@ -84,7 +85,8 @@ function PMA_replication_gui_changemaster($submitname) {
* @param boolean $hidden - if true, then default style is set to hidden, default value false
* @param boolen $title - if true, then title is displayed, default true
*/
-function PMA_replication_print_status_table($type, $hidden = false, $title = true) {
+function PMA_replication_print_status_table($type, $hidden = false, $title = true)
+{
global ${"{$type}_variables"};
global ${"{$type}_variables_alerts"};
global ${"{$type}_variables_oks"};
@@ -162,7 +164,8 @@ function PMA_replication_print_status_table($type, $hidden = false, $title = tru
*
* @param boolean $hidden - if true, then default style is set to hidden, default value false
*/
-function PMA_replication_print_slaves_table($hidden = false) {
+function PMA_replication_print_slaves_table($hidden = false)
+{
// Fetch data
$data = PMA_DBI_fetch_result('SHOW SLAVE HOSTS', null, null);
@@ -202,7 +205,8 @@ function PMA_replication_print_slaves_table($hidden = false) {
* @return array username length, hostname length
*/
-function PMA_replication_get_username_hostname_length() {
+function PMA_replication_get_username_hostname_length()
+{
$fields_info = PMA_DBI_get_columns('mysql', 'user');
$username_length = 16;
$hostname_length = 41;
@@ -227,7 +231,8 @@ function PMA_replication_get_username_hostname_length() {
/**
* Print code to add a replication slave user to the master
*/
-function PMA_replication_gui_master_addslaveuser() {
+function PMA_replication_gui_master_addslaveuser()
+{
list($username_length, $hostname_length) = PMA_replication_get_username_hostname_length();
diff --git a/libraries/select_lang.lib.php b/libraries/select_lang.lib.php
index 284fdbef85..a3627b1ea5 100644
--- a/libraries/select_lang.lib.php
+++ b/libraries/select_lang.lib.php
@@ -12,7 +12,8 @@ if (! defined('PHPMYADMIN')) {
/**
* Returns language name
*/
-function PMA_langName($tmplang) {
+function PMA_langName($tmplang)
+{
$lang_name = ucfirst(substr(strrchr($tmplang[0], '|'), 1));
// Include native name if non empty
@@ -182,7 +183,8 @@ function PMA_langDetect($str, $envType)
* example.
*
*/
-function PMA_langDetails($lang) {
+function PMA_langDetails($lang)
+{
switch ($lang) {
case 'af':
return array('af|afrikaans', 'af', '');
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 5ddd07a8d3..1edbb83c1f 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -1261,7 +1261,8 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
*
* @param string $query the query to display
*/
-function PMA_displayQuery($query) {
+function PMA_displayQuery($query)
+{
if (strlen($query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
$query = substr($query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]';
}
@@ -1274,7 +1275,8 @@ function PMA_displayQuery($query) {
* @param string $src_db source db name
* @param string $trg_db target db name
*/
-function PMA_syncDisplayHeaderCompare($src_db, $trg_db) {
+function PMA_syncDisplayHeaderCompare($src_db, $trg_db)
+{
echo '<fieldset style="padding:0"><div style="padding:1.5em; overflow:auto; height:220px">';
echo '<table class="data">';
@@ -1309,7 +1311,8 @@ function PMA_syncDisplayHeaderCompare($src_db, $trg_db) {
*
* @param array $rows
*/
-function PMA_syncDisplayDataCompare($rows) {
+function PMA_syncDisplayDataCompare($rows)
+{
global $pmaThemeImage;
$odd_row = true;
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index 9172027599..9032ff9393 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -420,7 +420,8 @@ function PMA_sqlQueryFormBookmark()
*
* @usedby PMA_sqlQueryForm()
*/
-function PMA_sqlQueryFormUpload() {
+function PMA_sqlQueryFormUpload()
+{
$errors = array ();
$matcher = '@\.sql(\.(' . PMA_supportedDecompressions() . '))?$@'; // we allow only SQL here
diff --git a/libraries/sysinfo.lib.php b/libraries/sysinfo.lib.php
index 9bcc2dd783..c68725041b 100644
--- a/libraries/sysinfo.lib.php
+++ b/libraries/sysinfo.lib.php
@@ -1,15 +1,16 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
- * Library for extracting information about system memory and cpu. Currently supports all
+ * Library for extracting information about system memory and cpu. Currently supports all
* Windows and Linux plattforms
*
* This code is based on the OS Classes from the phpsysinfo project (http://phpsysinfo.sourceforge.net/)
- *
+ *
* @package phpMyAdmin
*/
-function getSysInfo() {
+function getSysInfo()
+{
$supported = array('Linux','WINNT');
$sysinfo = array();
@@ -17,14 +18,14 @@ function getSysInfo() {
if (in_array(PHP_OS, $supported)) {
return eval("return new ".PHP_OS."();");
}
-
+
return $sysinfo;
}
class WINNT {
private $_wmi;
-
+
public $os = 'WINNT';
public function __construct() {
@@ -37,20 +38,20 @@ class WINNT {
$loadavg = "";
$sum = 0;
$buffer = $this->_getWMI('Win32_Processor', array('LoadPercentage'));
-
+
foreach ($buffer as $load) {
$value = $load['LoadPercentage'];
$loadavg .= $value.' ';
$sum += $value;
}
-
+
return array('loadavg' => $sum / count($buffer));
}
-
+
private function _getWMI($strClass, $strValue = array()) {
$arrData = array();
$value = "";
-
+
$objWEBM = $this->_wmi->Get($strClass);
$arrProp = $objWEBM->Properties_;
$arrWEBMCol = $objWEBM->Instances_();
@@ -75,49 +76,49 @@ class WINNT {
return $arrData;
}
-
+
function memory() {
$buffer = $this->_getWMI("Win32_OperatingSystem", array('TotalVisibleMemorySize', 'FreePhysicalMemory'));
$mem = Array();
$mem['MemTotal'] = $buffer[0]['TotalVisibleMemorySize'];
$mem['MemFree'] = $buffer[0]['FreePhysicalMemory'];
$mem['MemUsed'] = $mem['MemTotal'] - $mem['MemFree'];
-
+
$buffer = $this->_getWMI('Win32_PageFileUsage');
-
+
$mem['SwapTotal'] = 0;
$mem['SwapUsed'] = 0;
$mem['SwapPeak'] = 0;
-
+
foreach ($buffer as $swapdevice) {
$mem['SwapTotal'] += $swapdevice['AllocatedBaseSize'] * 1024;
$mem['SwapUsed'] += $swapdevice['CurrentUsage'] * 1024;
$mem['SwapPeak'] += $swapdevice['PeakUsage'] * 1024;
}
-
+
return $mem;
}
}
class Linux {
public $os = 'Linux';
-
+
function loadavg() {
$buf = file_get_contents('/proc/stat');
$nums=preg_split("/\s+/", substr($buf,0,strpos($buf,"\n")));
return Array('busy' => $nums[1]+$nums[2]+$nums[3], 'idle' => intval($nums[4]));
}
-
+
function memory() {
preg_match_all('/^(MemTotal|MemFree|Cached|Buffers|SwapCached|SwapTotal|SwapFree):\s+(.*)\s*kB/im', file_get_contents('/proc/meminfo'), $matches);
-
+
$mem = array_combine( $matches[1], $matches[2] );
$mem['MemUsed'] = $mem['MemTotal'] - $mem['MemFree'] - $mem['Cached'] - $mem['Buffers'];
$mem['SwapUsed'] = $mem['SwapTotal'] - $mem['SwapFree'] - $mem['SwapCached'];
-
- foreach ($mem as $idx=>$value)
+
+ foreach ($mem as $idx=>$value)
$mem[$idx] = intval($value);
-
+
return $mem;
}
}
diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php
index 5b099cf498..3a4bf96503 100644
--- a/libraries/tbl_properties.inc.php
+++ b/libraries/tbl_properties.inc.php
@@ -670,7 +670,8 @@ if ($display_type == 'horizontal') {
// <![CDATA[
var odd_row = <?php echo $odd_row; ?>;
-function addField() {
+function addField()
+{
var new_fields = document.getElementById('added_fields').value;
var new_field_container = document.getElementById('table_columns');
var new_field = '<?php echo preg_replace('|\s+|', ' ', preg_replace('|\'|', '\\\'', $new_field)); ?>';
diff --git a/libraries/transformations/TEMPLATE b/libraries/transformations/TEMPLATE
index 50433d699c..fb4506e4de 100644
--- a/libraries/transformations/TEMPLATE
+++ b/libraries/transformations/TEMPLATE
@@ -11,13 +11,15 @@
* extension. For further information regarding naming conventions see the /Documentation.html file.
*/
-function PMA_transformation_[ENTER_FILENAME_HERE]_info() {
+function PMA_transformation_[ENTER_FILENAME_HERE]_info()
+{
return array(
'info' => __('Description of the transformation.'),
);
}
-function PMA_transformation_[ENTER_FILENAME_HERE]($buffer, $options = array(), $meta = '') {
+function PMA_transformation_[ENTER_FILENAME_HERE]($buffer, $options = array(), $meta = '')
+{
// possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php');
diff --git a/libraries/transformations/application_octetstream__download.inc.php b/libraries/transformations/application_octetstream__download.inc.php
index 4b9d5d185d..55fae19cc6 100644
--- a/libraries/transformations/application_octetstream__download.inc.php
+++ b/libraries/transformations/application_octetstream__download.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_application_octetstream__download_info() {
+function PMA_transformation_application_octetstream__download_info()
+{
return array(
'info' => __('Displays a link to download the binary data of the column. You can use the first option to specify the filename, or use the second option as the name of a column which contains the filename. If you use the second option, you need to set the first option to the empty string.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_application_octetstream__download_info() {
/**
*
*/
-function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '') {
+function PMA_transformation_application_octetstream__download(&$buffer, $options = array(), $meta = '')
+{
global $row, $fields_meta;
if (isset($options[0]) && !empty($options[0])) {
diff --git a/libraries/transformations/application_octetstream__hex.inc.php b/libraries/transformations/application_octetstream__hex.inc.php
index f5050ce48d..06eced41c3 100644
--- a/libraries/transformations/application_octetstream__hex.inc.php
+++ b/libraries/transformations/application_octetstream__hex.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_application_octetstream__hex_info() {
+function PMA_transformation_application_octetstream__hex_info()
+{
return array(
'info' => __('Displays hexadecimal representation of data. Optional first parameter specifies how often space will be added (defaults to 2 nibbles).'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_application_octetstream__hex_info() {
/**
*
*/
-function PMA_transformation_application_octetstream__hex($buffer, $options = array(), $meta = '') {
+function PMA_transformation_application_octetstream__hex($buffer, $options = array(), $meta = '')
+{
// possibly use a global transform and feed it with special options:
// include './libraries/transformations/global.inc.php';
if (!isset($options[0])) {
diff --git a/libraries/transformations/global.inc.php b/libraries/transformations/global.inc.php
index 120eed15cc..76ef2dee2b 100644
--- a/libraries/transformations/global.inc.php
+++ b/libraries/transformations/global.inc.php
@@ -25,15 +25,18 @@
/**
*
*/
-function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
+function PMA_transformation_global_plain($buffer, $options = array(), $meta = '')
+{
return htmlspecialchars($buffer);
}
-function PMA_transformation_global_html($buffer, $options = array(), $meta = '') {
+function PMA_transformation_global_html($buffer, $options = array(), $meta = '')
+{
return $buffer;
}
-function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '') {
+function PMA_transformation_global_html_replace($buffer, $options = array(), $meta = '')
+{
if (!isset($options['string'])) {
$options['string'] = '';
}
diff --git a/libraries/transformations/image_jpeg__inline.inc.php b/libraries/transformations/image_jpeg__inline.inc.php
index d4312aaf5e..4ff1e72ca7 100644
--- a/libraries/transformations/image_jpeg__inline.inc.php
+++ b/libraries/transformations/image_jpeg__inline.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_image_jpeg__inline_info() {
+function PMA_transformation_image_jpeg__inline_info()
+{
return array(
'info' => __('Displays a clickable thumbnail. The options are the maximum width and height in pixels. The original aspect ratio is preserved.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_image_jpeg__inline_info() {
/**
*
*/
-function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
+function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '')
+{
require_once './libraries/transformations/global.inc.php';
if (PMA_IS_GD2) {
diff --git a/libraries/transformations/image_jpeg__link.inc.php b/libraries/transformations/image_jpeg__link.inc.php
index 0d0b9a393e..8988dd72be 100644
--- a/libraries/transformations/image_jpeg__link.inc.php
+++ b/libraries/transformations/image_jpeg__link.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_image_jpeg__link_info() {
+function PMA_transformation_image_jpeg__link_info()
+{
return array(
'info' => __('Displays a link to download this image.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_image_jpeg__link_info() {
/**
*
*/
-function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
+function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '')
+{
require_once './libraries/transformations/global.inc.php';
$transform_options = array ('string' => '<a href="transformation_wrapper.php' . $options['wrapper_link'] . '" alt="[__BUFFER__]">[BLOB]</a>');
diff --git a/libraries/transformations/image_png__inline.inc.php b/libraries/transformations/image_png__inline.inc.php
index 3655171f5c..5c9fc4b3ce 100644
--- a/libraries/transformations/image_png__inline.inc.php
+++ b/libraries/transformations/image_png__inline.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_image_png__inline_info() {
+function PMA_transformation_image_png__inline_info()
+{
return array(
'info' => __('Displays a clickable thumbnail. The options are the maximum width and height in pixels. The original aspect ratio is preserved.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_image_png__inline_info() {
/**
*
*/
-function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
+function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '')
+{
require_once './libraries/transformations/global.inc.php';
if (PMA_IS_GD2) {
diff --git a/libraries/transformations/text_plain__dateformat.inc.php b/libraries/transformations/text_plain__dateformat.inc.php
index 42a19a96d9..d7b7ab1787 100644
--- a/libraries/transformations/text_plain__dateformat.inc.php
+++ b/libraries/transformations/text_plain__dateformat.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__dateformat_info() {
+function PMA_transformation_text_plain__dateformat_info()
+{
return array(
'info' => __('Displays a TIME, TIMESTAMP, DATETIME or numeric unix timestamp column as formatted date. The first option is the offset (in hours) which will be added to the timestamp (Default: 0). Use second option to specify a different date/time format string. Third option determines whether you want to see local date or UTC one (use "local" or "utc" strings) for that. According to that, date format has different value - for "local" see the documentation for PHP\'s strftime() function and for "utc" it is done using gmdate() function.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__dateformat_info() {
/**
*
*/
-function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '')
+{
// possibly use a global transform and feed it with special options:
// include './libraries/transformations/global.inc.php';
diff --git a/libraries/transformations/text_plain__external.inc.php b/libraries/transformations/text_plain__external.inc.php
index 2ed3cdd131..d60551c1a3 100644
--- a/libraries/transformations/text_plain__external.inc.php
+++ b/libraries/transformations/text_plain__external.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__external_info() {
+function PMA_transformation_text_plain__external_info()
+{
return array(
'info' => __('LINUX ONLY: Launches an external application and feeds it the column data via standard input. Returns the standard output of the application. The default is Tidy, to pretty-print HTML code. For security reasons, you have to manually edit the file libraries/transformations/text_plain__external.inc.php and list the tools you want to make available. The first option is then the number of the program you want to use and the second option is the parameters for the program. The third option, if set to 1, will convert the output using htmlspecialchars() (Default 1). The fourth option, if set to 1, will prevent wrapping and ensure that the output appears all on one line (Default 1).'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__external_info() {
/**
*
*/
-function PMA_transformation_text_plain__external_nowrap($options = array()) {
+function PMA_transformation_text_plain__external_nowrap($options = array())
+{
if (!isset($options[3]) || $options[3] == '') {
$nowrap = true;
} elseif ($options[3] == '1' || $options[3] == 1) {
@@ -25,7 +27,8 @@ function PMA_transformation_text_plain__external_nowrap($options = array()) {
return $nowrap;
}
-function PMA_transformation_text_plain__external($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__external($buffer, $options = array(), $meta = '')
+{
// possibly use a global transform and feed it with special options:
// include './libraries/transformations/global.inc.php';
diff --git a/libraries/transformations/text_plain__formatted.inc.php b/libraries/transformations/text_plain__formatted.inc.php
index f251f29aa3..3b5e66b681 100644
--- a/libraries/transformations/text_plain__formatted.inc.php
+++ b/libraries/transformations/text_plain__formatted.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__formatted_info() {
+function PMA_transformation_text_plain__formatted_info()
+{
return array(
'info' => __('Displays the contents of the column as-is, without running it through htmlspecialchars(). That is, the column is assumed to contain valid HTML.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__formatted_info() {
/**
*
*/
-function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '')
+{
return $buffer;
}
diff --git a/libraries/transformations/text_plain__imagelink.inc.php b/libraries/transformations/text_plain__imagelink.inc.php
index b22c945f18..4148c1feb8 100644
--- a/libraries/transformations/text_plain__imagelink.inc.php
+++ b/libraries/transformations/text_plain__imagelink.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__imagelink_info() {
+function PMA_transformation_text_plain__imagelink_info()
+{
return array(
'info' => __('Displays an image and a link; the column contains the filename. The first option is a URL prefix like "http://www.example.com/". The second and third options are the width and the height in pixels.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__imagelink_info() {
/**
*
*/
-function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '')
+{
require_once './libraries/transformations/global.inc.php';
$transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" target="_blank"><img src="' . (isset($options[0]) ? $options[0] : '') . $buffer . '" border="0" width="' . (isset($options[1]) ? $options[1] : 100) . '" height="' . (isset($options[2]) ? $options[2] : 50) . '" />' . $buffer . '</a>');
diff --git a/libraries/transformations/text_plain__link.inc.php b/libraries/transformations/text_plain__link.inc.php
index 6a1ca6c3c9..4a807da545 100644
--- a/libraries/transformations/text_plain__link.inc.php
+++ b/libraries/transformations/text_plain__link.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__link_info() {
+function PMA_transformation_text_plain__link_info()
+{
return array(
'info' => __('Displays a link; the column contains the filename. The first option is a URL prefix like "http://www.example.com/". The second option is a title for the link.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__link_info() {
/**
*
*/
-function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '')
+{
require_once './libraries/transformations/global.inc.php';
// $transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . '%1$s" title="' . (isset($options[1]) ? $options[1] : '%1$s') . '">' . (isset($options[1]) ? $options[1] : '%1$s') . '</a>');
diff --git a/libraries/transformations/text_plain__longToIpv4.inc.php b/libraries/transformations/text_plain__longToIpv4.inc.php
index a6d31aad4c..4c95997cd8 100644
--- a/libraries/transformations/text_plain__longToIpv4.inc.php
+++ b/libraries/transformations/text_plain__longToIpv4.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__longToIpv4_info() {
+function PMA_transformation_text_plain__longToIpv4_info()
+{
return array(
'info' => __('Converts an (IPv4) Internet network address into a string in Internet standard dotted format.'),
);
diff --git a/libraries/transformations/text_plain__sql.inc.php b/libraries/transformations/text_plain__sql.inc.php
index afc2888629..2db5eccf87 100644
--- a/libraries/transformations/text_plain__sql.inc.php
+++ b/libraries/transformations/text_plain__sql.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__sql_info() {
+function PMA_transformation_text_plain__sql_info()
+{
return array(
'info' => __('Formats text as SQL query with syntax highlighting.'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__sql_info() {
/**
*
*/
-function PMA_transformation_text_plain__sql($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__sql($buffer, $options = array(), $meta = '')
+{
$result = PMA_SQP_formatHtml(PMA_SQP_parse($buffer));
// Need to clear error state not to break subsequent queries display.
PMA_SQP_resetError();
diff --git a/libraries/transformations/text_plain__substr.inc.php b/libraries/transformations/text_plain__substr.inc.php
index 67d45365b4..0ca19e2d51 100644
--- a/libraries/transformations/text_plain__substr.inc.php
+++ b/libraries/transformations/text_plain__substr.inc.php
@@ -4,7 +4,8 @@
* @package phpMyAdmin-Transformation
*/
-function PMA_transformation_text_plain__substr_info() {
+function PMA_transformation_text_plain__substr_info()
+{
return array(
'info' => __('Displays a part of a string. The first option is the number of characters to skip from the beginning of the string (Default 0). The second option is the number of characters to return (Default: until end of string). The third option is the string to append and/or prepend when truncation occurs (Default: "...").'),
);
@@ -13,7 +14,8 @@ function PMA_transformation_text_plain__substr_info() {
/**
*
*/
-function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
+function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '')
+{
// possibly use a global transform and feed it with special options:
// include './libraries/transformations/global.inc.php';
diff --git a/navigation.php b/navigation.php
index 0c5668bca7..dad2683fc9 100644
--- a/navigation.php
+++ b/navigation.php
@@ -331,7 +331,8 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
* @param integer $offset
* @param integer $count
*/
-function PMA_displayDbList($ext_dblist, $offset, $count) {
+function PMA_displayDbList($ext_dblist, $offset, $count)
+{
global $element_counter, $img_minus, $img_plus, $href_left,
$db_start, $common_url_query;
diff --git a/pmd/scripts/history.js b/pmd/scripts/history.js
index 7caeea93ab..d55d5b3b26 100644
--- a/pmd/scripts/history.js
+++ b/pmd/scripts/history.js
@@ -17,7 +17,8 @@ var g_index;
* @param index has value 1 or 0,decides wheter to hide toggle_container on load.
**/
-function panel(index) {
+function panel(index)
+{
if (!index) {
$(".toggle_container").hide();
}
@@ -40,7 +41,8 @@ function panel(index) {
*
**/
-function display(init,final) {
+function display(init,final)
+{
var str,i,j,k,sto;
// this part sorts the history array based on table name,this is needed for clubbing all object of same name together.
for (i = init;i < final;i++) {
@@ -99,7 +101,8 @@ function display(init,final) {
*
**/
-function and_or(index) {
+function and_or(index)
+{
if (history_array[index].get_and_or()) {
history_array[index].set_and_or(0);
}
@@ -118,7 +121,8 @@ function and_or(index) {
*
**/
-function detail (index) {
+function detail (index)
+{
var type = history_array[index].get_type();
var str;
if (type == "Where") {
@@ -158,7 +162,8 @@ function detail (index) {
*
**/
-function history_delete(index) {
+function history_delete(index)
+{
for(var k =0 ;k < from_array.length;k++){
if(from_array[k] == history_array[index].get_tab()){
from_array.splice(k,1);
@@ -178,7 +183,8 @@ function history_delete(index) {
*
**/
-function history_edit(index) {
+function history_edit(index)
+{
g_index = index;
var type = history_array[index].get_type();
if (type == "Where") {
@@ -225,7 +231,8 @@ function history_edit(index) {
* @param index index of history_array where change is to be made
**/
-function edit(type) {
+function edit(type)
+{
if (type == "Rename") {
if (document.getElementById('e_rename').value != "") {
history_array[g_index].get_obj().setrename_to(document.getElementById('e_rename').value);
@@ -271,7 +278,8 @@ function edit(type) {
*
**/
-function history(ncolumn_name,nobj,ntab,nobj_no,ntype) {
+function history(ncolumn_name,nobj,ntab,nobj_no,ntype)
+{
var and_or;
var obj;
var tab;
@@ -432,7 +440,8 @@ var aggregate = function(noperator) {
* @return unique array
*/
-function unique(arrayName) {
+function unique(arrayName)
+{
var newArray=new Array();
label:for(var i=0; i<arrayName.length;i++ )
{
@@ -454,7 +463,8 @@ function unique(arrayName) {
* @param value value which is to be searched in the array
*/
-function found(arrayName,value) {
+function found(arrayName,value)
+{
for(var i=0; i<arrayName.length; i++) {
if(arrayName[i] == value) { return 1;}
}
@@ -474,7 +484,8 @@ function found(arrayName,value) {
* @param fadin
*/
-function build_query(formtitle, fadin) {
+function build_query(formtitle, fadin)
+{
var q_select = "SELECT ";
var temp;
for(i = 0;i < select_field.length; i++) {
@@ -522,7 +533,8 @@ function build_query(formtitle, fadin) {
*/
-function query_from() {
+function query_from()
+{
var i =0;
var tab_left = [];
var tab_used = [];
@@ -608,7 +620,8 @@ function query_from() {
* @params add array elements of which are pushed in
* @params arr array in which elemnets are added
*/
-function add_array(add,arr){
+function add_array(add,arr)
+{
for( var i=0; i<add.length; i++){
arr.push(add[i]);
}
@@ -621,7 +634,8 @@ function add_array(add,arr){
* @params arr array from which elements are removed.
*
*/
-function remove_array(rem,arr){
+function remove_array(rem,arr)
+{
for(var i=0; i<rem.length; i++){
for(var j=0; j<arr.length; j++)
if(rem[i] == arr[j]) { arr.splice(j,1); }
@@ -634,7 +648,8 @@ function remove_array(rem,arr){
*
*/
-function query_groupby() {
+function query_groupby()
+{
var i = 0;
var str = "";
for(i; i < history_array.length;i++) {
@@ -649,7 +664,8 @@ function query_groupby() {
*
*/
-function query_having() {
+function query_having()
+{
var i = 0;
var and = "(";
for(i; i < history_array.length;i++) {
@@ -674,7 +690,8 @@ function query_having() {
*
*/
-function query_orderby() {
+function query_orderby()
+{
var i = 0;
var str = "" ;
for(i; i < history_array.length;i++) {
@@ -690,7 +707,8 @@ function query_orderby() {
*
*/
-function query_where(){
+function query_where()
+{
var i = 0;
var and = "(";
var or = "(";
@@ -721,7 +739,8 @@ function query_where(){
return and;
}
-function check_aggregate(id_this) {
+function check_aggregate(id_this)
+{
var i = 0;
for(i;i < history_array.length;i++) {
var temp = '`' + history_array[i].get_tab() + '`.`' +history_array[i].get_column_name() +'`';
@@ -732,7 +751,8 @@ function check_aggregate(id_this) {
return "";
}
-function check_rename(id_this) {
+function check_rename(id_this)
+{
var i = 0;
for (i;i < history_array.length;i++) {
var temp = '`' + history_array[i].get_tab() + '`.`' +history_array[i].get_column_name() +'`';
diff --git a/pmd/scripts/move.js b/pmd/scripts/move.js
index 71eb037209..b23a8f1aec 100644
--- a/pmd/scripts/move.js
+++ b/pmd/scripts/move.js
@@ -1092,7 +1092,8 @@ function Table_onover(id_this,val,buil)
* In case column is checked it add else it deletes
*
*/
-function store_column(id_this,owner,col) {
+function store_column(id_this,owner,col)
+{
var i = 0;
var k = 0;
if (document.getElementById('select_' + owner + '.' + id_this + '._' + col).checked == true) {
@@ -1128,7 +1129,8 @@ function store_column(id_this,owner,col) {
* @uses display()
**/
-function add_object() {
+function add_object()
+{
var rel = document.getElementById('rel_opt');
var sum = 0;
var init = history_array.length;
diff --git a/pmd_save_pos.php b/pmd_save_pos.php
index b95b20f4d3..c487ddb1ce 100644
--- a/pmd_save_pos.php
+++ b/pmd_save_pos.php
@@ -36,7 +36,8 @@ foreach ($t_x as $key => $value) {
}
//----------------------------------------------------------------------------
-function PMD_err_sav() {
+function PMD_err_sav()
+{
global $die_save_pos; // if this file included
if (! empty($die_save_pos)) {
header("Content-Type: text/xml; charset=utf-8");
diff --git a/scripts/openid.php b/scripts/openid.php
index 9a5eb67eda..911f69d046 100644
--- a/scripts/openid.php
+++ b/scripts/openid.php
@@ -31,7 +31,8 @@ $AUTH_MAP = array(
/**
* Simple function to show HTML page with given content.
*/
-function show_page($contents) {
+function show_page($contents)
+{
header('Content-Type: text/html; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
?>
diff --git a/scripts/signon-script.php b/scripts/signon-script.php
index 95efff2454..e57ca1f1f5 100644
--- a/scripts/signon-script.php
+++ b/scripts/signon-script.php
@@ -17,7 +17,8 @@
*
* It can optionally use configured username as parameter.
*/
-function get_login_credentials($user) {
+function get_login_credentials($user)
+{
return array('root', '');
}
diff --git a/server_privileges.php b/server_privileges.php
index 00073e84fa..2d7732c0ea 100644
--- a/server_privileges.php
+++ b/server_privileges.php
@@ -138,7 +138,8 @@ $random_n = mt_rand(0,1000000); // a random number that will be appended to the
* @param string $tablename Table name
* @return string the escaped (if necessary) database.table
*/
-function PMA_wildcardEscapeForGrant($dbname, $tablename) {
+function PMA_wildcardEscapeForGrant($dbname, $tablename)
+{
if (! strlen($dbname)) {
$db_and_table = '*.*';
diff --git a/server_status.php b/server_status.php
index 3e63cf2157..58922d15ea 100644
--- a/server_status.php
+++ b/server_status.php
@@ -776,7 +776,8 @@ echo __('Runtime Information');
<?php
-function printQueryStatistics() {
+function printQueryStatistics()
+{
global $server_status, $used_queries, $url_query, $PMA_PHP_SELF;
$hour_factor = 3600 / $server_status['Uptime'];
@@ -878,7 +879,8 @@ function printQueryStatistics() {
<?php
}
-function printServerTraffic() {
+function printServerTraffic()
+{
global $server_status,$PMA_PHP_SELF;
global $server_master_status, $server_slave_status, $replication_types;
@@ -1131,7 +1133,8 @@ function printServerTraffic() {
<?php
}
-function printVariablesTable() {
+function printVariablesTable()
+{
global $server_status, $server_variables, $allocationMap, $links;
/**
* Messages are built using the message name
@@ -1379,7 +1382,8 @@ function printVariablesTable() {
<?php
}
-function printMonitor() {
+function printMonitor()
+{
global $server_status, $server_db_isLocal;
?>
<div class="monitorLinks">
@@ -1577,7 +1581,8 @@ function printMonitor() {
}
/* Builds a <select> list for refresh rates */
-function refreshList($name,$defaultRate=5, $refreshRates=Array(1, 2, 5, 10, 20, 40, 60, 120, 300, 600)) {
+function refreshList($name,$defaultRate=5, $refreshRates=Array(1, 2, 5, 10, 20, 40, 60, 120, 300, 600))
+{
?>
<select name="<?php echo $name; ?>">
<?php
@@ -1599,7 +1604,8 @@ function refreshList($name,$defaultRate=5, $refreshRates=Array(1, 2, 5, 10, 20,
*
* @param array &$server_status
*/
-function cleanDeprecated(&$server_status) {
+function cleanDeprecated(&$server_status)
+{
$deprecated = array(
'Com_prepare_sql' => 'Com_stmt_prepare',
'Com_execute_sql' => 'Com_stmt_execute',
diff --git a/server_variables.php b/server_variables.php
index ceced1493e..8d5ea4703c 100644
--- a/server_variables.php
+++ b/server_variables.php
@@ -33,7 +33,7 @@ require './libraries/server_variables_doc.php';
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
// Send with correct charset
header('Content-Type: text/html; charset=UTF-8');
-
+
if (isset($_REQUEST['type'])) {
switch($_REQUEST['type']) {
case 'getval':
@@ -43,12 +43,12 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
case 'setval':
$value = PMA_sqlAddslashes($_REQUEST['varValue']);
if (!is_numeric($value)) $value="'".$value."'";
-
+
if (! preg_match("/[^a-zA-Z0-9_]+/",$_REQUEST['varName']) && PMA_DBI_query('SET GLOBAL '.$_REQUEST['varName'].' = '.$value))
// Some values are rounded down etc.
$varValue = PMA_DBI_fetch_single_row('SHOW GLOBAL VARIABLES WHERE Variable_name="'.PMA_sqlAddslashes($_REQUEST['varName']).'";','NUM');
-
- exit(json_encode(array(
+
+ exit(json_encode(array(
'success' => true,
'variable' => formatVariable($_REQUEST['varName'],$varValue[1])
))
@@ -149,9 +149,10 @@ foreach ($serverVars as $name => $value) {
*/
require './libraries/footer.inc.php';
-function formatVariable($name,$value) {
+function formatVariable($name,$value)
+{
global $VARIABLE_DOC_LINKS;
-
+
if (is_numeric($value)) {
if (isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte')
return '<abbr title="'.PMA_formatNumber($value, 0).'">'.implode(' ',PMA_formatByteDown($value,3,3)).'</abbr>';
diff --git a/setup/lib/form_processing.lib.php b/setup/lib/form_processing.lib.php
index d54fd807c6..10c368c0ef 100644
--- a/setup/lib/form_processing.lib.php
+++ b/setup/lib/form_processing.lib.php
@@ -11,7 +11,8 @@
*
* @param FormDisplay $form_display
*/
-function process_formset(FormDisplay $form_display) {
+function process_formset(FormDisplay $form_display)
+{
if (filter_input(INPUT_GET, 'mode') == 'revert') {
// revert erroneous fields to their default values
$form_display->fixErrors();
diff --git a/setup/scripts.js b/setup/scripts.js
index b4e97dc6b3..e39ccacfb9 100644
--- a/setup/scripts.js
+++ b/setup/scripts.js
@@ -120,7 +120,8 @@ $.extend(true, validators, {
* @param {String} id validator id
* @param {Object} values values hash {element1_id: value, ...}
*/
-function ajaxValidate(parent, id, values) {
+function ajaxValidate(parent, id, values)
+{
parent = $(parent);
// ensure that parent is a fieldset
if (parent.attr('tagName') != 'FIELDSET') {
@@ -192,4 +193,4 @@ $(function() {
//
// END: User preferences allow/disallow UI
-// ------------------------------------------------------------------ \ No newline at end of file
+// ------------------------------------------------------------------
diff --git a/themes.php b/themes.php
index 0e37ee4940..732f1e3082 100644
--- a/themes.php
+++ b/themes.php
@@ -22,7 +22,8 @@ require './libraries/header_meta_style.inc.php';
?>
<script type="text/javascript" language="javascript">
// <![CDATA[
-function takeThis(what) {
+function takeThis(what)
+{
if (window.opener && window.opener.document.forms['setTheme'].elements['set_theme']) {
window.opener.document.forms['setTheme'].elements['set_theme'].value = what;
window.opener.document.forms['setTheme'].submit();