Remove vague function
This commit is contained in:
parent
7ea4265554
commit
354c5e9773
@ -42,35 +42,6 @@ function PMA_getFormParametersForInsertForm($db, $table, $where_clauses,
|
||||
return $_form_params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the values for pma edit mode
|
||||
*
|
||||
* @param type $where_clause where clauses
|
||||
* @param type $table name of the table
|
||||
* @param type $db name of the database
|
||||
*
|
||||
* @return type containing insert_mode,whereClauses, result array
|
||||
* where_clauses_array and found_unique_key boolean value
|
||||
*/
|
||||
function PMA_getStuffForEditMode($where_clause, $table, $db)
|
||||
{
|
||||
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
|
||||
);
|
||||
return array(
|
||||
false, $whereClauses,
|
||||
$resultArray, $rowsArray,
|
||||
$where_clause_array, $found_unique_key
|
||||
);
|
||||
} else {
|
||||
list($results, $row) = PMA_loadFirstRowInEditMode($table, $db);
|
||||
return array(true, null, $results, $row, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates array of where clauses
|
||||
*
|
||||
|
||||
@ -148,12 +148,24 @@ $table_fields = array_values(PMA_DBI_get_columns($db, $table));
|
||||
|
||||
$paramTableDbArray = array($table, $db);
|
||||
|
||||
if (! isset($where_clause)) {
|
||||
/**
|
||||
* Determine what to do, edit or insert?
|
||||
*/
|
||||
if (isset($where_clause)) {
|
||||
// we are editing
|
||||
$insert_mode = false;
|
||||
$where_clause_array = PMA_getWhereClauseArray($where_clause);
|
||||
list($where_clauses, $result, $rows, $found_unique_key)
|
||||
= PMA_analyzeWhereClauses($where_clause_array, $table, $db);
|
||||
} else {
|
||||
// we are inserting
|
||||
$insert_mode = true;
|
||||
$where_clause = null;
|
||||
list($result, $rows) = PMA_loadFirstRowInEditMode($table, $db);
|
||||
$where_clauses = null;
|
||||
$where_clause_array = null;
|
||||
$found_unique_key = false;
|
||||
}
|
||||
//Retrieve values for data edit view
|
||||
list($insert_mode, $where_clauses, $result, $rows, $where_clause_array, $found_unique_key)
|
||||
= PMA_getStuffForEditMode($where_clause, $table, $db);
|
||||
|
||||
// Copying a row - fetched data will be inserted as a new row,
|
||||
// therefore the where clause is needless.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user