diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 2f17f20db0..601d4ea534 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -54,12 +54,11 @@ function PMA_getFormParametersForInsertForm($db, $table, $where_clauses, */ function PMA_getStuffForEditMode($where_clause, $table, $db) { - $found_unique_key = false; if (isset($where_clause)) { $where_clause_array = PMA_getWhereClauseArray($where_clause); list($whereClauses, $resultArray, $rowsArray, $found_unique_key) = PMA_analyzeWhereClauses( - $where_clause_array, $table, $db, $found_unique_key + $where_clause_array, $table, $db, false ); return array( false, $whereClauses, @@ -68,7 +67,7 @@ function PMA_getStuffForEditMode($where_clause, $table, $db) ); } else { list($results, $row) = PMA_loadFirstRowInEditMode($table, $db); - return array(true, null, $results, $row, null, $found_unique_key); + return array(true, null, $results, $row, null, false); } } @@ -108,12 +107,12 @@ function PMA_analyzeWhereClauses( $where_clauses = array(); foreach ($where_clause_array as $key_id => $where_clause) { - $local_query = 'SELECT * FROM ' + $local_query = 'SELECT * FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . '.' . PMA_CommonFunctions::getInstance()->backquote($table) . ' WHERE ' . $where_clause . ';'; - $result[$key_id] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE); - $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); + $result[$key_id] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE); + $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); $where_clauses[$key_id] = str_replace('\\', '\\\\', $where_clause); $found_unique_key = PMA_showEmptyResultMessageOrSetUniqueCondition( @@ -481,14 +480,14 @@ function PMA_getFunctionColumn($column, $is_upload, $column_name_appendix, || strstr($column['True_Type'], 'set') || in_array($column['pma_type'], $no_support_types) ) { - $html_output .= ' --' . "\n"; + $html_output .= '--' . "\n"; } else { $html_output .= '' . "\n"; - $html_output .= ''; $html_output .= PMA_CommonFunctions::getInstance() ->getFunctionsForField($column, $insert_mode) . "\n"; @@ -737,14 +736,18 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix, list($db, $table) = $paramTableDbArray; $html_output = ''; $html_output .= $backup_field . "\n"; + $html_output .= ''; - $html_output .= '' - . ''; + + $html_output .= '' - . ''; + + $html_output .= ''; return $html_output; } @@ -820,18 +826,18 @@ function PMA_getTextarea($column, $backup_field, $column_name_appendix, } elseif ($GLOBALS['cfg']['LongtextDoubleTextarea'] && strstr($column['pma_type'], 'longtext') ) { - $textAreaRows = $GLOBALS['cfg']['TextareaRows']*2; - $textareaCols = $GLOBALS['cfg']['TextareaCols']*2; + $textAreaRows = $GLOBALS['cfg']['TextareaRows'] * 2; + $textareaCols = $GLOBALS['cfg']['TextareaCols'] * 2; } $html_output = $backup_field . "\n" . ''; @@ -903,9 +909,9 @@ function PMA_getColumnEnumValues($column, $extracted_columnspec) // Removes automatic MySQL escape format $val = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $val)); $column['values'][] = array( - 'plain' => $val, - 'html' => htmlspecialchars($val), - ); + 'plain' => $val, + 'html' => htmlspecialchars($val), + ); } return $column['values']; } @@ -929,14 +935,13 @@ function PMA_getDropDownDependingOnLength( $tabindex, $tabindex_for_value, $idindex, $data, $column_enum_values ) { $html_output = ''; + . ' class="textfield"' + . ' size="' . $select_size . '"' + . ' multiple="multiple"' + . ' ' . $unnullify_trigger + . ' tabindex="' . ($tabindex + $tabindex_for_value) . '"' + . ' id="field_' . ($idindex) . '_3">'; foreach ($column_set_values as $column_set_value) { - $html_output .= ' '; $html_output .= '