class TableEditor extends UIComponent

Constants

SYSTEM_TEMPLATE_UI_FOLDER

Properties

$xf_link from  UIComponent
$link_id from  UIComponent
array $GPvars from  UIComponent
Core $mod
protected array $local_template_marker from  UIComponent
protected $_overwrite_param_array
protected bool|array|ModelCollection $marker_content from  UIComponent
string $mod_object_manager from  UIComponent
protected bool $_orig_marker_content from  UIComponent
protected array $_allowed_params_filter from  UIComponent
string $unique_dom_id from  UIComponent
protected string $uid from  UIComponent
string read-only $_content

When used in template this property will contain the XML/HTML within the XUI Nodes

from  UIComponent
$links
protected $params

customizable by xTags

Methods

__construct(bool|string $sql_table = false, array|bool $fields = false, array|bool $params = false, bool $override = false, bool|string $table_id = false)

No description

string
__toString()

No description

add_multi_action($action, $linkParams = array('label' => 'LABEL'), $callback = array())

No description

bool
delete_record(int $primaryKeyValue)

No description

enable_model_sort()

No description

mixed
get($var)

Get Variable / Option

string
get_action()

No description

get_edit_link($primaryKeyValue)

No description

get_form(array|bool $fdl = false)

No description

array
get_new_link()

Get new Link (Action)

int
get_primary_key()

No description

get_table(string $sql_table = 'auto', array|string $fields = 'auto', string $primaryKey = 'auto')

No description

string
get_unique_dom_id()

Generates a unique dom id, dependent on the provided UID, as well as the current context.

Template|null
get_view(string|bool $section = false)

Return new template view If using within module xui the tpl file should be named [class_name].tpl e.g. xui_core_table.tpl within the module's template folder

init()

put your comment there.

string
parse_template(string $template_content, array|bool $marker_array = false)

No description

string|null
parse_template_cb_wrapper(mixed $matches)

No description

mixed|string
parse_xtag($xml_source)

No description

process(bool|string $force_action = false)

No description

render()

No description

mixed
render_xtag_element()

No description

void
reset_marker_content()

restores original content of marker_content

void
set(mixed $var, mixed $value = false)

Set Variable / Option

setFieldsFromModel(Model $model, array $fields = [], array $params = [])

Use a model to automatically setup an CRUD Editor for this model

set_action(string $action)

No description

void
set_array(mixed $member_array, mixed $vars)

Set Variable / Option for an array

set_callbacks(array $callbacks)

set callbacks

set_download_handler(string $download_handler)

set download handler (Where to download a file)

set_field_params(string $field_id, array $params, string $mode = 'merge')

Adds/Changes a field definition

set_filter_fields(array $fields)

You can add a simple filter to allow the user to filter the overview table by a certain keyword.

set_grouping(string $column)

set grouping

set_join(string $statement)

set join statement

set_limit(mixed $count)

set limit for Pagination

void
set_marker_content(mixed $marker_content = false)

sets marker_content to passed data -> restore original content with reset_marker_content()

set_mod(mixed $mod)

Set link to owning module

set_no_add_link()

hide add link

set_no_delete_link()

hide delete link

set_no_edit_link()

hide edit link

set_order_field(string $column, string $order_direction = "ASC")

set order field

set_order_fields(array $columns, string $order_direction = "ASC")

set order field

void
set_params(string $data_source, array $fields, array $params, bool $overwrite = false, string $unique_table_id = null)

No description

set_primary_key(int $id = null)

No description

set_primary_key_column(string $column)

set primary key column

set_record_label($label = 'record')

No description

void
set_render_params(mixed $input_params = array())

Used to inject params. Only allowed params will be used (see $allowed_params_filter)

set_web_dir(string $location)

set web directory location (storage path)

set_where(string $statement)

set where statement

array|string
table_editor_cb($primaryKeyValue, $actionParams, string $concat = ' ', bool $return_array = false)

No description

