Properties

$plugins

$plugins : array<mixed,\FAA\Interfaces\Plugin>

The plugin buffer

Type

array<mixed,\FAA\Interfaces\Plugin>

$hooks

$hooks : array

The hooks buffer

Type

array

$interfaces

$interfaces : array<mixed,\FAA\Obj\Endpoint>|array<mixed,object>

List of endpoints

Type

array<mixed,\FAA\Obj\Endpoint>|array<mixed,object>

Methods

KnownPlugins()

KnownPlugins() : array<mixed,\FAA\Interfaces\Plugin>

Get the known plugins

Returns

array<mixed,\FAA\Interfaces\Plugin>

Context()

Context(null  $context = null) : void|null|\FAA\Obj\Request|\FAA\Obj\CronJob

Get/Set the global context

Parameters

null $context

Returns

void|null|\FAA\Obj\Request|\FAA\Obj\CronJob

CallHook()

CallHook(string  $name,   $returns = false,   $parameter = null) : boolean

Call hook

Calls the interfaces and plugins that are registered on this hook

Available system hooks are:

OnClearAllCache Called when all system caches are cleared at once, has no given argument

OnIndex Called in search index cron job. Has a reference to the job and the list of indexed elements. $parameter contains the content type (ct), the list of changes (list) and the name of the plugin (handler)

OnNewIndex Called in Cache::RecreateIndex with list of files inside the storage folder.

OnSyncronize Called on sync. Gets the list of changed files based on the history buffer. Arguments are similar to OnNewIndex.

RequestOnUrlParsed Called in request constructor, can be used to modify the request itself and the parsed url. Has a reference to the request and the parsed url

OnGetEntityAttributes Called in entity attribute loader. Can be used to modify the whole entity object e.g. add custom fields or tabs.

OnLoadEntityFormPreset Called when using the widget method to get a content type preset. Call is Widget::loadEntityFormPreset $returns is the parsed content type object with resolved attributes.

OnRegisterWidgetIncludes Called on TemplateEngine::renderExtension. Gets as argument the includes list in $param->returns

OnBasketLoadFieldPresetStatus Called in Basket::LoadFieldPresetStatus. Gets as argument the list of available status switches in $param->returns These include a label, value and a set of fields

OnDeleteContent Called in BaseContent when successfully deleted. Gets a reference to the status object and the deleted object. State is referenced in $returns, the deleted object in $parameter

OnAddOrUpdateContent Called in BaseContent when successfully updated or, created. Gets a reference to the status object and the object. State is referenced in $returns, the changed object in $parameter

OnBeforeAddOrUpdateContent Called in base content right before the saver operation State is referenced in $returns, the changed object in $parameter

OnBeforeUserAdminSave Called before saving user data. Gets a reference to the users data payload.

OnUserAdminLoad Called in users widget, when loading own user data (loadSingle). Gets return data and the widget as argument. $returns contains the plain user object, $parameter is a reference to the user widget.

OnUserOwnLoad Called in users widget, when loading own user data (LoadOwn, SendGoogleAuthMail). Gets return data and the widget as argument. $returns contains the plain user object, $parameter is a reference to the user widget.

BasketChangeStatus Hook is called when basket status was changed successfully. $returns contains reference to a system result object. $parameter is an object with the basket instance in key 'basket' and the changes in key 'payload' plus the language

OnBeforeConvertBasketToTask Called right before converting basket to task, has information about the basket and the payload for the new task

OnInitTaskWidget Called in project tasks widget after preparation of data in init call The returns contains an array with the preset data, parameter is the original user request

OnPrepareSiteMapLinks Called in site map generator with returns as result object and $parameter filled with list of links

OnProjectLoadEmployeeRoles Called in project widget when loading employee roles, $returns is the list of roles

OnAfterSendMail Called after successful sending email

OnBeforeResendSendMail Called before sending email to customer (again)

OnAfterPermissionCheck Called in check access to directory, The argument is of type AccessHookArgument, the result a result

OnGetAccessList Called when fetching the user session as last step. Arguments are the response and the user object

OnAfterBasketRegisterUser Called in basket widget after registration of basket is done. Arguments are the result object and an array with user_id and payload as values

OnPreImportContents Called when executing the import cronjob Argument is a file entry after the unzip process

OnRenameFolder Called when renaming the folder by short attribute update or when moving it entirely Called with Result object as return and a FolderMoveHookArgument as parameter

OnDisplay404 Called right before serving the 404 page. Allows the plugins to do some checks before. Argument is the Request object, return is a result object.

OnAddOrUpdateTask Called in task widget on create or update of task Called with Result object as return and a Task as parameter

OnAddService Called on create new service Returns is a result object and param is class with relation and payload

OnCleanupGarbage Called in garbage collect cron job Called with Result object as return and a Job as parameter

OnGetLoginRedirectUrl Called in the getter for the redirect url after successful login Called with Result object as return and the original request url as parameter

OnAfterRelationDelete Called after relation was deleted Called with Result object as return and the combination of relation and content as parameter

OnExecuteSearchUser Call in user search handler Gets the result object nd the search parameters as arguments

OnGetSearchFieldsUser Called after fetch user fields for search The returns argument is the fields of the user

OnUserStatusChange Called after the user active status is change but before saving the user Param is array with user from and target status

OnAfterUserLoginByPassword Called after user password check, param is object with user, credentials and a found indication

OnAfterUserRegisterSession Called after session registration, this is the point where the user is actually logged in Param is the user object.

OnPreUserRegisterSession Called before session registration is done, param is the user object

OnMapArrayIncludes Called after static assets are parsed in template handling Param is the list of links and the result object

OnRenderLoginExtraPre / OnRenderLoginExtra Called on rendering the login template, Response my be usd to add an additional html content

