FRED™
3.0
FRED™: Framework for Rapid and Easy Development
|
Public Member Functions | |
clientConfig () | |
reset () | |
Reset the controller. More... | |
expect ($id, $action) | |
Note if an action is expected. More... | |
expected ($id, $action) | |
Was the action expected? More... | |
routeParams () | |
Parameters for the route to this controller. More... | |
route ($type=null, $params=null) | |
Route to this controller. More... | |
redir ($levels=1, $suffix=null, $params=null) | |
Navigate to another controller. More... | |
caption ($id) | |
Default caption for a widget. More... | |
hint ($id) | |
Default hint for a widget. More... | |
arrayTotal ($values, $type) | |
Calculate the total for an array. More... | |
execute () | |
Execute the action (if specified) on the controller. More... | |
actions ($prefix=null) | |
Available actions for current user. More... | |
Public Member Functions inherited from Component | |
__construct ($fred, $config=null) | |
__destruct () | |
clientConfig () | |
Public configuration. More... | |
config ($key, $default=null) | |
Retrieve a config value. More... | |
ping () | |
Ping function. More... | |
filemtime ($filename) | |
Filemtime with session cache. More... | |
component ($name) | |
Get a component (local or default). More... | |
components (... $names) | |
Get multiple components in an array. More... | |
Public Member Functions inherited from Thing | |
propertyExists ($property) | |
Check if a property exists (public or published). More... | |
constants ($prefix=null) | |
Return all constants. More... | |
get ($key) | |
Get one or more properties. More... | |
set ($key, $value=null) | |
Set one or more properties. More... | |
__get ($key) | |
__set ($key, $value) | |
Data Fields | |
const | TOTAL_COUNT = 'count' |
const | TOTAL_SUM = 'sum' |
const | TOTAL_AVG = 'avg' |
const | TOTAL_MAX = 'max' |
const | TOTAL_MIN = 'min' |
const | TOTAL_UNIQUE = 'unique' |
const | TOTAL_NULL = 'null' |
const | TOTAL_NOT_NULL = 'not_null' |
$domainRedir = [] | |
Prefered domain notation (key = domain mask regex, value = prefered domain, incl. protocol). More... | |
$domainRedirPermanent = false | |
True to make a redirection permanent (HTTP status code = 301; defaults to 302). More... | |
$defaultWidgetNamespace = __CLASS__ . '\\Widget' | |
$defaultViewNamespace = __CLASS__ . '\\View' | |
$defaultViewType = 'html' | |
$viewClassName = null | |
Fix the view to a certain View or Controller class (empty = same as called class). More... | |
$fragmentId = null | |
$display = Controller\Widget::DISPLAY_WRITEABLE | |
Default display mode for widgets. More... | |
$defaultCaption = null | |
An asterisk will be replaced with widget ID. More... | |
$defaultHint = null | |
An asterisk will be replaced with the widget ID or type. More... | |
$helpCaption = 'Help' | |
$errorStr = '[caption]{[!caption]{[id]}}: [error]' | |
$inactiveMessage = '[@inactiveMessage]' | |
Message for inactive user who is redirected to login controller. More... | |
$clientErrorPrio = null | |
Log client errors with this prio (empty = do not log). More... | |
$clientErrorBanDelay = 10 | |
Ban delay for the first error in a new session (prevent flooding via multiple. More... | |
$clientErrorMax = 25 | |
Maximum number of client errors to log in one session. More... | |
Data Fields inherited from Component | |
$filemtimeTtl = 0 | |
Data Fields inherited from Thing | |
const | HIDDEN = 0 |
Property is hidden. More... | |
const | READABLE = 1 |
Property is readable. More... | |
const | WRITEABLE = 2 |
Property is writeable. More... | |
const | READWRITE = 3 |
Property is readable and writeable. More... | |
Protected Member Functions | |
init () | |
domainRedir () | |
addAuth ($name) | |
Add an authentication check to all sets, or create a new one if none exists. More... | |
removeAuth ($name) | |
Remove an authentication check from all sets. More... | |
addWidget ($id, $widget) | |
Add a single widget. More... | |
addWidgets ($widgets) | |
Add multiple widgets. More... | |
widgetByType ($type, $config) | |
Create a widget by type. More... | |
addByType ($id, $type, $config) | |
Add a widget by type. More... | |
widgetFromDef ($table, $column, $extra=null) | |
Create a widget from a database definition. More... | |
addFromDef ($table, $columns=null, $extra=null, $prefix=null) | |
Add widgets from a database definition. More... | |
addFromRecord ($record, $prefix=null) | |
Add widgets from a definition record. More... | |
dataFromRecord ($record, $prefix=null) | |
Copy data from a definition record to the request. More... | |
dataToRecord ($record, $prefix=null) | |
Copy data from the request to a definition record. More... | |
deleteWidget (... $ids) | |
Remove one or more widget(s). More... | |
addConstraint ($ids, $operator,$group=null, $total=null) | |
Add a constraint. More... | |
initWidgets () | |
Initialize the widgets. More... | |
unkownAction () | |
Unknwon action called. More... | |
actionDefault () | |
Default action (if no action specified). More... | |
actionFragment () | |
Return a fragment from the view. More... | |
actionPingAlive () | |
Ping to keep the session alive. More... | |
actionClientError () | |
Log client-side errors. More... | |
actionFeatureHint () | |
Return a feature hint translation. More... | |
actionRequestSocket () | |
Request a socket. More... | |
addError ($id, $error) | |
Add an error to the request. More... | |
checkConstraint ($widget_ids, $ids, $operator,$group=null, $total=null) | |
Check a constraint. More... | |
checkWidgets ($ids=null) | |
Check widget values. More... | |
actionRight ($action) | |
Necessary right for an action. More... | |
getAction () | |
setCheckWidgets ($check_widgets) | |
getConstraints () | |
getName () | |
getRight () | |
setRights ($rights) | |
getSecurityChecksIgnore () | |
setSecurityChecksIgnore ($security_checks_ignore) | |
getView () | |
getWidgets () | |
setWidgets ($value) | |
_get ($key) | |
_set ($key, $value) | |
Protected Member Functions inherited from Component | |
init () | |
done () | |
getSession () | |
Protected Member Functions inherited from Thing | |
publish ($property, $visibility=self::READABLE) | |
Publish a property (or hide it again). More... | |
configure ($config) | |
Configure the object. More... | |
_get ($key) | |
Default getter if no specific setter is defined, and the property is also not published (readable). More... | |
_set ($key, $value) | |
Default setter if no specific setter is defined, and the property is also not published (writeable). More... | |
Protected Attributes | |
$_securityChecksIgnore = [] | |
Security checks to ignore (key = action, null = default; value = array with. More... | |
$_authSets = [] | |
Possible sets of necessary authentication (array of arrays of authentication checks). More... | |
$_rights = [] | |
Necessary right needed per action (key = action, null = default; value = right, optionally. More... | |
$_checkWidgets = ['default' => false | |
$_action = null | |
Widgets to check per action (key = action; value = array with ID's of widget to check; null = default, otherwise all). More... | |
$_widgets = null | |
$_constraints = null | |
$_view = null | |
Protected Attributes inherited from Component | |
$_fred = null | |
$_config = null | |
$_name = null | |
$_components = [] | |
Local components (key = component name, value = component). More... | |
$_session = null | |
Protected Attributes inherited from Thing | |
$_published = [] | |
Published properties (key = name of property, value = visibility). More... | |
Definition at line 5 of file Controller.php.
|
protected |
Definition at line 609 of file Controller.php.
|
protected |
Definition at line 613 of file Controller.php.
|
protected |
Log client-side errors.
Definition at line 316 of file Controller.php.
|
protected |
Default action (if no action specified).
Definition at line 289 of file Controller.php.
|
protected |
Return a feature hint translation.
Definition at line 340 of file Controller.php.
|
protected |
Return a fragment from the view.
Definition at line 294 of file Controller.php.
|
protected |
Ping to keep the session alive.
Definition at line 300 of file Controller.php.
|
protected |
Request a socket.
Definition at line 347 of file Controller.php.
|
protected |
Necessary right for an action.
string | $action |
Definition at line 516 of file Controller.php.
actions | ( | $prefix = null | ) |
Available actions for current user.
string | $prefix | Prefix where the action name has to start with. |
Definition at line 531 of file Controller.php.
|
protected |
Add an authentication check to all sets, or create a new one if none exists.
string | $name | Authentication check name. |
Definition at line 80 of file Controller.php.
|
protected |
Add a widget by type.
Definition at line 126 of file Controller.php.
|
protected |
Add a constraint.
array | $ids | Widgets involved (an asterisk will be replaced with the current index during checking, '–' with the previous index, '++' with the next). Widgets that are empty (nothing) are ignored. |
string | $operator | Like used with \Rsi\Str::operator(). |
string | $group | Group widget values (use TOTAL_* constants), rather than checking them one-by-one. |
number | $total | Grouping reference value. Set to true to make this equal to the number of values. |
Definition at line 194 of file Controller.php.
|
protected |
Add an error to the request.
string | $id | ID of the widget involved. |
string | $error | Error type. |
Definition at line 361 of file Controller.php.
|
protected |
Add widgets from a database definition.
string | $table | Name of the table. |
string | array | $columns | One or more column names (all table columns when empty). |
array | $extra | Extra configuration to add to the definition. |
string | $prefix | Prefix to add to the column name for the widget ID. |
Definition at line 147 of file Controller.php.
|
protected |
Add widgets from a definition record.
Rsi\Fred\Def\Record | $record | Definition record. |
string | $prefix | Prefix to add to the column name for the widget ID. |
Definition at line 157 of file Controller.php.
|
protected |
Add a single widget.
string | $id | Widget ID. |
Rsi\Fred\Controller\Widget | $widget |
Definition at line 99 of file Controller.php.
|
protected |
Add multiple widgets.
array | $widgets | Key = ID, value = widget. |
Definition at line 107 of file Controller.php.
arrayTotal | ( | $values, | |
$type | |||
) |
Calculate the total for an array.
array | $values | Array with values (string or numeric). |
string | $type | Type of total (see TOTAL_* constants). |
Definition at line 374 of file Controller.php.
caption | ( | $id | ) |
Default caption for a widget.
string | $id | Widget ID. |
Definition at line 269 of file Controller.php.
|
protected |
Check a constraint.
array | $widget_ids | Widgets in the action. |
array | $ids | Widgets involved. |
string | $operator | Like used with \Rsi\Str::operator(). |
string | $group | Group widget values (use TOTAL_* constants), rather than checking them one-by-one. |
number | $total | Grouping reference value. |
Definition at line 393 of file Controller.php.
|
protected |
Check widget values.
Widget data is taken from the request data array. Errors are added to the request.
array | $ids | Widgets to check (empty = all). |
Definition at line 454 of file Controller.php.
clientConfig | ( | ) |
Definition at line 65 of file Controller.php.
|
protected |
Copy data from a definition record to the request.
Rsi\Fred\Def\Record | $record | Definition record. |
string | $prefix | Prefix to add to the column name for the widget ID. |
Definition at line 165 of file Controller.php.
|
protected |
Copy data from the request to a definition record.
Rsi\Fred\Def\Record | $record | Definition record. |
string | $prefix | Prefix to add to the column name for the widget ID. |
Definition at line 174 of file Controller.php.
|
protected |
Remove one or more widget(s).
string | $ids,... | Widget ID('s). |
Definition at line 182 of file Controller.php.
|
protected |
Definition at line 57 of file Controller.php.
execute | ( | ) |
Execute the action (if specified) on the controller.
Security checks are executed before. All input and output is handled through the request component. An action can only trust the values from the data array. If the value is not present, the user is not authorized to modify it. All other values must be checked.
Definition at line 471 of file Controller.php.
expect | ( | $id, | |
$action | |||
) |
Note if an action is expected.
string | $id | Widget ID. |
string | $action |
Definition at line 216 of file Controller.php.
expected | ( | $id, | |
$action | |||
) |
Was the action expected?
string | $id | Widget ID. |
string | $action |
Definition at line 227 of file Controller.php.
|
protected |
Definition at line 541 of file Controller.php.
|
protected |
Definition at line 550 of file Controller.php.
|
protected |
Definition at line 555 of file Controller.php.
|
protected |
Definition at line 561 of file Controller.php.
|
protected |
Definition at line 569 of file Controller.php.
|
protected |
Definition at line 579 of file Controller.php.
|
protected |
Definition at line 596 of file Controller.php.
hint | ( | $id | ) |
Default hint for a widget.
string | $id | Widget ID or type. |
Definition at line 277 of file Controller.php.
|
protected |
Definition at line 51 of file Controller.php.
|
protected |
redir | ( | $levels = 1 , |
|
$suffix = null , |
|||
$params = null |
|||
) |
Navigate to another controller.
int | $levels | Number of levels to go up. |
string | $suffix | Suffix to add. |
bool | array | $params | Parameters for the controller (set to false to only change the view controller name). |
Definition at line 258 of file Controller.php.
|
protected |
Remove an authentication check from all sets.
string | $name | Authentication check name. |
Definition at line 89 of file Controller.php.
reset | ( | ) |
Reset the controller.
Called when the same controller is used for both the handling of the request ('post') and the view. Use this to perform actions between those two events.
Definition at line 208 of file Controller.php.
route | ( | $type = null , |
|
$params = null |
|||
) |
Route to this controller.
string | $type | |
array | $params | Extra params. |
Definition at line 247 of file Controller.php.
routeParams | ( | ) |
Parameters for the route to this controller.
Definition at line 238 of file Controller.php.
|
protected |
Definition at line 546 of file Controller.php.
|
protected |
Definition at line 565 of file Controller.php.
|
protected |
Definition at line 575 of file Controller.php.
|
protected |
Definition at line 604 of file Controller.php.
|
protected |
Unknwon action called.
Definition at line 283 of file Controller.php.
|
protected |
Create a widget by type.
string | $type | Widget type (class name). |
string | $config | Configuration. |
Definition at line 116 of file Controller.php.
|
protected |
Create a widget from a database definition.
string | $table | Name of the table. |
string | $column | Column name. |
array | $extra | Extra configuration to add to the definition. |
Definition at line 136 of file Controller.php.
|
protected |
Widgets to check per action (key = action; value = array with ID's of widget to check; null = default, otherwise all).
Definition at line 46 of file Controller.php.
|
protected |
Possible sets of necessary authentication (array of arrays of authentication checks).
Definition at line 39 of file Controller.php.
|
protected |
Definition at line 43 of file Controller.php.
|
protected |
Definition at line 48 of file Controller.php.
|
protected |
Necessary right needed per action (key = action, null = default; value = right, optionally.
Definition at line 40 of file Controller.php.
|
protected |
Security checks to ignore (key = action, null = default; value = array with.
Definition at line 37 of file Controller.php.
|
protected |
Definition at line 49 of file Controller.php.
|
protected |
Definition at line 47 of file Controller.php.
$clientErrorBanDelay = 10 |
Ban delay for the first error in a new session (prevent flooding via multiple.
Definition at line 33 of file Controller.php.
$clientErrorMax = 25 |
Maximum number of client errors to log in one session.
Definition at line 35 of file Controller.php.
$clientErrorPrio = null |
Log client errors with this prio (empty = do not log).
Definition at line 32 of file Controller.php.
$defaultCaption = null |
An asterisk will be replaced with widget ID.
Definition at line 25 of file Controller.php.
$defaultHint = null |
An asterisk will be replaced with the widget ID or type.
Definition at line 26 of file Controller.php.
$defaultViewNamespace = __CLASS__ . '\\View' |
Definition at line 19 of file Controller.php.
$defaultViewType = 'html' |
Definition at line 20 of file Controller.php.
$defaultWidgetNamespace = __CLASS__ . '\\Widget' |
Definition at line 18 of file Controller.php.
$display = Controller\Widget::DISPLAY_WRITEABLE |
Default display mode for widgets.
Definition at line 24 of file Controller.php.
$domainRedir = [] |
Prefered domain notation (key = domain mask regex, value = prefered domain, incl. protocol).
Definition at line 16 of file Controller.php.
$domainRedirPermanent = false |
True to make a redirection permanent (HTTP status code = 301; defaults to 302).
Definition at line 17 of file Controller.php.
Definition at line 28 of file Controller.php.
$fragmentId = null |
Definition at line 22 of file Controller.php.
$helpCaption = 'Help' |
Definition at line 27 of file Controller.php.
$inactiveMessage = '[@inactiveMessage]' |
Message for inactive user who is redirected to login controller.
Definition at line 30 of file Controller.php.
$viewClassName = null |
Fix the view to a certain View or Controller class (empty = same as called class).
Definition at line 21 of file Controller.php.
const TOTAL_AVG = 'avg' |
Definition at line 9 of file Controller.php.
const TOTAL_COUNT = 'count' |
Definition at line 7 of file Controller.php.
const TOTAL_MAX = 'max' |
Definition at line 10 of file Controller.php.
const TOTAL_MIN = 'min' |
Definition at line 11 of file Controller.php.
const TOTAL_NOT_NULL = 'not_null' |
Definition at line 14 of file Controller.php.
const TOTAL_NULL = 'null' |
Definition at line 13 of file Controller.php.
const TOTAL_SUM = 'sum' |
Definition at line 8 of file Controller.php.
const TOTAL_UNIQUE = 'unique' |
Definition at line 12 of file Controller.php.