class InsertEdit

PhpMyAdmin\InsertEdit class

Properties

Template $template

Methods

__construct(DatabaseInterface $dbi)

Constructor

array
getFormParametersForInsertForm(string $db, string $table, array|null $where_clauses, array $where_clause_array, string $err_url)

Retrieve form parameters for insert/edit form

array
urlParamsInEditMode(array $url_params, array $where_clause_array, string|null $where_clause)

Add some url parameters

string
showTypeOrFunction(string $which, array $url_params, boolean $is_show)

Show type information or function selectors in Insert/Edit

boolean
isColumn(array $column, array $types)

check whether the column is of a certain type the goal is to ensure that types such as "enum('one','two','binary',.

string
getContinueInsertionForm(string $table, string $db, array $where_clause_array, string $err_url)

get html for continue insertion form

string
getActionsPanel(array|null $where_clause, string $after_insert, integer $tabindex, integer $tabindex_for_value, boolean $found_unique_key)

Get action panel

array
getParamsForUpdateOrInsert()

Prepares the update/insert of a row

void
isInsertRow()

Check wether insert row mode and if so include tbl_changen script and set global variables.

void
setSessionForEditNext(string $one_where_clause)

set $_SESSION for edit_next

string
getGotoInclude(string $goto_include)

set $goto_include variable for different cases and retrieve like, if $GLOBALS['goto'] empty, if $goto_include previously not defined and new_insert, same_insert, edit_next

string
getErrorUrl(array $url_params)

Defines the url to return in case of failure of the query

array
buildSqlQuery(boolean $is_insertignore, array $query_fields, array $value_sets)

Builds the sql query

array
executeSqlQuery(array $url_params, array $query)

Executes the sql query and get the result, then move back to the calling page

string
getDisplayValueForForeignTableColumn(string $where_comparison, array $map, string $relation_field)

Column to display from the foreign table?

string
getLinkForRelationalDisplayField(array $map, string $relation_field, string $where_comparison, string $dispval, string $relation_field_value)

Display option in the cell according to user choices

array
transformEditedValues(string $db, string $table, array $transformation, array $edited_values, string $file, string $column_name, array $extra_data, string $type)

Transform edited values

string
getCurrentValueAsAnArrayForMultipleEdit(array $multi_edit_funcs, array $multi_edit_salt, array $gis_from_text_functions, string $current_value, array $gis_from_wkb_functions, array $func_optional_param, array $func_no_param, string $key)

Get current value in multi edit mode

array
getQueryValuesForInsertAndUpdateInMultipleEdit(array $multi_edit_columns_name, array $multi_edit_columns_null, string $current_value, array $multi_edit_columns_prev, array $multi_edit_funcs, boolean $is_insert, array $query_values, array $query_fields, string $current_value_as_an_array, array $value_sets, string $key, array $multi_edit_columns_null_prev)

Get query values array and query fields array for insert and update in multi edit

string
getCurrentValueForDifferentTypes(string|false $possibly_uploaded_val, string $key, array|null $multi_edit_columns_type, string $current_value, array|null $multi_edit_auto_increment, integer $rownumber, array $multi_edit_columns_name, array $multi_edit_columns_null, array $multi_edit_columns_null_prev, boolean $is_insert, boolean $using_key, string $where_clause, string $table, array $multi_edit_funcs)

Get the current column value in the form for different data types

void
verifyWhetherValueCanBeTruncatedAndAppendExtraData(string $db, string $table, string $column_name, array $extra_data)

Check whether inline edited value can be truncated or not, and add additional parameters for extra_data array if needed

array
getTableColumns(string $db, string $table)

Function to get the columns of a table

mixed
determineInsertOrEdit(string $where_clause, string $db, string $table)

Function to determine Insert/Edit rows

array
getCommentsMap(string $db, string $table)

Function to get comments for the table columns

array
getUrlParameters(string $db, string $table)

Function to get URL parameters

