![]() |
FRED™
3.0
FRED™: Framework for Rapid and Easy Development
|
Public Member Functions | |
| clientConfig () | |
| Public configuration. More... | |
| 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... | |
| actionRight ($action=null) | |
| Necessary right for an action. More... | |
| actions ($prefix=null) | |
| Available actions for current user. More... | |
Public Member Functions inherited from Component | |
| __construct ($fred, $config=null) | |
| __destruct () | |
| 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_STD = 'std' |
| 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... | |
| getAction () | |
| setCheckWidgets ($check_widgets) | |
| getConstraints () | |
| getName () | |
| getRight () | |
| setRights ($rights) | |
| getSecurityChecksIgnore () | |
| setSecurityChecksIgnore ($security_checks_ignore) | |
| getView () | |
| getWidgets () | |
| setWidgets ($value) | |
| _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 Member Functions inherited from Component | |
| done () | |
| getSession () | |
Protected Member Functions inherited from Thing | |
| publish ($property, $visibility=self::READABLE) | |
| Publish a property (or hide it again). More... | |
| alias ($alias, $property, $object=null) | |
| Define an alias for a property (of another object). More... | |
| configure ($config) | |
| Configure the object. 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,'fragment' => false,'pingAlive' => false,'clientError' => false,'featureHint' => false,'requestSocket' => false] | |
| Widgets to check per action (key = action; value = array with ID's of widget to check; null = default, otherwise all). More... | |
| $_action = null | |
| $_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... | |
| $_aliases = [] | |
| Alias properties (key = alias, value = [object,property]). More... | |
Definition at line 5 of file Controller.php.
|
protected |
Default getter if no specific setter is defined, and the property is also not published (readable).
| string | $key | Name of the property. |
Reimplemented from Thing.
Definition at line 614 of file Controller.php.
|
protected |
Default setter if no specific setter is defined, and the property is also not published (writeable).
| string | $key | Name of the property. |
| mixed | $value | Value for the property. |
Reimplemented from Thing.
Definition at line 618 of file Controller.php.
|
protected |
Log client-side errors.
Definition at line 319 of file Controller.php.
|
protected |
Default action (if no action specified).
Definition at line 292 of file Controller.php.
|
protected |
Return a feature hint translation.
Definition at line 343 of file Controller.php.
|
protected |
Return a fragment from the view.
Definition at line 297 of file Controller.php.
|
protected |
Ping to keep the session alive.
Definition at line 303 of file Controller.php.
|
protected |
Request a socket.
Definition at line 350 of file Controller.php.
| actionRight | ( | $action = null | ) |
Necessary right for an action.
| string | $action |
Definition at line 521 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 536 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 83 of file Controller.php.
|
protected |
Add a widget by type.
Definition at line 129 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 197 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 364 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 150 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 160 of file Controller.php.
|
protected |
Add a single widget.
| string | $id | Widget ID. |
| Rsi\Fred\Controller\Widget | $widget |
Definition at line 102 of file Controller.php.
|
protected |
Add multiple widgets.
| array | $widgets | Key = ID, value = widget. |
Definition at line 110 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 377 of file Controller.php.
| caption | ( | $id | ) |
Default caption for a widget.
| string | $id | Widget ID. |
Definition at line 272 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 396 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 457 of file Controller.php.
| clientConfig | ( | ) |
Public configuration.
Reimplemented from Component.
Definition at line 66 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 168 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 177 of file Controller.php.
|
protected |
Remove one or more widget(s).
| string | $ids,... | Widget ID('s). |
Definition at line 185 of file Controller.php.
|
protected |
Definition at line 58 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 474 of file Controller.php.
| expect | ( | $id, | |
| $action | |||
| ) |
Note if an action is expected.
| string | $id | Widget ID. |
| string | $action |
Definition at line 219 of file Controller.php.
| expected | ( | $id, | |
| $action | |||
| ) |
Was the action expected?
| string | $id | Widget ID. |
| string | $action |
Definition at line 230 of file Controller.php.
|
protected |
Definition at line 546 of file Controller.php.
|
protected |
Definition at line 555 of file Controller.php.
|
protected |
Definition at line 560 of file Controller.php.
|
protected |
Definition at line 566 of file Controller.php.
|
protected |
Definition at line 574 of file Controller.php.
|
protected |
Definition at line 584 of file Controller.php.
|
protected |
Definition at line 601 of file Controller.php.
| hint | ( | $id | ) |
Default hint for a widget.
| string | $id | Widget ID or type. |
Definition at line 280 of file Controller.php.
|
protected |
Reimplemented from Component.
Definition at line 52 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 261 of file Controller.php.
|
protected |
Remove an authentication check from all sets.
| string | $name | Authentication check name. |
Definition at line 92 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 211 of file Controller.php.
| route | ( | $type = null, |
|
$params = null |
|||
| ) |
Route to this controller.
| string | $type | |
| array | $params | Extra params. |
Definition at line 250 of file Controller.php.
| routeParams | ( | ) |
Parameters for the route to this controller.
Definition at line 241 of file Controller.php.
|
protected |
Definition at line 551 of file Controller.php.
|
protected |
Definition at line 570 of file Controller.php.
|
protected |
Definition at line 580 of file Controller.php.
|
protected |
Definition at line 609 of file Controller.php.
|
protected |
Unknwon action called.
Definition at line 286 of file Controller.php.
|
protected |
Create a widget by type.
| string | $type | Widget type (class name). |
| string | $config | Configuration. |
Definition at line 119 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 139 of file Controller.php.
|
protected |
Definition at line 47 of file Controller.php.
|
protected |
Possible sets of necessary authentication (array of arrays of authentication checks).
Definition at line 40 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 44 of file Controller.php.
|
protected |
Definition at line 49 of file Controller.php.
|
protected |
Necessary right needed per action (key = action, null = default; value = right, optionally.
Definition at line 41 of file Controller.php.
|
protected |
Security checks to ignore (key = action, null = default; value = array with.
Definition at line 38 of file Controller.php.
|
protected |
Definition at line 50 of file Controller.php.
|
protected |
Definition at line 48 of file Controller.php.
| $clientErrorBanDelay = 10 |
Ban delay for the first error in a new session (prevent flooding via multiple.
Definition at line 34 of file Controller.php.
| $clientErrorMax = 25 |
Maximum number of client errors to log in one session.
Definition at line 36 of file Controller.php.
| $clientErrorPrio = null |
Log client errors with this prio (empty = do not log).
Definition at line 33 of file Controller.php.
| $defaultCaption = null |
An asterisk will be replaced with widget ID.
Definition at line 26 of file Controller.php.
| $defaultHint = null |
An asterisk will be replaced with the widget ID or type.
Definition at line 27 of file Controller.php.
| $defaultViewNamespace = __CLASS__ . '\\View' |
Definition at line 20 of file Controller.php.
| $defaultViewType = 'html' |
Definition at line 21 of file Controller.php.
| $defaultWidgetNamespace = __CLASS__ . '\\Widget' |
Definition at line 19 of file Controller.php.
| $display = Controller\Widget::DISPLAY_WRITEABLE |
Default display mode for widgets.
Definition at line 25 of file Controller.php.
| $domainRedir = [] |
Prefered domain notation (key = domain mask regex, value = prefered domain, incl. protocol).
Definition at line 17 of file Controller.php.
| $domainRedirPermanent = false |
True to make a redirection permanent (HTTP status code = 301; defaults to 302).
Definition at line 18 of file Controller.php.
Definition at line 29 of file Controller.php.
| $fragmentId = null |
Definition at line 23 of file Controller.php.
| $helpCaption = 'Help' |
Definition at line 28 of file Controller.php.
| $inactiveMessage = '[@inactiveMessage]' |
Message for inactive user who is redirected to login controller.
Definition at line 31 of file Controller.php.
| $viewClassName = null |
Fix the view to a certain View or Controller class (empty = same as called class).
Definition at line 22 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 11 of file Controller.php.
| const TOTAL_MIN = 'min' |
Definition at line 12 of file Controller.php.
| const TOTAL_NOT_NULL = 'not_null' |
Definition at line 15 of file Controller.php.
| const TOTAL_NULL = 'null' |
Definition at line 14 of file Controller.php.
| const TOTAL_STD = 'std' |
Definition at line 10 of file Controller.php.
| const TOTAL_SUM = 'sum' |
Definition at line 8 of file Controller.php.
| const TOTAL_UNIQUE = 'unique' |
Definition at line 13 of file Controller.php.