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:
authorSpun Nakandala <supun.nakandala@gmail.com>2013-04-16 22:36:29 +0400
committerSpun Nakandala <supun.nakandala@gmail.com>2013-04-16 22:36:29 +0400
commit68d799ac2004b5590794a2c5dd4adecaecc43ddb (patch)
tree43cdc576263cdc7d0510e10e2f4f6a55fa428cd1 /tbl_addfield.php
parenta9e12ddec72473c1b126f6a13a7b1323d75fceff (diff)
Corrected according to the pear coding standards
Diffstat (limited to 'tbl_addfield.php')
-rw-r--r--tbl_addfield.php42
1 files changed, 27 insertions, 15 deletions
diff --git a/tbl_addfield.php b/tbl_addfield.php
index 5cc6a30d01..83afb79e37 100644
--- a/tbl_addfield.php
+++ b/tbl_addfield.php
@@ -1,6 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
+ * Displays add field form and handles it
*
* @package PhpMyAdmin
*/
@@ -72,7 +73,9 @@ if (isset($_REQUEST['do_save_data'])) {
// Builds the field creation statement and alters the table
for ($i = 0; $i < $field_cnt; ++$i) {
// '0' is also empty for php :-(
- if (empty($_REQUEST['field_name'][$i]) && $_REQUEST['field_name'][$i] != '0') {
+ if (empty($_REQUEST['field_name'][$i])
+ && $_REQUEST['field_name'][$i] != '0'
+ ) {
continue;
}
@@ -83,19 +86,19 @@ if (isset($_REQUEST['do_save_data'])) {
$_REQUEST['field_length'][$i],
$_REQUEST['field_attribute'][$i],
isset($_REQUEST['field_collation'][$i])
- ? $_REQUEST['field_collation'][$i]
- : '',
+ ? $_REQUEST['field_collation'][$i]
+ : '',
isset($_REQUEST['field_null'][$i])
- ? $_REQUEST['field_null'][$i]
- : 'NOT NULL',
+ ? $_REQUEST['field_null'][$i]
+ : 'NOT NULL',
$_REQUEST['field_default_type'][$i],
$_REQUEST['field_default_value'][$i],
isset($_REQUEST['field_extra'][$i])
- ? $_REQUEST['field_extra'][$i]
- : false,
+ ? $_REQUEST['field_extra'][$i]
+ : false,
isset($_REQUEST['field_comments'][$i])
- ? $_REQUEST['field_comments'][$i]
- : '',
+ ? $_REQUEST['field_comments'][$i]
+ : '',
$field_primary
);
@@ -105,10 +108,12 @@ if (isset($_REQUEST['do_save_data'])) {
if ($_REQUEST['field_where'] == 'first') {
$definition .= ' FIRST';
} else {
- $definition .= ' AFTER ' . PMA_Util::backquote($_REQUEST['after_field']);
+ $definition .= ' AFTER '
+ . PMA_Util::backquote($_REQUEST['after_field']);
}
} else {
- $definition .= ' AFTER ' . PMA_Util::backquote($_REQUEST['field_name'][$i-1]);
+ $definition .= ' AFTER '
+ . PMA_Util::backquote($_REQUEST['field_name'][$i-1]);
}
}
$definitions[] = $definition;
@@ -156,8 +161,12 @@ if (isset($_REQUEST['do_save_data'])) {
// To allow replication, we first select the db to use and then run queries
// on this db.
- PMA_DBI_select_db($db) or PMA_Util::mysqlDie(PMA_DBI_getError(), 'USE ' . PMA_Util::backquote($db), '', $err_url);
- $sql_query = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ' . implode(', ', $definitions) . ';';
+ PMA_DBI_select_db($db)
+ or PMA_Util::mysqlDie(
+ PMA_DBI_getError(), 'USE ' . PMA_Util::backquote($db), '', $err_url
+ );
+ $sql_query = 'ALTER TABLE ' .
+ PMA_Util::backquote($table) . ' ' . implode(', ', $definitions) . ';';
$result = PMA_DBI_try_query($sql_query);
if ($result === true) {
@@ -185,7 +194,9 @@ if (isset($_REQUEST['do_save_data'])) {
}
// Go back to the structure sub-page
- $message = PMA_Message::success(__('Table %1$s has been altered successfully'));
+ $message = PMA_Message::success(
+ __('Table %1$s has been altered successfully')
+ );
$message->addParam($table);
if ($GLOBALS['is_ajax_request'] == true) {
@@ -208,7 +219,8 @@ if (isset($_REQUEST['do_save_data'])) {
}
// An error happened while inserting/updating a table definition.
// to prevent total loss of that data, we embed the form once again.
- // The variable $regenerate will be used to restore data in libraries/tbl_columns_definition_form.inc.php
+ // The variable $regenerate will be used to restore data in libraries/
+ // tbl_columns_definition_form.inc.php
$num_fields = $_REQUEST['orig_num_fields'];
if (isset($_REQUEST['orig_after_field'])) {
$_REQUEST['after_field'] = $_REQUEST['orig_after_field'];