From 16962bc0d07a7a4f3059eac2cd5e1d71c7d5b229 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Tue, 30 Apr 2013 22:45:10 +0530 Subject: [PATCH 1/4] Remove trailing white spaces --- libraries/structure.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 5d843b6ce1..b2bb12ccc2 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1312,8 +1312,8 @@ function PMA_getHtmlForDropColumn($tbl_is_view, $db_is_information_schema, if (! $tbl_is_view && ! $db_is_information_schema) { $html_output .= '' . '' . $titles['Change'] . '' . ''; $html_output .= '' @@ -2212,12 +2212,12 @@ function PMA_getHtmlForDisplayTableStats($showtable, $table_info_num_rows, * @param string $db database name * @param string $table table name * @param array $selected the selected columns - * @param string $action target script to call + * @param string $action target script to call * * @return boolean $regenerate true if error occurred - * + * */ -function PMA_displayHtmlForColumnChange($db, $table, $selected, $action) +function PMA_displayHtmlForColumnChange($db, $table, $selected, $action) { // $selected comes from multi_submits.inc.php if (empty($selected)) { @@ -2234,12 +2234,12 @@ function PMA_displayHtmlForColumnChange($db, $table, $selected, $action) $fields_meta[] = PMA_DBI_get_columns($db, $table, $selected[$i], true); } $num_fields = count($fields_meta); - // set these globals because tbl_columns_definition_form.inc.php + // set these globals because tbl_columns_definition_form.inc.php // verifies them - // @todo: refactor tbl_columns_definition_form.inc.php so that it uses + // @todo: refactor tbl_columns_definition_form.inc.php so that it uses // function params $GLOBALS['action'] = 'tbl_structure.php'; - $GLOBALS['num_fields'] = $num_fields; + $GLOBALS['num_fields'] = $num_fields; // Get more complete field information. // For now, this is done to obtain MySQL 4.1.2+ new TIMESTAMP options From 623d47d64b6663cb271c45aa9b0757db98858ad4 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Tue, 30 Apr 2013 22:48:07 +0530 Subject: [PATCH 2/4] Make documentation comments compliant with PAER coding standards --- libraries/structure.lib.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index b2bb12ccc2..765c8ef6d8 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2209,12 +2209,12 @@ function PMA_getHtmlForDisplayTableStats($showtable, $table_info_num_rows, /** * Displays HTML for changing one or more columns * - * @param string $db database name - * @param string $table table name - * @param array $selected the selected columns - * @param string $action target script to call + * @param string $db database name + * @param string $table table name + * @param array $selected the selected columns + * @param string $action target script to call * - * @return boolean $regenerate true if error occurred + * @return boolean $regenerate true if error occurred * */ function PMA_displayHtmlForColumnChange($db, $table, $selected, $action) @@ -2271,8 +2271,8 @@ function PMA_displayHtmlForColumnChange($db, $table, $selected, $action) /** * Update the table's structure based on $_REQUEST * - * @param string $db database name - * @param string $table table name + * @param string $db database name + * @param string $table table name * * @return boolean $regenerate true if error occurred * @@ -2411,8 +2411,10 @@ function PMA_updateColumns($db, $table) /** * Moves columns in the table's structure based on $_REQUEST * - * @param string $db database name - * @param string $table table name + * @param string $db database name + * @param string $table table name + * + * @return void */ function PMA_moveColumns($db, $table) { From 6f03735e2e8434b48b2a918f476fcc8c5401a662 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Tue, 30 Apr 2013 22:48:55 +0530 Subject: [PATCH 3/4] Opening parenthesis of a multi-line function call must be the last content on the line --- libraries/structure.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 765c8ef6d8..7550fd2190 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2400,7 +2400,8 @@ function PMA_updateColumns($db, $table) } else { // An error happened while inserting/updating a table definition $response->isSuccess(false); - $response->addJSON('message', + $response->addJSON( + 'message', PMA_Message::rawError(__('Query error') . ':
'.PMA_DBI_getError()) ); $regenerate = true; From 7da8b1ae578e9e516562f134df7f0e6747b8f6f1 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Tue, 30 Apr 2013 22:51:09 +0530 Subject: [PATCH 4/4] Rename function name according to PEAR standards --- db_structure.php | 4 ++-- libraries/structure.lib.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db_structure.php b/db_structure.php index ed5a481518..5bbc0e6f2a 100644 --- a/db_structure.php +++ b/db_structure.php @@ -132,7 +132,7 @@ $response->addHTML( $response->addHTML(PMA_generate_common_hidden_inputs($db)); $response->addHTML( - PMA_TableHeader($db_is_information_schema, $server_slave_status) + PMA_tableHeader($db_is_information_schema, $server_slave_status) ); $i = $sum_entries = 0; @@ -263,7 +263,7 @@ foreach ($tables as $keyname => $current_table) { '' ); - $response->addHTML(PMA_TableHeader(false, $server_slave_status)); + $response->addHTML(PMA_tableHeader(false, $server_slave_status)); } list($do, $ignored) = PMA_getServerSlaveStatus( diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 7550fd2190..3bdf0c1e6a 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -740,7 +740,7 @@ function PMA_getHtmlForRepairtable( * * @return html data */ -function PMA_TableHeader($db_is_information_schema = false, $replication = false) +function PMA_tableHeader($db_is_information_schema = false, $replication = false) { $cnt = 0; // Let's count the columns...