string
getHtmlForGisEditor()

Function to get html for the gis editor div

string
getHtmlForIgnoreOption(int $row_id, bool $checked = true)

Function to get html for the ignore option in insert mode

string
getHtmlForInsertEditFormHeader(bool $has_blob_field, bool $is_upload)

Function to get html for the insert edit form header

string
getHtmlForInsertEditRow(array $url_params, array $table_columns, array $comments_map, bool $timestamp_seen, array $current_result, string $chg_evt_handler, string $jsvkey, string $vkey, bool $insert_mode, array $current_row, int $o_rows, int $tabindex, int $columns_cnt, bool $is_upload, int $tabindex_for_function, array $foreigners, int $tabindex_for_null, int $tabindex_for_value, string $table, string $db, int $row_id, array $titles, int $biggest_max_file_size, string $text_dir, array $repopulate, array $where_clause_array)

Function to get html for each insert/edit row

Details

at line 52
__construct(DatabaseInterface $dbi)

Constructor

Parameters

DatabaseInterface $dbi DatabaseInterface instance

at line 72
array getFormParametersForInsertForm(string $db, string $table, array|null $where_clauses, array $where_clause_array, string $err_url)

Retrieve form parameters for insert/edit form

Parameters

string $db name of the database
string $table name of the table
array|null $where_clauses where clauses
array $where_clause_array array of where clauses
string $err_url error url

Return Value

array array of insert/edit form parameters

at line 254
array urlParamsInEditMode(array $url_params, array $where_clause_array, string|null $where_clause)

Add some url parameters

Parameters

array $url_params containing $db and $table as url parameters
array $where_clause_array where clauses array
string|null $where_clause where clause

Return Value

array Add some url parameters to $url_params array and return it

at line 279
string showTypeOrFunction(string $which, array $url_params, boolean $is_show)

Show type information or function selectors in Insert/Edit

Parameters

string $which function|type
array $url_params containing url parameters
boolean $is_show whether to show the element in $which

Return Value

string an HTML snippet

at line 410
boolean isColumn(array $column, array $types)

check whether the column is of a certain type the goal is to ensure that types such as "enum('one','two','binary',.

.)" or "enum('one','two','varbinary',..)" are not categorized as binary

Parameters

array $column description of column in given table
array $types the types to verify

Return Value

boolean whether the column's type if one of the $types

at line 1765
string getContinueInsertionForm(string $table, string $db, array $where_clause_array, string $err_url)

get html for continue insertion form

Parameters

string $table name of the table
string $db name of the database
array $where_clause_array array of where clauses
string $err_url error url

Return Value

string an html snippet

at line 1794
string getActionsPanel(array|null $where_clause, string $after_insert, integer $tabindex, integer $tabindex_for_value, boolean $found_unique_key)

Get action panel

Parameters

array|null $where_clause where clause
string $after_insert insert mode, e.g. new_insert, same_insert
integer $tabindex tab index
integer $tabindex_for_value offset for the values tabindex
boolean $found_unique_key boolean variable for unique key

Return Value

string an html snippet

at line 2144
array getParamsForUpdateOrInsert()

Prepares the update/insert of a row

Return Value

array $loop_array, $using_key, $is_insert, $is_insertignore

at line 2183
void isInsertRow()

Check wether insert row mode and if so include tbl_changen script and set global variables.

Return Value

void

at line 2209
void setSessionForEditNext(string $one_where_clause)

set $_SESSION for edit_next

Parameters

string $one_where_clause one where clause from where clauses array

Return Value

void

at line 2246
string getGotoInclude(string $goto_include)

set $goto_include variable for different cases and retrieve like, if $GLOBALS['goto'] empty, if $goto_include previously not defined and new_insert, same_insert, edit_next

Parameters

string $goto_include store some script for include, otherwise it is boolean false

Return Value

string

at line 2290
string getErrorUrl(array $url_params)

Defines the url to return in case of failure of the query