array|string
table_model_sort_cb($primaryKeyValue, $actionParams, string $concat = ' ', bool $return_array = false)

No description

Details

at line 112
__construct(bool|string $sql_table = false, array|bool $fields = false, array|bool $params = false, bool $override = false, bool|string $table_id = false)

No description

Parameters

bool|string $sql_table

Table Name

array|bool $fields

Fields in FDL Syntax (see Wiki for FDL Help)

array|bool $params

Additional Options (minimal: array('primaryKey'=>'my_id_field'), optional: 'join','where','order_field','order_fields','actions')

bool $override
bool|string $table_id

custom id (overrides generic unique_id)

in UIComponent at line 324
string __toString()

No description

Return Value

string

at line 1349
add_multi_action($action, $linkParams = array('label' => 'LABEL'), $callback = array())

No description

Parameters

$action
$linkParams
$callback

at line 1153
bool delete_record(int $primaryKeyValue)

No description

Parameters

int $primaryKeyValue

Primary Key Value

Return Value

bool

Exceptions

Exception

at line 1001
enable_model_sort()

No description

in UIComponent at line 185
mixed get($var)

Get Variable / Option

Parameters

$var

Return Value

mixed

at line 363
string get_action()

No description

Return Value

string

Action State (table, new, edit, delete)

No description

Parameters

$primaryKeyValue

at line 894
Form get_form(array|bool $fdl = false)

No description

Parameters

array|bool $fdl

Field Description in FDL Format (Default will set Fields)

Return Value

Form

Get new Link (Action)

Return Value

array

at line 384
int get_primary_key()

No description

Return Value

int

Primary Key Value

at line 564
Table get_table(string $sql_table = 'auto', array|string $fields = 'auto', string $primaryKey = 'auto')

No description

Parameters

string $sql_table

Table Name (Default is supplied via Constructor)

array|string $fields

Fields (Default is supplied via Constructor)

string $primaryKey

PrimaryKey

Return Value

Table

Table Object

in UIComponent at line 202
string get_unique_dom_id()

Generates a unique dom id, dependent on the provided UID, as well as the current context.

Return Value

string

in UIComponent at line 289
Template|null get_view(string|bool $section = false)

Return new template view If using within module xui the tpl file should be named [class_name].tpl e.g. xui_core_table.tpl within the module's template folder

Parameters

string|bool $section

Name

Return Value

Template|null

Exceptions

Exception

at line 120
init()

put your comment there.

..

in UIComponent at line 221
string parse_template(string $template_content, array|bool $marker_array = false)

No description

Parameters

string $template_content

HTML Template

array|bool $marker_array

Markers and Values

Return Value

string

Parsed HTML Content

in UIComponent at line 234
string|null parse_template_cb_wrapper(mixed $matches)

No description

Parameters

mixed $matches

Return Value

string|null

in UIComponent at line 260
mixed|string parse_xtag($xml_source)

No description

Parameters

$xml_source

Return Value

mixed|string

Exceptions

ContentException

at line 1017
process(bool|string $force_action = false)

No description

Parameters

bool|string $force_action

