class InsertEdit (View source)

Constants

private FUNC_OPTIONAL_PARAM

private FUNC_NO_PARAM

Methods

__construct(DatabaseInterface $dbi, Relation $relation, Transformations $transformations, FileListing $fileListing, Template $template, Config $config)

No description

array
getFormParametersForInsertForm(string $db, string $table, array|null $whereClauses, array $whereClauseArray, string $errorUrl)

Retrieve form parameters for insert/edit form

string
showTypeOrFunction(string $which, array $urlParams, bool $isShow)

Show type information or function selectors in Insert/Edit

bool
isColumn(string $columnType, 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

string
getContinueInsertionForm(string $table, string $db, array $whereClauseArray, string $errorUrl)

get html for continue insertion form

static bool
isWhereClauseNumeric(array|string|null $whereClause)

No description

void
setSessionForEditNext(string $oneWhereClause)

set $_SESSION for edit_next

string
getGotoInclude(string|false $gotoInclude)

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 $urlParams)

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

array
executeSqlQuery(array $query)

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

string
getDisplayValueForForeignTableColumn(string $whereComparison, array $map, string $relationField)

Column to display from the foreign table?

string
getLinkForRelationalDisplayField(array $map, string $relationField, string $whereComparison, string $dispval, string $relationFieldValue)

Display option in the cell according to user choices

array
transformEditedValues(string $db, string $table, array $transformation, array $editedValues, string $file, string $columnName, array $extraData, string $type)

Transform edited values

string
getQueryValueForInsert(EditField $editField, bool $usingKey, string|int $whereClause)

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

string
getQueryValueForUpdate(EditField $editField)

Get field-value pairs for update SQL.

void
verifyWhetherValueCanBeTruncatedAndAppendExtraData(string $db, string $table, string $columnName, array $extraData)

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

array
determineInsertOrEdit(array|string|null $whereClause, string $db, string $table)

Function to determine Insert/Edit rows

array
getCommentsMap(string $db, string $table)

Function to get comments for the table columns

string
getHtmlForGisEditor()

Function to get html for the gis editor div

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

Function to get html for the ignore option in insert mode

string
getHtmlForInsertEditFormHeader(bool $hasBlobField, bool $isUpload)

Function to get html for the insert edit form header

string
getHtmlForInsertEditRow(array $urlParams, array $tableColumns, array $commentsMap, ResultInterface $currentResult, bool $insertMode, array $currentRow, bool $isUpload, array $foreigners, string $table, string $db, int $rowId, string $textDir, array $repopulate, array $whereClauseArray)

Function to get html for each insert/edit row

Details

__construct(DatabaseInterface $dbi, Relation $relation, Transformations $transformations, FileListing $fileListing, Template $template, Config $config)

No description

Parameters

DatabaseInterface $dbi
Relation $relation
Transformations $transformations
FileListing $fileListing
Template $template
Config $config

array getFormParametersForInsertForm(string $db, string $table, array|null $whereClauses, array $whereClauseArray, string $errorUrl)

Retrieve form parameters for insert/edit form

Parameters

string $db

name of the database

string $table

name of the table

array|null $whereClauses
array $whereClauseArray
string $errorUrl

Return Value

array

array of insert/edit form parameters

string showTypeOrFunction(string $which, array $urlParams, bool $isShow)

Show type information or function selectors in Insert/Edit

Parameters

string $which function|type
array $urlParams

containing url parameters

bool $isShow

whether to show the element in $which

Return Value

string

an HTML snippet

bool isColumn(string $columnType, 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

string $columnType

column type as specified in the column definition

array $types

the types to verify

Return Value

bool

string getContinueInsertionForm(string $table, string $db, array $whereClauseArray, string $errorUrl)

get html for continue insertion form

Parameters

string $table

name of the table

string $db

name of the database

array $whereClauseArray
string $errorUrl

Return Value

string

an html snippet

static bool isWhereClauseNumeric(array|string|null $whereClause)

No description

Parameters

array|string|null $whereClause

Return Value

bool

void setSessionForEditNext(string $oneWhereClause)

set $_SESSION for edit_next

Parameters

string $oneWhereClause

one where clause from where clauses array

Return Value

void

string getGotoInclude(string|false $gotoInclude)

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|false $gotoInclude

store some script for include, otherwise it is boolean false

Return Value

string

string getErrorUrl(array $urlParams)

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

Parameters

array $urlParams

url parameters

Return Value

string

error url for query failure

array executeSqlQuery(array $query)

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

Parameters

array $query

built query from buildSqlQuery()

Return Value

array

string getDisplayValueForForeignTableColumn(string $whereComparison, array $map, string $relationField)

Column to display from the foreign table?

Parameters

string $whereComparison

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 $relationField

relation field

Return Value

string

display value from the foreign table

string getLinkForRelationalDisplayField(array $map, string $relationField, string $whereComparison, string $dispval, string $relationFieldValue)

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 $relationField

relation field

string $whereComparison

string that contain relation field value

string $dispval

display value from the foreign table

string $relationFieldValue

relation field value

Return Value

string

HTML tag

array transformEditedValues(string $db, string $table, array $transformation, array $editedValues, string $file, string $columnName, array $extraData, 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 $editedValues

transform columns list and new values

string $file

file containing the transformation plugin

string $columnName

column name

array $extraData

extra data array

string $type

the type of transformation

Return Value

array

string getQueryValueForInsert(EditField $editField, bool $usingKey, string|int $whereClause)

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

Parameters

EditField $editField
bool $usingKey
string|int $whereClause

Either a positional index or string representing selected row

Return Value

string

string getQueryValueForUpdate(EditField $editField)

Get field-value pairs for update SQL.

During update, we build the SQL only with the fields that should be updated.

Parameters

EditField $editField

Return Value

string

void verifyWhetherValueCanBeTruncatedAndAppendExtraData(string $db, string $table, string $columnName, array $extraData)

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 $columnName

Column name

array $extraData

Extra data for ajax response

Return Value

void

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

array determineInsertOrEdit(array|string|null $whereClause, string $db, string $table)

Function to determine Insert/Edit rows

Parameters

array|string|null $whereClause

where clause

string $db

current database

string $table

current table

Return Value

array

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

string getHtmlForGisEditor()

Function to get html for the gis editor div

Return Value

string

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

Function to get html for the ignore option in insert mode

Parameters

int $rowId

row id

bool $checked

ignore option is checked or not

Return Value

string

string getHtmlForInsertEditFormHeader(bool $hasBlobField, bool $isUpload)

Function to get html for the insert edit form header

Parameters

bool $hasBlobField

whether has blob field

bool $isUpload

whether is upload

Return Value

string

string getHtmlForInsertEditRow(array $urlParams, array $tableColumns, array $commentsMap, ResultInterface $currentResult, bool $insertMode, array $currentRow, bool $isUpload, array $foreigners, string $table, string $db, int $rowId, string $textDir, array $repopulate, array $whereClauseArray)

Function to get html for each insert/edit row

Parameters

array $urlParams

url parameters

array $tableColumns

table columns

array $commentsMap

comments map

ResultInterface $currentResult

current result

bool $insertMode

whether insert mode

array $currentRow

current row

bool $isUpload

whether upload

array $foreigners foreigners
string $table table
string $db database
int $rowId

row id

string $textDir

text direction

array $repopulate

the data to be repopulated

array $whereClauseArray

the array of where clauses

Return Value

string