Parameters

array $url_params url parameters

Return Value

string error url for query failure

at line 2308
array buildSqlQuery(boolean $is_insertignore, array $query_fields, array $value_sets)

Builds the sql query

Parameters

boolean $is_insertignore $_POST['submit_type'] == 'insertignore'
array $query_fields column names array
array $value_sets array of query values

Return Value

array of query

at line 2333
array executeSqlQuery(array $url_params, array $query)

Executes the sql query and get the result, then move back to the calling page

Parameters

array $url_params url parameters array
array $query built query from buildSqlQuery()

Return Value

array $url_params, $total_affected_rows, $last_messages $warning_messages, $error_messages, $return_to_sql_query

at line 2421
string getDisplayValueForForeignTableColumn(string $where_comparison, array $map, string $relation_field)

Column to display from the foreign table?

Parameters

string $where_comparison string that contain relation field value
array $map all Relations to foreign tables for a given table or optionally a given column in a table
string $relation_field relation field

Return Value

string display value from the foreign table

at line 2468
string getLinkForRelationalDisplayField(array $map, string $relation_field, string $where_comparison, string $dispval, string $relation_field_value)

Display option in the cell according to user choices

Parameters

array $map all Relations to foreign tables for a given table or optionally a given column in a table
string $relation_field relation field
string $where_comparison string that contain relation field value
string $dispval display value from the foreign table
string $relation_field_value relation field value

Return Value

string HTML tag

at line 2524
array transformEditedValues(string $db, string $table, array $transformation, array $edited_values, string $file, string $column_name, array $extra_data, string $type)

Transform edited values

Parameters

string $db db name
string $table table name
array $transformation mimetypes for all columns of a table [field_name][field_key]
array $edited_values transform columns list and new values
string $file file containing the transformation plugin
string $column_name column name
array $extra_data extra data array
string $type the type of transformation

Return Value

array

at line 2583
string getCurrentValueAsAnArrayForMultipleEdit(array $multi_edit_funcs, array $multi_edit_salt, array $gis_from_text_functions, string $current_value, array $gis_from_wkb_functions, array $func_optional_param, array $func_no_param, string $key)

Get current value in multi edit mode

Parameters

array $multi_edit_funcs multiple edit functions array
array $multi_edit_salt multiple edit array with encryption salt
array $gis_from_text_functions array that contains gis from text functions
string $current_value current value in the column
array $gis_from_wkb_functions initially $val is $multi_edit_columns[$key]
array $func_optional_param array('RAND','UNIX_TIMESTAMP')
array $func_no_param array of set of string
string $key an md5 of the column name

Return Value

string

at line 2650
array getQueryValuesForInsertAndUpdateInMultipleEdit(array $multi_edit_columns_name, array $multi_edit_columns_null, string $current_value, array $multi_edit_columns_prev, array $multi_edit_funcs, boolean $is_insert, array $query_values, array $query_fields, string $current_value_as_an_array, array $value_sets, string $key, array $multi_edit_columns_null_prev)

Get query values array and query fields array for insert and update in multi edit

Parameters

array $multi_edit_columns_name multiple edit columns name array
array $multi_edit_columns_null multiple edit columns null array
string $current_value current value in the column in loop
array $multi_edit_columns_prev multiple edit previous columns array
array $multi_edit_funcs multiple edit functions array
boolean $is_insert boolean value whether insert or not
array $query_values SET part of the sql query
array $query_fields array of query fields
string $current_value_as_an_array current value in the column as an array
array $value_sets array of valu sets
string $key an md5 of the column name
array $multi_edit_columns_null_prev array of multiple edit columns null previous

Return Value

array ($query_values, $query_fields)

at line 2729
string getCurrentValueForDifferentTypes(string|false $possibly_uploaded_val, string $key, array|null $multi_edit_columns_type, string $current_value, array|null $multi_edit_auto_increment, integer $rownumber, array $multi_edit_columns_name, array $multi_edit_columns_null, array $multi_edit_columns_null_prev, boolean $is_insert, boolean $using_key, string $where_clause, string $table, array $multi_edit_funcs)

