AssetController
extends MagnaRegulaController
in package
Tags
Table of Contents
Properties
- $_AST_select : mixed
- $_escape_variables_onedit : mixed
- $_javascript_function1 : mixed
- $_locale : mixed
- $_model : mixed
- $_name_api_token : mixed
- $_name_session_token : mixed
- $_parent : mixed
- $_request : mixed
- $_SPO_select : mixed
- $_token_id : mixed
- $domain : mixed
- $_admin_api_token : mixed
- $_cookie_duration : mixed
- $_dbconn_read : mixed
- $_dbconn_write : mixed
- $_delete_block : mixed
- $_delete_locale : mixed
- $_ESCAPEQUOTE_ONEDIT : mixed
- $_fields_to_format : mixed
- $_insert_block : mixed
- $_list_block_body : mixed
- $_list_block_footer : mixed
- $_list_block_header : mixed
- $_pk : mixed
- $_row : mixed
- $_sql_delete : mixed
- $_sql_inserts : mixed
- $_sql_list : mixed
- $_sql_list_all : mixed
- $_sql_load : mixed
- $_sql_load_by_key : mixed
- $_sql_updates : mixed
- $_update_block : mixed
- $_update_locale : mixed
- $_url_rest_base : mixed
- $_with_block_for_localize : mixed
- $_list_input_for_delete : mixed
- $_list_input_for_update : mixed
Methods
- __() : mixed
- __construct() : mixed
- __destruct() : mixed
- _append_to_file() : none
- records a line of text in a log file
- _append_to_file_static() : none
- records a line of text in a log file
- _build_block() : mixed
- _build_error_message() : mixed
- _build_html_select() : mixed
- _build_url_rest_base() : mixed
- _build_url_rest_for_delete() : mixed
- _build_url_rest_for_insert() : mixed
- _build_url_rest_with_pk() : mixed
- _build_url_update_with_pk() : mixed
- _check_fields_for_row() : mixed
- _connect_for_read() : mixed
- _connect_for_write() : mixed
- _default_action() : array<string|int, mixed>
- Returns NOTHING except the URI, exploded.
- _delete() : array<string|int, mixed>
- Perform a DELETE In this Class, DO NOTHING.
- _delete_locale() : mixed
- _format_node() : mixed
- _html_display_foredit() : mixed
- _html_display_message() : mixed
- _html_find_instance() : mixed
- _html_include_javascript() : mixed
- _html_list() : mixed
- _html_list_all() : mixed
- _html_list_locales() : mixed
- _html_retrieve_values() : array<string|int, mixed>
- Filters field values ($_REQUEST, ...) by keeping those having as prefix one of the values defined in $prefixes In this Class, DO NOTHING.
- _include_subblocks() : mixed
- _init_html_vars() : none
- Initialize class variables containing HTML strings.
- _init_model() : mixed
- _insert() : array<string|int, mixed>
- Perform an INSERT, by calling corresponding method in model
- _is_a_token() : bool
- Check if the string given by parameter is structured as we look for (32 to 36 characters).
- _is_owner_of() : mixed
- _is_token_valid() : mixed
- _match_includes() : mixed
- _normalize_int() : mixed
- _normalize_text() : mixed
- _perform_other_action_after_insert() : mixed
- _perform_other_action_after_update() : mixed
- _prepare_display_foredit() : mixed
- _prepare_text_list_body_for_delete() : mixed
- _prepare_text_list_body_for_update() : mixed
- _prepare_text_list_header() : mixed
- _set_cookie_token() : none
- send a cookie equal to the api_token. Only for TRUSTED applications
- _translate_output() : mixed
- _translate_text() : mixed
- _update() : array<string|int, mixed>
- Perform an UPDATE, by calling corresponding method in model
- _update_locale() : mixed
- admin() : mixed
- deleteAction() : array<string|int, mixed>
- Perform action on DELETE verb.
- getAction() : array<string|int, mixed>
- Perform action on GET verb. If 'method' is set, redirects to <method>Action
- html_manage_instance() : mixed
- load() : array<string|int, mixed>
- Loads a DB record.
- load_by_key() : array<string|int, mixed>
- Loads a DB record.
- patchAction() : array<string|int, mixed>
- Perform action on PATCH verb. Redirects ALWAYS to putAction()
- postAction() : array<string|int, mixed>
- Perform action on POST verb. If 'method' is set, redirects to <method>Action
- putAction() : array<string|int, mixed>
- Perform action on PUT verb.
- sanitize_int_array() : array<string|int, mixed>
- Sanitize an array of numeric values, converted to pure integers
- tblist() : array<string|int, mixed>
- Loads a list of records.
Properties
$_AST_select
public
mixed
$_AST_select
= array('sql' => 'SELECT ast_pk, ast_code, ast_name, ast_desc FROM assettype A ORDER BY A.ast_code', 'key' => '', 'name' => 'ast_pk', 'value' => 'ast_pk', 'descr' => '%ast_name% (%ast_code%)', 'allow_null' => \FALSE)
$_escape_variables_onedit
public
mixed
$_escape_variables_onedit
= \TRUE
$_javascript_function1
public
mixed
$_javascript_function1
= <<<EOT
<script language='Javascript'>
function AskforDeletion(RefNumber) {
var ret = confirm( "Voulez-vous VRAIMENT supprimer la ligne #" + RefNumber + " ?" );
return ret;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
var w=window.open(theURL,winName,features);
w.focus();
}
function OpenLink(theURL,title) {
MM_openBrWindow(theURL,title,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=1250,height=650');
}
</script>
EOT
$_locale
public
mixed
$_locale
= 'fr_fr'
$_model
public
mixed
$_model
= \NULL
$_name_api_token
public
static mixed
$_name_api_token
= 'X-MagnaRegula-Api-Token'
$_name_session_token
public
static mixed
$_name_session_token
= 'X-MagnaRegula-Session-Token'
$_parent
public
mixed
$_parent
= \NULL
$_request
public
mixed
$_request
= \NULL
$_SPO_select
public
mixed
$_SPO_select
= array('sql' => 'SELECT spo_pk, spo_code, spo_name FROM spaceobject ORDER BY spo_code', 'key' => '', 'name' => 'spo_pk', 'value' => 'spo_pk', 'descr' => '%spo_name% (%spo_code%)', 'allow_null' => \TRUE)
$_token_id
public
mixed
$_token_id
= \NULL
$domain
public
static mixed
$domain
= 'magnaregula'
$_admin_api_token
protected
static mixed
$_admin_api_token
= '{04F04C15-B0EB-483E-7056-C5B82772DB24}'
$_cookie_duration
protected
static mixed
$_cookie_duration
= 7200
$_dbconn_read
protected
mixed
$_dbconn_read
= \NULL
$_dbconn_write
protected
mixed
$_dbconn_write
= \NULL
$_delete_block
protected
mixed
$_delete_block
= \NULL
$_delete_locale
protected
mixed
$_delete_locale
= \FALSE
$_ESCAPEQUOTE_ONEDIT
protected
mixed
$_ESCAPEQUOTE_ONEDIT
= \TRUE
$_fields_to_format
protected
mixed
$_fields_to_format
= array()
$_insert_block
protected
mixed
$_insert_block
= \NULL
$_list_block_body
protected
mixed
$_list_block_body
= \NULL
$_list_block_footer
protected
mixed
$_list_block_footer
= \NULL
$_list_block_header
protected
mixed
$_list_block_header
= \NULL
$_pk
protected
mixed
$_pk
= \NULL
$_row
protected
mixed
$_row
= \NULL
$_sql_delete
protected
mixed
$_sql_delete
= \NULL
$_sql_inserts
protected
mixed
$_sql_inserts
= \NULL
$_sql_list
protected
mixed
$_sql_list
= \NULL
$_sql_list_all
protected
mixed
$_sql_list_all
= \NULL
$_sql_load
protected
mixed
$_sql_load
= \NULL
$_sql_load_by_key
protected
mixed
$_sql_load_by_key
= \NULL
$_sql_updates
protected
mixed
$_sql_updates
= \NULL
$_update_block
protected
mixed
$_update_block
= \NULL
$_update_locale
protected
mixed
$_update_locale
= \FALSE
$_url_rest_base
protected
mixed
$_url_rest_base
= "http://webservices.magna-regula.cloud/index.php/"
$_with_block_for_localize
protected
mixed
$_with_block_for_localize
= \TRUE
$_list_input_for_delete
private
mixed
$_list_input_for_delete
= '<input type="submit" value="X">'
$_list_input_for_update
private
mixed
$_list_input_for_update
= '<input type="submit" value=">">'
Methods
__()
public
static __(mixed $text) : mixed
Parameters
- $text : mixed
__construct()
public
__construct([mixed $_parent = NULL ]) : mixed
Parameters
- $_parent : mixed = NULL
__destruct()
public
__destruct() : mixed
_append_to_file()
records a line of text in a log file
public
_append_to_file(string $text) : none
Parameters
- $text : string
-
The text to log.
Tags
Return values
none_append_to_file_static()
records a line of text in a log file
public
static _append_to_file_static(string $text) : none
Parameters
- $text : string
-
The text to log.
Tags
Return values
none_build_block()
public
_build_block(mixed $blocktext, mixed $row[, mixed $clearvars = TRUE ]) : mixed
Parameters
- $blocktext : mixed
- $row : mixed
- $clearvars : mixed = TRUE
_build_error_message()
public
_build_error_message(mixed $errorcode) : mixed
Parameters
- $errorcode : mixed
_build_html_select()
public
_build_html_select(mixed $conf) : mixed
Parameters
- $conf : mixed
_build_url_rest_base()
public
_build_url_rest_base() : mixed
_build_url_rest_for_delete()
public
_build_url_rest_for_delete([mixed $action = 'delete' ]) : mixed
Parameters
- $action : mixed = 'delete'
_build_url_rest_for_insert()
public
_build_url_rest_for_insert([mixed $action = 'insert' ]) : mixed
Parameters
- $action : mixed = 'insert'
_build_url_rest_with_pk()
public
_build_url_rest_with_pk(mixed $pk[, mixed $action = NULL ]) : mixed
Parameters
- $pk : mixed
- $action : mixed = NULL
_build_url_update_with_pk()
public
_build_url_update_with_pk(mixed $pk) : mixed
Parameters
- $pk : mixed
_check_fields_for_row()
public
_check_fields_for_row(mixed &$row) : mixed
Parameters
- $row : mixed
_connect_for_read()
public
_connect_for_read() : mixed
_connect_for_write()
public
_connect_for_write() : mixed
_default_action()
Returns NOTHING except the URI, exploded.
public
static _default_action(object $request) : array<string|int, mixed>
Parameters
- $request : object
-
The request, built by class 'Request'
Tags
Return values
array<string|int, mixed> —Array of the URI elements
_delete()
Perform a DELETE In this Class, DO NOTHING.
public
_delete(mixed $_pk[, mixed $fields = NULL ]) : array<string|int, mixed>
See MagnaRegulaController.
Parameters
- $_pk : mixed
- $fields : mixed = NULL
-
Fields corresponding to column values
Return values
array<string|int, mixed> —An array containing error+rows
_delete_locale()
public
_delete_locale(mixed $old_code) : mixed
Parameters
- $old_code : mixed
_format_node()
public
_format_node(mixed $column, mixed $columnvalue, mixed $formats) : mixed
Parameters
- $column : mixed
- $columnvalue : mixed
- $formats : mixed
_html_display_foredit()
public
_html_display_foredit([mixed $action = NULL ]) : mixed
Parameters
- $action : mixed = NULL
_html_display_message()
public
_html_display_message() : mixed
_html_find_instance()
public
_html_find_instance() : mixed
_html_include_javascript()
public
_html_include_javascript() : mixed
_html_list()
public
_html_list([mixed $action = NULL ]) : mixed
Parameters
- $action : mixed = NULL
_html_list_all()
public
_html_list_all([mixed $action = NULL ]) : mixed
Parameters
- $action : mixed = NULL
_html_list_locales()
public
_html_list_locales([mixed $action = NULL ][, mixed $row = NULL ]) : mixed
Parameters
- $action : mixed = NULL
- $row : mixed = NULL
_html_retrieve_values()
Filters field values ($_REQUEST, ...) by keeping those having as prefix one of the values defined in $prefixes In this Class, DO NOTHING.
public
_html_retrieve_values([mixed $prefixes = array() ]) : array<string|int, mixed>
Parameters
- $prefixes : mixed = array()
-
Array of strings to isolate _REQUEST values
Return values
array<string|int, mixed> —An array of fields to keep
_include_subblocks()
public
_include_subblocks(mixed $text) : mixed
Parameters
- $text : mixed
_init_html_vars()
Initialize class variables containing HTML strings.
public
_init_html_vars() : none
Return values
none_init_model()
public
_init_model() : mixed
_insert()
Perform an INSERT, by calling corresponding method in model
public
_insert([string $action = 'insert' ][, array<string|int, mixed> $fields = NULL ]) : array<string|int, mixed>
Parameters
- $action : string = 'insert'
-
The action to perform ('insert' in most cases)
- $fields : array<string|int, mixed> = NULL
-
Fields corresponding to column values
Tags
Return values
array<string|int, mixed> —An array containing error+rows
_is_a_token()
Check if the string given by parameter is structured as we look for (32 to 36 characters).
public
static _is_a_token(string $token) : bool
Parameters
- $token : string
-
The string to check.
Tags
Return values
bool —YES/NO, it looks like a token
_is_owner_of()
public
_is_owner_of(mixed $acc_pk) : mixed
Parameters
- $acc_pk : mixed
_is_token_valid()
public
_is_token_valid(mixed $id) : mixed
Parameters
- $id : mixed
_match_includes()
public
_match_includes(mixed $matches) : mixed
Parameters
- $matches : mixed
_normalize_int()
public
_normalize_int(mixed $parm) : mixed
Parameters
- $parm : mixed
_normalize_text()
public
_normalize_text(mixed $text, mixed $object[, mixed $clearvars = TRUE ][, mixed $escapequotes = TRUE ]) : mixed
Parameters
- $text : mixed
- $object : mixed
- $clearvars : mixed = TRUE
- $escapequotes : mixed = TRUE
_perform_other_action_after_insert()
public
_perform_other_action_after_insert(mixed $action, mixed $return, mixed $params) : mixed
Parameters
- $action : mixed
- $return : mixed
- $params : mixed
_perform_other_action_after_update()
public
_perform_other_action_after_update(mixed $action, mixed $return, mixed $params) : mixed
Parameters
- $action : mixed
- $return : mixed
- $params : mixed
_prepare_display_foredit()
public
_prepare_display_foredit(mixed &$text, mixed &$row[, mixed $action = NULL ]) : mixed
Parameters
- $text : mixed
- $row : mixed
- $action : mixed = NULL
_prepare_text_list_body_for_delete()
public
_prepare_text_list_body_for_delete(mixed $text[, mixed $row = NULL ]) : mixed
Parameters
- $text : mixed
- $row : mixed = NULL
_prepare_text_list_body_for_update()
public
_prepare_text_list_body_for_update(mixed $text[, mixed $row = NULL ][, mixed $action = NULL ]) : mixed
Parameters
- $text : mixed
- $row : mixed = NULL
- $action : mixed = NULL
_prepare_text_list_header()
public
_prepare_text_list_header(mixed $text) : mixed
Parameters
- $text : mixed
_set_cookie_token()
send a cookie equal to the api_token. Only for TRUSTED applications
public
static _set_cookie_token() : none
Tags
Return values
none_translate_output()
public
_translate_output(mixed $result[, mixed $request = NULL ]) : mixed
Parameters
- $result : mixed
- $request : mixed = NULL
_translate_text()
public
static _translate_text(mixed $text[, mixed $linuxlocale = NULL ]) : mixed
Parameters
- $text : mixed
- $linuxlocale : mixed = NULL
_update()
Perform an UPDATE, by calling corresponding method in model
public
_update(int $_pk[, string $action = 'update' ][, array<string|int, mixed> $fields = NULL ]) : array<string|int, mixed>
Parameters
- $_pk : int
-
The primary key
- $action : string = 'update'
-
The action to perform ('update' in most cases)
- $fields : array<string|int, mixed> = NULL
-
Fields corresponding to column values
Tags
Return values
array<string|int, mixed> —An array containing error+rows
_update_locale()
public
_update_locale(mixed $old_code, mixed $new_code) : mixed
Parameters
- $old_code : mixed
- $new_code : mixed
admin()
public
admin() : mixed
deleteAction()
Perform action on DELETE verb.
public
deleteAction(string $request) : array<string|int, mixed>
Parameters
- $request : string
-
"Request" object
Tags
Return values
array<string|int, mixed> —An array with 'error', 'message', 'row' or 'rows', ...
getAction()
Perform action on GET verb. If 'method' is set, redirects to <method>Action
public
getAction(string $request) : array<string|int, mixed>
Parameters
- $request : string
-
"Request" object
Tags
Return values
array<string|int, mixed> —An array with 'error', 'message', 'row' or 'rows', ...
html_manage_instance()
public
html_manage_instance() : mixed
load()
Loads a DB record.
public
load(mixed $id[, mixed $control_owner = TRUE ]) : array<string|int, mixed>
In this Class, DO NOTHING. See MagnaRegulaController.
Parameters
- $id : mixed
-
The primary key of the table.
- $control_owner : mixed = TRUE
Return values
array<string|int, mixed> —An array containing error+row
load_by_key()
Loads a DB record.
public
load_by_key(mixed $id) : array<string|int, mixed>
In this Class, DO NOTHING. See MagnaRegulaController.
Parameters
- $id : mixed
-
The primary key of the table. Sometimes, could be a string and not a integer
Return values
array<string|int, mixed> —An array containing error+row
patchAction()
Perform action on PATCH verb. Redirects ALWAYS to putAction()
public
patchAction(string $request) : array<string|int, mixed>
Parameters
- $request : string
-
"Request" object
Tags
Return values
array<string|int, mixed> —An array with 'error', 'message', 'row' or 'rows', ...
postAction()
Perform action on POST verb. If 'method' is set, redirects to <method>Action
public
postAction(string $request) : array<string|int, mixed>
Parameters
- $request : string
-
"Request" object
Tags
Return values
array<string|int, mixed> —An array with 'error', 'message', 'row' or 'rows', ...
putAction()
Perform action on PUT verb.
public
putAction(string $request) : array<string|int, mixed>
Parameters
- $request : string
-
"Request" object
Tags
Return values
array<string|int, mixed> —An array with 'error', 'message', 'row' or 'rows', ...
sanitize_int_array()
Sanitize an array of numeric values, converted to pure integers
public
static sanitize_int_array(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
-
The array (of numeric values) to sanitize.
Tags
Return values
array<string|int, mixed> —The same array, but only with integer values; non-convertible values are dropped
tblist()
Loads a list of records.
public
tblist() : array<string|int, mixed>
In this Class, DO NOTHING. See MagnaRegulaController.
Return values
array<string|int, mixed> —An array containing error+rows