Properties

$domcfg

$domcfg : string

storage location of domain setup

Type

string

$relations

$relations : array

Buffer tree This is the local storage of relation elements

Type

array — A list of relation elements

$link_cache

$link_cache : array

Buffer The resolved links buffer

Type

array — A list of resolved links

$resolver_link_cache

$resolver_link_cache : array

Buffer The resolved links buffer

Type

array — A list of resolved links

$plugins

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

The plugin buffer

Type

array<mixed,\FAA\Interfaces\Plugin>

$hooks

$hooks : array

The hooks buffer

Type

array

Methods

Is()

Is(string  $path) : boolean

test if path is valid virtual directory this function can't resolve bot opt links, they must be mapped before

Parameters

string $path

Virtual directory folder path

Returns

boolean —

Indicator whether this is a valid virtual or not

ServeRequest()

ServeRequest(string  $path, \FAA\Obj\Request  $request) 

serve request parse the given request and send fitting http response

Parameters

string $path

Virtual directory folder path

\FAA\Obj\Request $request

A system request object

Display404()

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

Parameters

string $path

The requested path

\FAA\Obj\Request $request

A system request object

HasAccess()

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

Parameters

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

Returns

\FAA\Obj\Result

A default system result object

CheckAccess()

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

Parameters

\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

Returns

\FAA\Obj\Result

A default system result object

OptimizedLinkToPath()

OptimizedLinkToPath(string  $link, string  $dom = '') : \FAA\Obj\Search\Response\Link|null

Resolve link Back resolve a optimized link

Parameters

string $link

The path to resolve

string $dom

Additional domain filter

Returns

\FAA\Obj\Search\Response\Link|null —

The link object or null, when not registered

PathToOptimizedLink()

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

Parameters

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

Returns

string —

A optimized link or the default link expression

SaveDomainConfig()

SaveDomainConfig(array  $data, \FAA\Git  $git) : \FAA\Obj\Result

Store the domain configuration

Parameters

array $data

A list of configuration options

\FAA\Git $git

A instance of the local git object

Returns

\FAA\Obj\Result

A default system result object

GetDomain()

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

Parameters

string|integer $id

An index or, a domain id

Returns

\FAA\Obj\Domain|null —

The found domain or null

ResolveDomain()

ResolveDomain(  $host, boolean  $ignore_state = false) : \FAA\Obj\Domain|null

Resolve hostname/FQDN to system domain

Parameters

$host
boolean $ignore_state

Returns

\FAA\Obj\Domain|null

GetDomains()

GetDomains(boolean  $sort = false) : \FAA\Obj\Result

Get list of domains

Parameters

boolean $sort

When set to true the list will be sorted by prio

Returns

\FAA\Obj\Result

A system result object

GetDomainConfig()

GetDomainConfig() : \FAA\Obj\Result

Get the domain configuration

Returns

\FAA\Obj\Result

DisplayLogin()

DisplayLogin(string  $path, \FAA\Obj\Request  $request) : \FAA\Obj\Result

display login form provide the registered template login formular

Parameters

string $path

Path to system folder tree entry

\FAA\Obj\Request $request

A system http request object

Returns

\FAA\Obj\Result

A system result object

FetchRelations()

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.

Parameters

\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

Returns

array<mixed,\FAA\Obj\Generic\Relation>|array<mixed,\stdClass> —

A list of relations

Display()

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.

Parameters

string $path

Path to system folder tree entry

\FAA\Obj\Request $request

A system http request object

Returns

\FAA\Obj\Result

A system result object

GetFolderObject()

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

Parameters

string $path

Virtual directory folder path

string $language

The request language code

boolean $as_folder

As folder object

Returns

\FAA\Obj\Generic\FolderTree|\FAA\Obj\Generic\Folder —

A system folder object with folder when found

GetFolder()

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

Parameters

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

Returns

\FAA\Obj\Result

A system result object with folder when found

GetFolderTreeElement()

GetFolderTreeElement(string  $path, string  $language = null) : \stdClass

get a folder element use a system path to get the corresponding folder

Parameters

string $path

Virtual directory folder path

string $language

The request language code

Returns

\stdClass —

A system folder tree element or null when not found

GetFolderTreeRoots()

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

Parameters

string $language

The request language code

string $root

An alternative folder start point

Returns

array<mixed,Object> —

A plain list of serialized folder entries

GetFolderTreeElements()

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

Parameters

string $language

The request language code

string $root

An alternative folder start point

boolean $full

When set to true, return with content relations

Returns

mixed|array<mixed,\FAA\Obj\Generic\FolderTree> —

A recursive folder tree object list

DeleteRelation()

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.

Parameters

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

Returns

\FAA\Obj\Result

A system result object

UpdateRelation()

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.

Parameters

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

Returns

\FAA\Obj\Result

A system result object

HandleMultipleAssignments()

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

Parameters

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

Returns

\FAA\Obj\Result

A system result object

HandleMultipleUploads()

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

Parameters

\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

Returns

\FAA\Obj\Result

A system result object

RegisterExistingContent()

RegisterExistingContent(string  $path, array  $payload, \FAA\Obj\Generic\BaseContent  $object) : \FAA\Obj\Result

Assign content to folder

Parameters

string $path

Path to storage folder

