Documentation

MailprofileController extends MagnaRegulaController
in package

Tags
addtogroup

controllers Group of Controllers

@{

Table of Contents

Properties

$_edit_block  : mixed
$_escape_variables_onedit  : mixed
$_javascript_function1  : mixed
$_list_block_body  : mixed
$_list_block_footer  : mixed
$_list_block_header  : mixed
$_locale  : mixed
$_model  : mixed
$_MPC_select  : mixed
$_name_api_token  : mixed
$_name_session_token  : mixed
$_parent  : mixed
$_request  : 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
$_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
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

$_edit_block

public mixed $_edit_block = <<<EOT <h2>Mise &agrave; jour du Profil de Mail "%mpr_name% (%mpr_code%)"</h2> <div> <form name="UpdateForm%_pk%" enctype="application/x-www-form-urlencoded" action="%url_rest_update%" method="POST"> <input type="hidden" name="method" value="PUT"><input type="hidden" name="redirect_referer" value="1"><input type="hidden" name="format" value="html"> <input type="hidden" name="_pk" value="%_pk%"> <table> <tr> <td><label for="_pk">Cl&eacute; :</label></td><td>%_pk%</td> </tr> <tr> <td><label for="mpr_code">Code :</label></td><td><input type='text' name='mpr_code' value="%mpr_code%" size='40' maxlength='40'></td> </tr> <tr> <td><label for="mpr_name">Nom :</label></td><td><input type='text' name='mpr_name' value="%mpr_name%" size='40' maxlength='100'></td> </tr> <tr> <td><label for="mpc_pk">Canevas :</label></td><td>%mpc_select%</td> </tr> <tr> <td><label for="mpr_desc">Description :</label></td><td><textarea name='mpr_desc' cols='60' rows='5'>%mpr_desc%</textarea></td> </tr> <tr> <td><label for="mpr_subject">Sujet du mail :</label></td><td><input type='text' name='mpr_subject' value="%mpr_subject%" size='80' maxlength='100'></td> </tr> <tr> <td><label for="mpr_recipients">Destinataires du mail :</label></td><td><input type='text' name='mpr_recipients' value="%mpr_recipients%" size='80' maxlength='1000'></td> </tr> <tr> <td><label for="mpr_send_once_per">Envoi une fois MAX par :</label></td><td><input type='text' name='mpr_send_once_per' value="%mpr_send_once_per%" size='1' maxlength='1'>( D=Day, H=Hour)</td> </tr> <tr> <td><label for="mpr_body_html_errors">Contenu HTML du mail, si erreur :</label></td><td><textarea name='mpr_body_html_errors' cols='60' rows='10' maxlength="2000">%mpr_body_html_errors%</textarea></td> </tr> <tr> <td><label for="mpr_body_html_warnings">Contenu HTML du mail, si warning :</label></td><td><textarea name='mpr_body_html_warnings' cols='60' rows='10' maxlength="2000">%mpr_body_html_warnings%</textarea></td> </tr> <tr> <td><label for="mpr_body_html_infos">Contenu HTML du mail, si pas d'erreur :</label></td><td><textarea name='mpr_body_html_infos' cols='60' rows='10' maxlength="2000">%mpr_body_html_infos%</textarea></td> </tr> <tr> <td><label for="mpr_report_html_header">Entête du bloc 'report':</label></td><td><textarea name='mpr_report_html_header' cols='60' rows='10' maxlength="2000">%mpr_report_html_header%</textarea></td> </tr> <tr> <td><label for="mpr_report_html_row">Ligne type du bloc 'report':</label></td><td><textarea name='mpr_report_html_row' cols='60' rows='10' maxlength="1000">%mpr_report_html_row%</textarea></td> </tr> <tr> <td><label for="mpr_report_html_footer">Pied du bloc 'report':</label></td><td><textarea name='mpr_report_html_footer' cols='60' rows='10' maxlength="2000">%mpr_report_html_footer%</textarea></td> </tr> <tr> <td><label for="mpr_create">Cr&eacute;&eacute; le</label></td><td>%mpr_create%&nbsp;</td> </tr> <tr> <td><label for="mpr_update">Modifi&eacute; le</label></td><td>%mpr_update%&nbsp;</td> </tr> <tr> <td><input type="submit" value="&gt;"></td><td>&nbsp;</td> </tr> </table> </form> </div> EOT

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

$_list_block_body

public mixed $_list_block_body = <<<EOT <tr> <form name="DeleteForm%_pk%" enctype="application/x-www-form-urlencoded" action="%url_rest_delete%" onSubmit="return AskforDeletion('%_pk%')" method="POST"> <td><input type="hidden" name="method" value="DELETE"><input type="hidden" name="redirect_referer" value="1">%input_for_delete%</td> </form> <form name="UpdateForm%_pk%" enctype="application/x-www-form-urlencoded" action="%url_update%" method="POST"> <td><input type="hidden" name="method" value="PUT"><input type="hidden" name="redirect_referer" value="1">%input_for_update%</td> </form> <form name="UpdateFormOnList%_pk%" enctype="application/x-www-form-urlencoded" action="%url_rest_update%" method="POST"> <td><input type="hidden" name="method" value="PUT"><input type="hidden" name="redirect_referer" value="1"><input type="submit" value="%mpr_pk%"></td> <td><input type="text" size="40" maxlength="40" name="mpr_code" value='%mpr_code%'></td> <td><input type="text" size="40" maxlength="40" name="mpr_name" value='%mpr_name%'></td> <td>%mpr_desc%</td> <td>%mpr_recipients%</td> <td>%mpc_name% (%mpc_code%)</td> <td>%mpr_pbe_count%</td> <td>%mpr_create%</td> <td>%mpr_update%</td> </form> </tr> EOT

$_list_block_header

public mixed $_list_block_header = <<<EOT <div> <table> <thead> <tr> <th>&nbsp;</th> <th>&nbsp;</th> <th>#</th> <th>Code</th> <th>Nom</th> <th>Description</th> <th>Destinataires</th> <th>Canvas</th> <th>Nb sondes</th> <th>Created on</th> <th>Updated on</th> </tr> </thead> <tfoot> <form name="AddForm" enctype="application/x-www-form-urlencoded" action="%url_rest_insert%" method="POST"> <input type="hidden" name="redirect_referer" value="1"> <tr> <td><input type="submit" value="+"></td> <td>&nbsp;</td> <td>&nbsp;</td> <td><input type="text" size="40" maxlength="40" name="mpr_code" value='%mpr_code%'></td> <td><input type="text" size="40" maxlength="100" name="mpr_name" value='%mpr_name%'></td> <td>%mpc_desc%</td> <td>&nbsp;</td> <td>%mpc_select%</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </form> </tfoot> <tbody> EOT

$_MPC_select

public mixed $_MPC_select = array('sql' => 'SELECT A.mpc_pk, A.mpc_code, A.mpc_name FROM mailprofilecanvas A ORDER BY A.mpc_code', 'key' => '', 'name' => 'mpc_pk', 'value' => 'mpc_pk', 'descr' => '%mpc_name% (%mpc_code%)', 'allow_null' => \TRUE)

$_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'

$_admin_api_token

protected static mixed $_admin_api_token = '{04F04C15-B0EB-483E-7056-C5B82772DB24}'
protected static mixed $_cookie_duration = 7200

$_url_rest_base

protected mixed $_url_rest_base = "http://webservices.magna-regula.cloud/index.php/"

$_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="&gt;">'

Methods

__construct()

public __construct([mixed $_parent = NULL ]) : mixed
Parameters
$_parent : mixed = NULL

_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
since

Unknown

access

public

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
since

Unknown

access

public

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_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

_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
since

Unknown

access

public

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_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

Very often used on sub-classes

Tags
since

Unknown

access

public

Return values
none

_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
since

Unknown

access

public

see
BaseModel::_insert()
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
since

Unknown

access

public

Return values
bool

YES/NO, it looks like a token

_match_includes()

public _match_includes(mixed $matches) : mixed
Parameters
$matches : 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

send a cookie equal to the api_token. Only for TRUSTED applications

public static _set_cookie_token() : none
Tags
since

Unknown

access

public

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
since

Unknown

access

public

see

MagnaRegulaModel::_update()q

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

deleteAction()

Perform action on DELETE verb.

public deleteAction(string $request) : array<string|int, mixed>
Parameters
$request : string

"Request" object

Tags
since

Unknown

access

public

see
BaseController::_delete()
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
since

Unknown

access

public

see
BaseController::load()
see
BaseController::tb_list()
see
BaseController::admin()
see
BaseController::load_by_key()
see
BaseController::$method()
Return values
array<string|int, mixed>

An array with 'error', 'message', 'row' or 'rows', ...

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
since

Unknown

access

public

see
BaseController::putAction()
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
since

Unknown

access

public

see
BaseController::_insert()
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
since

Unknown

access

public

see
BaseController::_update()
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
since

Unknown

access

public

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


        
On this page

Search results