From 334b268f50d28c5100dc95c0d12d1c0eff49019e Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 7 Dec 2011 22:16:53 +0530 Subject: [PATCH 1/4] Coding style improvements - Correct indenting --- js/functions.js | 22 +++++++++++----------- js/tbl_structure.js | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/js/functions.js b/js/functions.js index 829ae58151..b51ef7ce14 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2722,17 +2722,17 @@ $(document).ready(function() { }); // slider for choosing how many fields to add $enum_editor_dialog.find(".slider").slider({ - animate: true, - range: "min", - value: 1, - min: 1, - max: 9, - slide: function( event, ui ) { - $(this).closest('table').find('input[type=submit]').val( - PMA_messages['enum_addValue'].replace(/%d/, ui.value) - ); - } - }); + animate: true, + range: "min", + value: 1, + min: 1, + max: 9, + slide: function( event, ui ) { + $(this).closest('table').find('input[type=submit]').val( + PMA_messages['enum_addValue'].replace(/%d/, ui.value) + ); + } + }); // Focus the slider, otherwise it looks nearly transparent $('.ui-slider-handle').addClass('ui-state-focus'); return false; diff --git a/js/tbl_structure.js b/js/tbl_structure.js index c9fd93bf13..651cab00c0 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -301,16 +301,16 @@ $(document).ready(function() { PMA_convertFootnotesToTooltips($div); // Add a slider for selecting how many columns to add to the index $div.find('.slider').slider({ - animate: true, - value: 1, - min: 1, - max: 16, - slide: function( event, ui ) { + animate: true, + value: 1, + min: 1, + max: 16, + slide: function( event, ui ) { $(this).closest('fieldset').find('input[type=submit]').val( PMA_messages['strAddToIndex'].replace(/%d/, ui.value) ); - } - }); + } + }); // Focus the slider, otherwise it looks nearly transparent $('.ui-slider-handle').addClass('ui-state-focus'); } From a7c00f719f1ba7725db25aa66741536dceb2ead2 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 7 Dec 2011 22:45:13 +0530 Subject: [PATCH 2/4] Coding style improvements - Control structures --- enum_editor.php | 6 +- libraries/auth/swekey/swekey.auth.lib.php | 5 +- libraries/auth/swekey/swekey.php | 102 ++++++++++------------ 3 files changed, 51 insertions(+), 62 deletions(-) diff --git a/enum_editor.php b/enum_editor.php index 143d3c436c..10e0ba30a9 100644 --- a/enum_editor.php +++ b/enum_editor.php @@ -36,13 +36,15 @@ require_once './libraries/header_meta_style.inc.php'; $value) { $values[$key] = htmlentities($value); } - } else if (isset($_GET['values']) && is_string($_GET['values'])){ // If the values are in a string + // If the values are in a string + } elseif (isset($_GET['values']) && is_string($_GET['values'])) { // then this page was called via a link from some external page $values_string = htmlentities($_GET['values']); // There is a JS port of the below parser in functions.js diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php index f7299d1701..78356fa97a 100644 --- a/libraries/auth/swekey/swekey.auth.lib.php +++ b/libraries/auth/swekey/swekey.auth.lib.php @@ -161,12 +161,11 @@ function Swekey_auth_error() } } else { $result = __('No valid authentication key plugged'); - if ($_SESSION['SWEKEY']['CONF_DEBUG']) - { + if ($_SESSION['SWEKEY']['CONF_DEBUG']) { $result .= "
" . htmlspecialchars($swekey_id); } unset($_SESSION['SWEKEY']['CONF_LOADED']); // reload the conf file - } + } } } else { unset($_SESSION['SWEKEY']); diff --git a/libraries/auth/swekey/swekey.php b/libraries/auth/swekey/swekey.php index 453437eea5..3c6bd8079a 100644 --- a/libraries/auth/swekey/swekey.php +++ b/libraries/auth/swekey/swekey.php @@ -187,33 +187,28 @@ function Swekey_HttpGet($url, &$response_code) $gSwekeyLastResult = ""; // use curl if available - if (function_exists('curl_init')) - { + if (function_exists('curl_init')) { $sess = curl_init($url); - if (substr($url, 0, 8) == "https://") - { + if (substr($url, 0, 8) == "https://") { global $gSwekeyCA; - if (! empty($gSwekeyCA)) - { - if (file_exists($gSwekeyCA)) - { - if (! curl_setopt($sess, CURLOPT_CAINFO, $gSwekeyCA)) + if (! empty($gSwekeyCA)) { + if (file_exists($gSwekeyCA)) { + if (! curl_setopt($sess, CURLOPT_CAINFO, $gSwekeyCA)) { error_log("SWEKEY_ERROR:Could not set CA file : ".curl_error($sess)); - else + } else { $caFileOk = true; - } - else + } + } else { error_log("SWEKEY_ERROR:Could not find CA file $gSwekeyCA getting $url"); + } } curl_setopt($sess, CURLOPT_SSL_VERIFYHOST, '2'); curl_setopt($sess, CURLOPT_SSL_VERIFYPEER, '2'); curl_setopt($sess, CURLOPT_CONNECTTIMEOUT, '20'); curl_setopt($sess, CURLOPT_TIMEOUT, '20'); - } - else - { + } else { curl_setopt($sess, CURLOPT_CONNECTTIMEOUT, '3'); curl_setopt($sess, CURLOPT_TIMEOUT, '5'); } @@ -224,18 +219,16 @@ function Swekey_HttpGet($url, &$response_code) $curlerr = curl_error($sess); curl_close($sess); - if ($response_code == 200) - { + if ($response_code == 200) { $gSwekeyLastResult = $res; return $res; } - if (! empty($response_code)) - { + if (! empty($response_code)) { $gSwekeyLastError = $response_code; error_log("SWEKEY_ERROR:Error $gSwekeyLastError ($curlerr) getting $url"); return ""; - } + } $response_code = 408; // Request Timeout $gSwekeyLastError = $response_code; @@ -244,28 +237,28 @@ function Swekey_HttpGet($url, &$response_code) } // use pecl_http if available - if (class_exists('HttpRequest')) - { + if (class_exists('HttpRequest')) { // retry if one of the server is down - for ($num=1; $num <= 3; $num++ ) - { + for ($num=1; $num <= 3; $num++ ) { $r = new HttpRequest($url); $options = array('timeout' => '3'); - if (substr($url, 0, 6) == "https:") - { + if (substr($url, 0, 6) == "https:") { $sslOptions = array(); $sslOptions['verifypeer'] = true; $sslOptions['verifyhost'] = true; $capath = __FILE__; $name = strrchr($capath, '/'); - if (empty($name)) // windows + // windows + if (empty($name)) { $name = strrchr($capath, '\\'); + } $capath = substr($capath, 0, strlen($capath) - strlen($name) + 1).'musbe-ca.crt'; - if (! empty($gSwekeyCA)) + if (! empty($gSwekeyCA)) { $sslOptions['cainfo'] = $gSwekeyCA; + } $options['ssl'] = $sslOptions; } @@ -304,8 +297,7 @@ function Swekey_HttpGet($url, &$response_code) global $http_response_header; $res = @file_get_contents($url); $response_code = substr($http_response_header[0], 9, 3); //HTTP/1.0 - if ($response_code == 200) - { + if ($response_code == 200) { $gSwekeyLastResult = $res; return $res; } @@ -355,51 +347,47 @@ function Swekey_GetFastHalfRndToken() $cachefile = ""; // We check if we have a valid RT is the session - if (isset($_SESSION['rnd-token-date'])) - if (time() - $_SESSION['rnd-token-date'] < 30) + if (isset($_SESSION['rnd-token-date'])) { + if (time() - $_SESSION['rnd-token-date'] < 30) { $res = $_SESSION['rnd-token']; + } + } // If not we try to get it from a temp file (PHP >= 5.2.1 only) - if (strlen($res) != 32 && $gSwekeyTokenCacheEnabled) - { - if (function_exists('sys_get_temp_dir')) - { + if (strlen($res) != 32 && $gSwekeyTokenCacheEnabled) { + if (function_exists('sys_get_temp_dir')) { $tempdir = sys_get_temp_dir(); $cachefile = $tempdir."/swekey-rnd-token-".get_current_user(); $modif = filemtime($cachefile); - if ($modif != false) - if (time() - $modif < 30) - { + if ($modif != false) { + if (time() - $modif < 30) { $res = @file_get_contents($cachefile); - if (strlen($res) != 32) - $res = ""; - else - { - $_SESSION['rnd-token'] = $res; - $_SESSION['rnd-token-date'] = $modif; - } + if (strlen($res) != 32) { + $res = ""; + } else { + $_SESSION['rnd-token'] = $res; + $_SESSION['rnd-token-date'] = $modif; + } } + } } - } + } - // If we don't have a valid RT here we have to get it from the server - if (strlen($res) != 32) - { + // If we don't have a valid RT here we have to get it from the server + if (strlen($res) != 32) { $res = substr(Swekey_GetHalfRndToken(), 0, 32); $_SESSION['rnd-token'] = $res; $_SESSION['rnd-token-date'] = time(); - if (! empty($cachefile)) - { + if (! empty($cachefile)) { // we unlink the file so no possible tempfile race attack unlink($cachefile); - $file = fopen($cachefile, "x"); - if ($file != false) - { - @fwrite($file, $res); + $file = fopen($cachefile, "x"); + if ($file != false) { + @fwrite($file, $res); @fclose($file); } } - } + } return $res."00000000000000000000000000000000"; } From 35b18e57a26331c3f4a124ca21b37f82b006faa6 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 7 Dec 2011 23:28:50 +0530 Subject: [PATCH 3/4] Coding style improvements - Multiline assignments --- browse_foreigners.php | 17 ++++--- db_search.php | 4 +- db_structure.php | 4 +- libraries/Config.class.php | 4 +- libraries/RecentTable.class.php | 16 +++--- libraries/StorageEngine.class.php | 4 +- libraries/Table.class.php | 4 +- libraries/database_interface.lib.php | 18 ++++--- libraries/export/latex.php | 68 ++++++++++++------------- libraries/export/odt.php | 44 ++++++++-------- libraries/gis/pma_gis_visualization.php | 4 +- libraries/import/csv.php | 8 +-- libraries/mysql_charsets.lib.php | 8 +-- libraries/pmd_common.php | 12 ++--- libraries/sqlparser.lib.php | 23 +++++---- libraries/tbl_properties.inc.php | 4 +- navigation.php | 4 +- server_privileges.php | 12 ++--- server_status.php | 12 ++--- tbl_change.php | 10 ++-- tbl_indexes.php | 4 +- tbl_replace.php | 38 +++++++------- 22 files changed, 166 insertions(+), 156 deletions(-) diff --git a/browse_foreigners.php b/browse_foreigners.php index 74e4e993ac..dd9979bc69 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -223,22 +223,23 @@ if (is_array($foreignData['disp_row'])) { $val_ordered_current_val = htmlspecialchars($val_ordered_current_val); $val_ordered_current_val_title = ''; } else { - $val_ordered_current_val_title = - htmlspecialchars($val_ordered_current_val); + $val_ordered_current_val_title + = htmlspecialchars($val_ordered_current_val); $val_ordered_current_val = htmlspecialchars( PMA_substr($val_ordered_current_val, 0, $cfg['LimitChars']) . '...' - ); + ); } if (PMA_strlen($key_ordered_current_val) <= $cfg['LimitChars']) { $key_ordered_current_val = htmlspecialchars($key_ordered_current_val); $key_ordered_current_val_title = ''; } else { - $key_ordered_current_val_title = - htmlspecialchars($key_ordered_current_val); - $key_ordered_current_val = - htmlspecialchars(PMA_substr($key_ordered_current_val, 0, - $cfg['LimitChars']) . '...'); + $key_ordered_current_val_title + = htmlspecialchars($key_ordered_current_val); + $key_ordered_current_val + = htmlspecialchars( + PMA_substr($key_ordered_current_val, 0, $cfg['LimitChars']) . '...' + ); } if (! empty($data)) { diff --git a/db_search.php b/db_search.php index 041242f222..68cb46302a 100644 --- a/db_search.php +++ b/db_search.php @@ -314,8 +314,8 @@ foreach ($tables_names_only as $each_table) { } // end while echo ' ' . "\n"; -$alter_select = - ' 1))) . '#db_search"' . ' onclick="setSelectOptions(\'db_search\', \'table_select[]\', true); return false;">' . __('Select All') . '' . ' / ' . ' $each_table) { // Show Summary if ($is_show_stats) { list($sum_formatted, $unit) = PMA_formatByteDown($sum_size, 3, 1); - list($overhead_formatted, $overhead_unit) = - PMA_formatByteDown($overhead_size, 3, 1); + list($overhead_formatted, $overhead_unit) + = PMA_formatByteDown($overhead_size, 3, 1); } ?> diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 2d4b97840d..8364a65677 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -958,8 +958,8 @@ class PMA_Config if (substr($pma_absolute_uri, 0, 7) != 'http://' && substr($pma_absolute_uri, 0, 8) != 'https://' ) { - $pma_absolute_uri = - ($is_https ? 'https' : 'http') + $pma_absolute_uri + = ($is_https ? 'https' : 'http') . ':' . (substr($pma_absolute_uri, 0, 2) == '//' ? '' : '//') . $pma_absolute_uri; } diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php index 1e858995a5..6642acb835 100644 --- a/libraries/RecentTable.class.php +++ b/libraries/RecentTable.class.php @@ -76,9 +76,9 @@ class PMA_RecentTable public function getFromDb() { // Read from phpMyAdmin database, if recent tables is not in session - $sql_query = - " SELECT `tables` FROM " . $this->pma_table . - " WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'"; + $sql_query + = " SELECT `tables` FROM " . $this->pma_table . + " WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'"; $row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query)); if (isset($row[0])) { @@ -91,15 +91,15 @@ class PMA_RecentTable /** * Save recent tables into phpMyAdmin database. * - * + * * @return true|PMA_Message */ public function saveToDb() { $username = $GLOBALS['cfg']['Server']['user']; - $sql_query = - " REPLACE INTO " . $this->pma_table . " (`username`, `tables`)" . - " VALUES ('" . $username . "', '" . PMA_sqlAddSlashes(json_encode($this->tables)) . "')"; + $sql_query + = " REPLACE INTO " . $this->pma_table . " (`username`, `tables`)" . + " VALUES ('" . $username . "', '" . PMA_sqlAddSlashes(json_encode($this->tables)) . "')"; $success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']); @@ -163,7 +163,7 @@ class PMA_RecentTable $html .= ''; - + return $html; } diff --git a/libraries/StorageEngine.class.php b/libraries/StorageEngine.class.php index 4f98a4a60f..b325935114 100644 --- a/libraries/StorageEngine.class.php +++ b/libraries/StorageEngine.class.php @@ -274,8 +274,8 @@ class PMA_StorageEngine if (!empty($storage_engines[$engine])) { $this->engine = $engine; $this->title = $storage_engines[$engine]['Engine']; - $this->comment = - (isset($storage_engines[$engine]['Comment']) + $this->comment + = (isset($storage_engines[$engine]['Comment']) ? $storage_engines[$engine]['Comment'] : ''); switch ($storage_engines[$engine]['Support']) { diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 16ccfc3905..a2db8b2075 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -1391,8 +1391,8 @@ class PMA_Table $max_rows = $GLOBALS['cfg']['Server']['MaxTableUiprefs']; if ($rows_count > $max_rows) { $num_rows_to_delete = $rows_count - $max_rows; - $sql_query = - ' DELETE FROM ' . $pma_table . + $sql_query + = ' DELETE FROM ' . $pma_table . ' ORDER BY last_update ASC' . ' LIMIT ' . $num_rows_to_delete; $success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']); diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index c356b903fc..a142249ccd 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -942,9 +942,12 @@ function PMA_DBI_get_columns_full($database = null, $table = null, $columns[$column_name]['TABLE_SCHEMA'] = $database; $columns[$column_name]['TABLE_NAME'] = $table; $columns[$column_name]['ORDINAL_POSITION'] = $ordinal_position; - $columns[$column_name]['DATA_TYPE'] = - substr($columns[$column_name]['COLUMN_TYPE'], 0, - strpos($columns[$column_name]['COLUMN_TYPE'], '(')); + $columns[$column_name]['DATA_TYPE'] + = substr( + $columns[$column_name]['COLUMN_TYPE'], + 0, + strpos($columns[$column_name]['COLUMN_TYPE'], '(') + ); /** * @todo guess CHARACTER_MAXIMUM_LENGTH from COLUMN_TYPE */ @@ -955,9 +958,12 @@ function PMA_DBI_get_columns_full($database = null, $table = null, $columns[$column_name]['CHARACTER_OCTET_LENGTH'] = null; $columns[$column_name]['NUMERIC_PRECISION'] = null; $columns[$column_name]['NUMERIC_SCALE'] = null; - $columns[$column_name]['CHARACTER_SET_NAME'] = - substr($columns[$column_name]['COLLATION_NAME'], 0, - strpos($columns[$column_name]['COLLATION_NAME'], '_')); + $columns[$column_name]['CHARACTER_SET_NAME'] + = substr( + $columns[$column_name]['COLLATION_NAME'], + 0, + strpos($columns[$column_name]['COLLATION_NAME'], '_') + ); $ordinal_position++; } diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 1dbe21a9ab..56523d2cd7 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -36,50 +36,50 @@ if (isset($plugin_list)) { ); /* what to dump (structure/data/both) */ - $plugin_list['latex']['options'][] = - array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')); - $plugin_list['latex']['options'][] = - array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); + $plugin_list['latex']['options'][] + = array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')); + $plugin_list['latex']['options'][] + = array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); $plugin_list['latex']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { - $plugin_list['latex']['options'][] = - array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'structure_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'structure_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'structure_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); if (!empty($GLOBALS['cfgRelation']['relation'])) { - $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); + $plugin_list['latex']['options'][] + = array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } - $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); + $plugin_list['latex']['options'][] + = array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); + $plugin_list['latex']['options'][] + = array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); } - $plugin_list['latex']['options'][] = - array('type' => 'end_group'); + $plugin_list['latex']['options'][] + = array('type' => 'end_group'); } /* Data */ - $plugin_list['latex']['options'][] = - array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); - $plugin_list['latex']['options'][] = - array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); - $plugin_list['latex']['options'][] = - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); - $plugin_list['latex']['options'][] = - array('type' => 'end_group'); + $plugin_list['latex']['options'][] + = array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); + $plugin_list['latex']['options'][] + = array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'data_caption', 'text' => __('Table caption'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'data_continued_caption', 'text' => __('Table caption (continued)'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'data_label', 'text' => __('Label key'), 'doc' => 'faq6_27'); + $plugin_list['latex']['options'][] + = array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); + $plugin_list['latex']['options'][] + = array('type' => 'end_group'); } else { /** diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 94a01fc123..35e633970f 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -28,38 +28,38 @@ if (isset($plugin_list)) { ); /* what to dump (structure/data/both) */ - $plugin_list['odt']['options'][] = - array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts'); - $plugin_list['odt']['options'][] = - array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); + $plugin_list['odt']['options'][] + = array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts'); + $plugin_list['odt']['options'][] + = array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); $plugin_list['odt']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { - $plugin_list['odt']['options'][] = - array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); + $plugin_list['odt']['options'][] + = array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options'), 'force' => 'data'); if (!empty($GLOBALS['cfgRelation']['relation'])) { - $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); + $plugin_list['odt']['options'][] + = array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } - $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); + $plugin_list['odt']['options'][] + = array('type' => 'bool', 'name' => 'comments', 'text' => __('Display comments')); if (!empty($GLOBALS['cfgRelation']['mimework'])) { - $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); + $plugin_list['odt']['options'][] + = array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); } - $plugin_list['odt']['options'][] = - array('type' => 'end_group'); + $plugin_list['odt']['options'][] + = array('type' => 'end_group'); } /* Data */ - $plugin_list['odt']['options'][] = - array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); - $plugin_list['odt']['options'][] = - array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); - $plugin_list['odt']['options'][] = - array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); - $plugin_list['odt']['options'][] = - array('type' => 'end_group'); + $plugin_list['odt']['options'][] + = array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'); + $plugin_list['odt']['options'][] + = array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')); + $plugin_list['odt']['options'][] + = array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')); + $plugin_list['odt']['options'][] + = array('type' => 'end_group'); } else { $GLOBALS['odt_buffer'] = ''; diff --git a/libraries/gis/pma_gis_visualization.php b/libraries/gis/pma_gis_visualization.php index f69d6d288f..32a5728e74 100644 --- a/libraries/gis/pma_gis_visualization.php +++ b/libraries/gis/pma_gis_visualization.php @@ -254,8 +254,8 @@ class PMA_GIS_Visualization { $this->init(); $scale_data = $this->_scaleDataSet($this->_data); - $output = - 'var options = {' + $output + = 'var options = {' . 'projection: new OpenLayers.Projection("EPSG:900913"),' . 'displayProjection: new OpenLayers.Projection("EPSG:4326"),' . 'units: "m",' diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 9d0e2aaa00..8d455f4219 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -34,12 +34,12 @@ if (isset($plugin_list)) { ); if ($plugin_param !== 'table') { - $plugin_list['csv']['options'][] = - array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')); + $plugin_list['csv']['options'][] + = array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')); } else { $hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.')); - $plugin_list['csv']['options'][] = - array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ') . PMA_showHint($hint)); + $plugin_list['csv']['options'][] + = array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ') . PMA_showHint($hint)); } $plugin_list['csv']['options'][] = array('type' => 'end_group'); diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index 83d7d77a1c..5af1bf7d50 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -47,8 +47,8 @@ if (! PMA_cacheExists('mysql_charsets', true)) { } //$mysql_collations_available[$row['Collation']] = ! isset($row['Compiled']) || $row['Compiled'] == 'Yes'; $mysql_collations_available[$row['COLLATION_NAME']] = true; - $mysql_charsets_available[$row['CHARACTER_SET_NAME']] = - !empty($mysql_charsets_available[$row['CHARACTER_SET_NAME']]) + $mysql_charsets_available[$row['CHARACTER_SET_NAME']] + = !empty($mysql_charsets_available[$row['CHARACTER_SET_NAME']]) || !empty($mysql_collations_available[$row['COLLATION_NAME']]); } PMA_DBI_free_result($res); @@ -118,8 +118,8 @@ function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION, if (!$mysql_charsets_available[$current_charset]) { continue; } - $current_cs_descr = - empty($mysql_charsets_descriptions[$current_charset]) + $current_cs_descr + = empty($mysql_charsets_descriptions[$current_charset]) ? $current_charset : $mysql_charsets_descriptions[$current_charset]; diff --git a/libraries/pmd_common.php b/libraries/pmd_common.php index 0a09d28687..d5f13e2e84 100644 --- a/libraries/pmd_common.php +++ b/libraries/pmd_common.php @@ -15,8 +15,8 @@ $GLOBALS['PMD']['STYLE'] = 'default'; $cfgRelation = PMA_getRelationsParam(); -$GLOBALS['script_display_field'] = - '