Force a specific process action ('table','new','edit','delete...)

Exceptions

Exception
ContentException

at line 1189
render()

No description

Exceptions

ContentException

in UIComponent at line 268
mixed render_xtag_element()

No description

Return Value

mixed

in UIComponent at line 173
void reset_marker_content()

restores original content of marker_content

Return Value

void

in UIComponent at line 106
void set(mixed $var, mixed $value = false)

Set Variable / Option

Parameters

mixed $var

Name of Variable to Set (Alternative: Assoc-Array for multiple variables)

mixed $value

Value of Variable

Return Value

void

at line 130
setFieldsFromModel(Model $model, array $fields = [], array $params = [])

Use a model to automatically setup an CRUD Editor for this model

Parameters

Model $model
array $fields

Specify additional fields or Overwrite fields

array $params

at line 373
set_action(string $action)

No description

Parameters

string $action

Action State (table, new, edit, delete)

in UIComponent at line 122
void set_array(mixed $member_array, mixed $vars)

Set Variable / Option for an array

Parameters

mixed $member_array

Name of Variable to Set (Alternative: Assoc-Array for multiple variables)

mixed $vars

Value of Variable

Return Value

void

at line 530
set_callbacks(array $callbacks)

set callbacks

Parameters

array $callbacks

Examples

code below

$callbacks = array(
"column" => array($this, "cb_callback_function")
);

$table_editor->set_callbacks($callbacks);

public function cb_callback_function($db_value) {
return "callback ({$db_value})";
}

at line 550
set_download_handler(string $download_handler)

set download handler (Where to download a file)

Parameters

string $download_handler

at line 349
set_field_params(string $field_id, array $params, string $mode = 'merge')

Adds/Changes a field definition

Parameters

string $field_id
array $params
string $mode

Mode [merge, overwrite]

at line 509
set_filter_fields(array $fields)

You can add a simple filter to allow the user to filter the overview table by a certain keyword.

To enable the filter set the filter_fields parameter to an array containing all fields which should be included in the filter search.

Parameters

array $fields

example array('title','description')

at line 445
set_grouping(string $column)

set grouping

Parameters

string $column

at line 488
set_join(string $statement)

set join statement

Parameters

string $statement

Examples

'LEFT JOIN $cat_table t ON ({$table}.template_id = t.id)"'

at line 465
set_limit(mixed $count)

set limit for Pagination

Parameters

mixed $count

in UIComponent at line 165
void set_marker_content(mixed $marker_content = false)

sets marker_content to passed data -> restore original content with reset_marker_content()

Parameters

mixed $marker_content

Return Value

void

in UIComponent at line 90
set_mod(mixed $mod)

Set link to owning module

Parameters

mixed $mod

hide add link

hide delete link

hide edit link

at line 455
set_order_field(string $column, string $order_direction = "ASC")

set order field

Parameters

string $column
string $order_direction

at line 477
set_order_fields(array $columns, string $order_direction = "ASC")

set order field

warning: requires set_order_field() first

Parameters

array $columns
string $order_direction

at line 234
void set_params(string $data_source, array $fields, array $params, bool $overwrite = false, string $unique_table_id = null)

No description

Parameters

string $data_source

Table Name or Model model

array $fields

Fields in FDL Syntax (see Wiki for FDL Help)

array $params

Additional Options (optional: array('join','where','order_field','order_fields','actions','multi_actions','primaryKey','limit','order_direction')

bool $overwrite

Used for internal XUI Usage of Table Editor

string $unique_table_id

$table_id custom id (overrides generic unique_id)

Return Value

void

at line 398
set_primary_key(int $id = null)

No description

Parameters

int $id

Primary Key Value

at line 412
set_primary_key_column(string $column)

set primary key column

Parameters

string $column

at line 1345
set_record_label($label = 'record')

No description

Parameters

$label

in UIComponent at line 135
void set_render_params(mixed $input_params = array())

Used to inject params. Only allowed params will be used (see $allowed_params_filter)

Parameters

mixed $input_params

Return Value

void

at line 541
set_web_dir(string $location)

set web directory location (storage path)

Parameters

string $location

Examples

$table_editor->set_web_dir( $this->mod->get_config('mod_storage_path') );

at line 498
set_where(string $statement)

set where statement

Parameters

string $statement

Examples

'account_id <= 0'

at line 820
array|string table_editor_cb($primaryKeyValue, $actionParams, string $concat = ' ', bool $return_array = false)

No description

Parameters

$primaryKeyValue
$actionParams
string $concat
bool $return_array

Return Value

array|string

at line 858
array|string table_model_sort_cb($primaryKeyValue, $actionParams, string $concat = ' ', bool $return_array = false)

No description

Parameters

$primaryKeyValue
$actionParams
string $concat
bool $return_array

Return Value

array|string