Get the current column value in the form for different data types

Parameters

string|false $possibly_uploaded_val uploaded file content
string $key an md5 of the column name
array|null $multi_edit_columns_type array of multi edit column types
string $current_value current column value in the form
array|null $multi_edit_auto_increment multi edit auto increment
integer $rownumber index of where clause array
array $multi_edit_columns_name multi edit column names array
array $multi_edit_columns_null multi edit columns null array
array $multi_edit_columns_null_prev multi edit columns previous null
boolean $is_insert whether insert or not
boolean $using_key whether editing or new row
string $where_clause where clause
string $table table name
array $multi_edit_funcs multiple edit functions array

Return Value

string current column value in the form

at line 2850
void verifyWhetherValueCanBeTruncatedAndAppendExtraData(string $db, string $table, string $column_name, array $extra_data)

Check whether inline edited value can be truncated or not, and add additional parameters for extra_data array if needed

Parameters

string $db Database name
string $table Table name
string $column_name Column name
array $extra_data Extra data for ajax response

Return Value

void

at line 2891
array getTableColumns(string $db, string $table)

Function to get the columns of a table

Parameters

string $db current db
string $table current table

Return Value

array

at line 2906
mixed determineInsertOrEdit(string $where_clause, string $db, string $table)

Function to determine Insert/Edit rows

Parameters

string $where_clause where clause
string $db current database
string $table current table

Return Value

mixed

at line 2975
array getCommentsMap(string $db, string $table)

Function to get comments for the table columns

Parameters

string $db current database
string $table current table

Return Value

array comments for columns

at line 2994
array getUrlParameters(string $db, string $table)

Function to get URL parameters

Parameters

string $db current database
string $table current table

Return Value

array url parameters

at line 3017
string getHtmlForGisEditor()

Function to get html for the gis editor div

Return Value

string

at line 3032
string getHtmlForIgnoreOption(int $row_id, bool $checked = true)

Function to get html for the ignore option in insert mode

Parameters

int $row_id row id
bool $checked ignore option is checked or not

Return Value

string

at line 3084
string getHtmlForInsertEditFormHeader(bool $has_blob_field, bool $is_upload)

Function to get html for the insert edit form header

Parameters

bool $has_blob_field whether has blob field
bool $is_upload whether is upload

Return Value

string

at line 3437
string getHtmlForInsertEditRow(array $url_params, array $table_columns, array $comments_map, bool $timestamp_seen, array $current_result, string $chg_evt_handler, string $jsvkey, string $vkey, bool $insert_mode, array $current_row, int $o_rows, int $tabindex, int $columns_cnt, bool $is_upload, int $tabindex_for_function, array $foreigners, int $tabindex_for_null, int $tabindex_for_value, string $table, string $db, int $row_id, array $titles, int $biggest_max_file_size, string $text_dir, array $repopulate, array $where_clause_array)

Function to get html for each insert/edit row

Parameters

array $url_params url parameters
array $table_columns table columns
array $comments_map comments map
bool $timestamp_seen whether timestamp seen
array $current_result current result
string $chg_evt_handler javascript change event handler
string $jsvkey javascript validation key
string $vkey validation key
bool $insert_mode whether insert mode
array $current_row current row
int $o_rows row offset
int $tabindex tab index
int $columns_cnt columns count
bool $is_upload whether upload
int $tabindex_for_function tab index offset for function
array $foreigners foreigners
int $tabindex_for_null tab index offset for null
int $tabindex_for_value tab index offset for value
string $table table
string $db database
int $row_id row id
array $titles titles
int $biggest_max_file_size biggest max file size
string $text_dir text direction
array $repopulate the data to be repopulated
array $where_clause_array the array of where clauses

Return Value

string