OnAfterRestUserPassword Called after password reset, with arguments result and the user object

Parameters

string $name

Name of hook

$returns
$parameter

Returns

boolean

Plugin()

Plugin(string  $name) : \FAA\Interfaces\Plugin

Get plugin Get one of the registered plugins. This function uses the cache

Parameters

string $name

Get plugin instance

Returns

\FAA\Interfaces\Plugin

A plugin instance or null when not registered

SystemInformation()

SystemInformation(\FAA\Obj\Request  $request) 

Parameters

\FAA\Obj\Request $request

Is()

Is(string  $path, string  $method, boolean  $must_be_active = true) : \FAA\Obj\Endpoint

Check if request is REST interface call

Try to find a corresponding widget endpoint for the given path and method As of version 3.29.0, this works just for requests that start with "/api/" In addition the breakpoint will be the first hit and no longer the last one.

Parameters

string $path

The HTTP request path

string $method

The HTTP request method

boolean $must_be_active

Returns

\FAA\Obj\Endpoint

A system REST interface endpoint object or null

ServeRequest()

ServeRequest(\FAA\Obj\Endpoint  $endpoint, \FAA\Obj\Request  $request) 

Serve request Parse the given request execute registered function and send fitting http response

Parameters

\FAA\Obj\Endpoint $endpoint

A system REST endpoint object

\FAA\Obj\Request $request

A system request object

LoadInterfaceEndpoints()

LoadInterfaceEndpoints(string  $file, boolean  $plain = false) : array

List endpoints of one widget get merged list of available endpoints from storage file, this method is full ached

Parameters

string $file

Filename of searched widget

boolean $plain

Fetch plain or raw when set to false

Returns

array —

A list with all registered endpoints of the system

ListAllEndpoints()

ListAllEndpoints() : array

List REST interface endpoints Get merged list of available endpoints that are provided by widgets, this method is cached

Returns

array —

All registered endpoints of the system

ProvideInterfaceCss()

ProvideInterfaceCss() : string

get interface hide and show css creates a stylesheet with all elements a user is not allowed to see inside the gui, the rule set is not very restrictive and has no security aspact it is just a styling helper access rule evaluation is handled inside the interface endpoint handler itself

Returns

string —

a widget end point based hiding table of special elements

GetFullAccessList()

GetFullAccessList(\FAA\Obj\Generic\User  $user) : \FAA\Obj\Result

Get access list Get the whole users access list for all registered widgets, this method is cached

Parameters

\FAA\Obj\Generic\User $user

A system user object, is null for not logged users

Returns

\FAA\Obj\Result

A system result object

HasAccess()

HasAccess(\FAA\Obj\Generic\Widget  $widget, \FAA\Obj\Generic\User  $user, string  $op = 'call', boolean  $skip_root = false) : \FAA\Obj\Result

Check access permission on Test the access to certain end point of REST widget by specific user and level

Parameters

\FAA\Obj\Generic\Widget $widget

The REST widget

\FAA\Obj\Generic\User $user

A system user object, is null for not logged users

string $op

A registered widget callback

boolean $skip_root

Returns

\FAA\Obj\Result

A system result object

GetWidget()

GetWidget(string  $name, string  $language = null, boolean  $plain = true) : \FAA\Obj\Result

get single widget load a widget registry entry

Parameters

string $name

A registered widget name

string $language

A registered language token

boolean $plain

Load as plain or raw object when false

Returns

\FAA\Obj\Result

A system result object

DeletePlugin()

DeletePlugin(string  $id) : \FAA\Obj\Result

Delete plugin

Delete the plugin and deregister from whole handler setup. System plugins can be deleted in master system only

Parameters

string $id

The plugin id

Returns

\FAA\Obj\Result

CreatePlugin()

CreatePlugin(  $data) : \FAA\Obj\Result

Create a new plugin based on user defined data

Parameters

$data

Returns

\FAA\Obj\Result

CreateWidget()

CreateWidget(  $payload) : \FAA\Obj\Result

Register a new widget in the storage of system or user

Parameters

$payload

Returns

\FAA\Obj\Result

ListWidgets()

ListWidgets(string  $language = null, boolean  $plain = true) : \FAA\Obj\Result

get all interfaces fetch the list of registered interface classes

Parameters

string $language

A registered language token

boolean $plain

When set to false, return as list of instances

Returns

\FAA\Obj\Result

A system result object

ListWidgetNotifications()

ListWidgetNotifications(string  $language = null) : \FAA\Obj\Result

Get all notifications Fetch the list of registered notifications

Parameters

string $language

A registered language token

Returns

\FAA\Obj\Result

A system result object

GetInterfaces()

GetInterfaces() : array<mixed,\FAA\Obj\Endpoint>|array<mixed,object>

Get all interfaces

Fetch the list of registered interface classes This method is cached statically and uses the memory cache handler.

Returns

array<mixed,\FAA\Obj\Endpoint>|array<mixed,object> —

The list of system interface endpoints

ExtensionToWidget()

ExtensionToWidget(\FAA\Obj\Generic\Widget  $extension) : \FAA\Obj\Result

Get all interfaces Fetch the list of registered interface classes

Parameters

\FAA\Obj\Generic\Widget $extension

A system widget

Returns

\FAA\Obj\Result

A result object with widget when found

RegisterPlugins()

RegisterPlugins() 

Register plugins

Load the plugins from filesystem and register them for hook calling This function is cached.

getInterfacesFromDirectory()

getInterfacesFromDirectory(string  $dir) 

load and register interface endpoints loads all interfaces from the given storage folder and adds the containing interfaces to the internal buffer

Parameters

string $dir

Folder path to parse