$plugins
$plugins :array<mixed,\FAA\Interfaces\Plugin>
The plugin buffer
$plugins :array<mixed,\FAA\Interfaces\Plugin>
The plugin buffer
$context :null|\FAA\Obj\Request|\FAA\Obj\CronJob
Storage for current global context
KnownPlugins(): array<mixed,\FAA\Interfaces\Plugin>
Get the known plugins
Context(null $context = null): void|null|\FAA\Obj\Request|\FAA\Obj\CronJob
Get/Set the global context
null | $context |
CallHook(string $name, $returns = false, $parameter = null): boolean
Call hook
Calls the interfaces and plugins that are registered on this hook
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
string | $name | Name of hook |
$returns | ||
$parameter |
Plugin(string $name): \FAA\Interfaces\Plugin
Get plugin Get one of the registered plugins. This function uses the cache
string | $name | Get plugin instance |
A plugin instance or null when not registered
SystemInformation(\FAA\Obj\Request $request)
\FAA\Obj\Request | $request |
ServeRequest(string $path,\FAA\Obj\Request $request)
serve request parse the given request and send fitting http response
string | $path | Virtual directory folder path |
\FAA\Obj\Request | $request | A system request object |
Render503(\FAA\Obj\Request $request): \FAA\Obj\Response
Handle the 503 response
\FAA\Obj\Request | $request |
Display404(string $path,\FAA\Obj\Request $request)
Show 404 page
Display a not found response, does different output per http/ajax request Hs a hook provided as last resort that allows plugins to do some checks before display the 404
string | $path | The requested path |
\FAA\Obj\Request | $request | A system request object |
HasAccess(string $path,\FAA\Obj\Generic\User $user,string $op = 'view',integer $relation): \FAA\Obj\Result
Test if has access Test access permission on folder by specific user and level
string | $path | Virtual directory folder path |
\FAA\Obj\Generic\User | $user | A system user object, is null for not logged users |
string | $op | A registered system operation |
integer | $relation | The relation id |
A default system result object
CheckAccess(\FAA\Obj\Generic\Folder $folder,\FAA\Obj\Generic\User $user,string $op = 'view',integer $relation): \FAA\Obj\Result
Check access helper function Check access permission on folder by specific user and level Has a call to the post check hook that can be used for extended validations. e.g. for a details subscription
\FAA\Obj\Generic\Folder | $folder | Virtual directory folder |
\FAA\Obj\Generic\User | $user | A system user object, is null for not logged users |
string | $op | A registered system operation |
integer | $relation | The relation id |
A default system result object
OptimizedLinkToPath(string $link,string $dom = ''): \FAA\Obj\Search\Response\Link|null
Resolve link Back resolve a optimized link
string | $link | The path to resolve |
string | $dom | Additional domain filter |
The link object or null, when not registered
PathToOptimizedLink(string $language,string $folder,string|\FAA\Obj\Domain $domain = '__',boolean $no_default = false): string
create optimized link get a optimized link based on the given language and the base folder.
This method is locally cached
string | $language | A system language identifier |
string | $folder | A system folder identifier |
string|\FAA\Obj\Domain | $domain | A system domain identifier or null |
boolean | $no_default | When set, do not return the default link |
A optimized link or the default link expression
GetDomain(string|integer $id = null): \FAA\Obj\Domain|null
Get domain
Get a single domain setup by id, when the id is falsy the first one will be returned Search can be a number or a string
string|integer | $id | An index or, a domain id |
The found domain or null
ResolveDomain( $host,boolean $ignore_state = false): \FAA\Obj\Domain|null
Resolve hostname/FQDN to system domain
$host | ||
boolean | $ignore_state |
DisplayLogin(string $path,\FAA\Obj\Request $request): \FAA\Obj\Result
display login form provide the registered template login formular
string | $path | Path to system folder tree entry |
\FAA\Obj\Request | $request | A system http request object |
A system result object
FetchRelations(\FAA\Obj\Generic\FolderTree $folder,string $language,boolean $plain = true): array<mixed,\FAA\Obj\Generic\Relation>|array<mixed,\stdClass>
Fetch relations
Load relation contents using search and resolve them by template positions if defined. Can be used to resolve as object or as relation instance.
\FAA\Obj\Generic\FolderTree | $folder | A folder tree object |
string | $language | The request language for resolving |
boolean | $plain | When set to true, convert the relation to raw object |
A list of relations
Display(string $path,\FAA\Obj\Request $request): \FAA\Obj\Result
Display rendered template
Provide the rendered template encapsulated as result object values Render all contents of the given path using the linked template and assigned contents. Will use Hook::CustomContentList of template when defined and registered in folder configuration.
string | $path | Path to system folder tree entry |
\FAA\Obj\Request | $request | A system http request object |
A system result object
GetFolderObject(string $path,string $language = null,boolean $as_folder = false): \FAA\Obj\Generic\FolderTree|\FAA\Obj\Generic\Folder
get a folder use a system path to get the corresponding folder
string | $path | Virtual directory folder path |
string | $language | The request language code |
boolean | $as_folder | As folder object |
A system folder object with folder when found
GetFolder(string $path,string $language = null,boolean $as_folder = false): \FAA\Obj\Result
Get a folder
Use a system path to get the corresponding folder. The given path must be relative to the storage folder
string | $path | A virtual directory folder path (tarting /and starting "folder/" will be removed, trailing / will be added |
string | $language | The request language code for resolving properties |
boolean | $as_folder | As folder object |
A system result object with folder when found
GetFolderTreeElement(string $path,string $language = null): \stdClass
get a folder element use a system path to get the corresponding folder
string | $path | Virtual directory folder path |
string | $language | The request language code |
A system folder tree element or null when not found
GetFolderTreeRoots(string $language = null,string $root = ''): array<mixed,Object>
get the folder tree root nodes get the full featured recursive folder tree, this method is cached
string | $language | The request language code |
string | $root | An alternative folder start point |
A plain list of serialized folder entries
GetFolderTreeElements(string $language = null,string $root = '',boolean $full = false): mixed|array<mixed,\FAA\Obj\Generic\FolderTree>
get the folder tree get the full featured recursive folder tree, this method is cached
string | $language | The request language code |
string | $root | An alternative folder start point |
boolean | $full | When set to true, return with content relations |
A recursive folder tree object list
DeleteRelation(integer $id,string $path,boolean $with_content = false,string $type = 'content'): \FAA\Obj\Result
Delete relation Delete a single content or extension relation from folder by given id.
integer | $id | A relation primary id |
string | $path | Relative parent folder path |
boolean | $with_content | When content and true delete the content itself |
string | $type | The type: content or relation |
A system result object
UpdateRelation(integer $id,string $path,array $payload,array $content_data = null): \FAA\Obj\Result
Change relation Update a content relation and when defined, also the assigned content.
integer | $id | A relation primary id |
string | $path | Relative parent folder path |
array | $payload | The relation definition |
array | $content_data | The content data for direct content assignment |
A system result object
HandleMultipleAssignments(array $payload): \FAA\Obj\Result
Handle multiple assignment
Handle the assignment of contents to a certain contents attribute. For example an articles multiple images attribute
array | $payload | Set of content data with configuration content.type string The content type content.id int The content id files array Set of uploaded files with path and name attribute string Name of the attribute to assign to data_type string The type of asset to create |
A system result object
HandleMultipleUploads(\FAA\Obj\Generic\FolderTree $folder,array $payload,boolean $no_clear = false): \FAA\Obj\Result
Handle uploads
Handle uploads of multiple assets and assignments to folder
\FAA\Obj\Generic\FolderTree | $folder | The target folder |
array | $payload | Configuration object files array List of fields with path, target template position and name data_type string The type of asset to create path string The target folder path |
boolean | $no_clear | When set, do not delete the source folder afterwards |
A system result object
RegisterExistingContent(string $path,array $payload,\FAA\Obj\Generic\BaseContent $object): \FAA\Obj\Result
Assign content to folder
string | $path | Path to storage folder |
array | $payload | The content relation |
\FAA\Obj\Generic\BaseContent | $object | A system object |
A default system result object
RegisterRelation(string $type,string $path,array $payload,array $content_data = null,mixed $filter_types = null): \FAA\Obj\Result
Register a new relation Adds a new relation to a content into an existing virtual folder
string | $type | The content type name, lowercase |
string | $path | The content relation virtual parent folder path (relative) |
array | $payload | The content relation |
array | $content_data | The content or null for empty content |
mixed | $filter_types | Alternative list of filter content types |
A default system result object
resolveErrorTemplate(\FAA\Obj\Request $request, $code): \FAA\Obj\Result
\FAA\Obj\Request | $request | |
$code |
filterFetchRelations(\FAA\Obj\Generic\FolderTree $folder,array<mixed,\FAA\Obj\Search\Filter> $filters,array $sort,string $language,boolean $plain): array
Find a set of relations in a certain folder defined by filter set
\FAA\Obj\Generic\FolderTree | $folder | The folder tree object |
array<mixed,\FAA\Obj\Search\Filter> | $filters | A list of filters |
array | $sort | A set of sort arguments |
string | $language | The language key |
boolean | $plain | When set to true, convert the relation to raw object |
A list of found relations either plain or as object
postProcessDisplay(\FAA\Obj\Request $request,object $hook,string $html,\FAA\Obj\Generic\Folder $folder)
Post process
Apply post processing methods to given element
\FAA\Obj\Request | $request | A request object |
object | $hook | A hook object |
string | $html | The preprocessed html |
\FAA\Obj\Generic\Folder | $folder | Uses maximum cache level |
execCopyMoveRelation(string $mode,integer $id,array $data,boolean $no_check = false): \FAA\Obj\Result
Move or, copy a relation with content
Support moving/copy of single extension or, relation to new or same parent folder. Can change the order and the position during this process.
By default it will check if the current users has the permission in the corresponding folders, for move a source edit and a target add is needed, for copy a read and add are required
string | $mode | Either cove or, copy |
integer | $id | The id of the source relation |
array | $data | The new data with target folder and settings like order, position string [folder] The target folder, relative to folder/ string [position] The new position int [order] The new sort order |
boolean | $no_check |
A system result object