array $payload

The content relation

\FAA\Obj\Generic\BaseContent $object

A system object

Returns

\FAA\Obj\Result

A default system result object

RegisterRelation()

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

Parameters

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

Returns

\FAA\Obj\Result

A default system result object

GetFolderRelations()

GetFolderRelations(string  $id, string  $root) : object

Get Assoc list of assignment Get a single project list with relation identifications

Parameters

string $id

Path to folder object

string $root

Path to projects root

Returns

object —

The found project

CopyRelation()

CopyRelation(  $id,   $data, boolean  $no_check = false) : \FAA\Obj\Result

Function to copy a relation by id to a new target folder

Parameters

$id
$data
boolean $no_check

Returns

\FAA\Obj\Result

MoveRelation()

MoveRelation(  $id,   $data, boolean  $no_check = false) : \FAA\Obj\Result

Function to move a relation by id to a new target folder

Parameters

$id
$data
boolean $no_check

Returns

\FAA\Obj\Result

GetRelationFolderById()

GetRelationFolderById(  $id, array  $types = array('extension', 'relation', 'amountrelation')) : array|null

Get a relation folder by relation id in search

Parameters

$id
array $types

Returns

array|null

ClearFolderRelations()

ClearFolderRelations() 

CopyFoldersTo()

CopyFoldersTo(string  $target, array<mixed,string>  $folders) : \FAA\Obj\Result

Copy folders Copy a set of folders to target

Parameters

string $target

Target virtual folder path

array<mixed,string> $folders

A list of folders

Returns

\FAA\Obj\Result

A system result object

MoveFoldersTo()

MoveFoldersTo(string  $target, array<mixed,string>  $folders) : \FAA\Obj\Result

Move folders Move a set of folders to target

Parameters

string $target

Target virtual folder path

array<mixed,string> $folders

A list of folders

Returns

\FAA\Obj\Result

A system result object

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

CreateTaskProject()

CreateTaskProject(string  $dir, array  $data) : \FAA\Obj\Result

Create a task storage folder

Parameters

string $dir

The path to the folder

array $data

The content

Returns

\FAA\Obj\Result

The create result

CreateFolder()

CreateFolder(string  $dir, array  $data) : \FAA\Obj\Result

Create a regular folder

Parameters

string $dir

The path to the folder

array $data

The content

Returns

\FAA\Obj\Result

The create result

CreateProject()

CreateProject(string  $dir, array  $data) : \FAA\Obj\Result

Create a project storage folder

Parameters

string $dir

The path to the folder

array $data

The content

Returns

\FAA\Obj\Result

The create result

CreateStorage()

CreateStorage(string  $dir, array  $data) : \FAA\Obj\Result

Create a storage folder

Parameters

string $dir

The path to the folder

array $data

The content

Returns

\FAA\Obj\Result

The create result

OpenStorage()

OpenStorage(  $dir, null  $language = null) : \FAA\Obj\Generic\Storage|null

Open a storage folder

Parameters

$dir
null $language

Returns

\FAA\Obj\Generic\Storage|null

OpenTaskProject()

OpenTaskProject(  $dir, null  $language = null) : \FAA\Obj\Generic\TaskProject|null

Open a task project

Parameters

$dir
null $language

Returns

\FAA\Obj\Generic\TaskProject|null

OpenProject()

OpenProject(  $dir, null  $language = null) : \FAA\Obj\Generic\Project|null

Open a project folder

Parameters

$dir
null $language

Returns

\FAA\Obj\Generic\Project|null

ServiceDeepLink()

ServiceDeepLink(\FAA\Obj\Generic\Relation  $relation, string  $l = null) : string|null

Build deep link to a certain service

Parameters

\FAA\Obj\Generic\Relation $relation

The relation to link to

string $l

The target language

Returns

string|null —

The deep link or, null when not found

TaskProjectDeepLink()

TaskProjectDeepLink(\FAA\Obj\Generic\Task  $task, string  $l = null) : string|null

Create a task board deep link

Parameters

\FAA\Obj\Generic\Task $task
string $l

Returns

string|null

RegisterPlugins()

RegisterPlugins() 

Register plugins

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

resolveErrorTemplate()

resolveErrorTemplate(\FAA\Obj\Request  $request,   $code) : \FAA\Obj\Result

Parameters

\FAA\Obj\Request $request
$code

Returns

\FAA\Obj\Result

filterFetchRelations()

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

Parameters

\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

Returns

array —

A list of found relations either plain or as object

postProcessDisplay()

postProcessDisplay(\FAA\Obj\Request  $request, object  $hook, string  $html, \FAA\Obj\Generic\Folder  $folder) 

Post process

Apply post processing methods to given element

Parameters

\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

fillProjectBufferRecurse()

fillProjectBufferRecurse(  $projects, string  $root) 

Parameters

$projects
string $root

Path to projects root

copyFoldersRecursive()

copyFoldersRecursive(  $target,   $source) 

Parameters

$target
$source

moveFoldersRecursive()

moveFoldersRecursive(  $target,   $source) : \FAA\Obj\Result

Move folder from source to target

Parameters

$target
$source

Returns

\FAA\Obj\Result

execCopyMoveRelation()

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

Parameters

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

Returns

\FAA\Obj\Result

A system result object