Handler
extends SecuredServerPlugin
in package
Implement special handler
This class provides interfaces for system hooks
Tags
Table of Contents
- $config : stdClass|null
- Buffer for configuration
- $defaultPermissions : array<string|int, mixed>
- The default permission set
- $dir : string
- The implementation directory
- $name : string
- Name of the plugin
- __construct() : mixed
- set the plugin name
- GetAccessList() : array<string|int, mixed>
- Name() : string
- OnMapArrayIncludes() : void
- OnRegisterWidgetIncludes() : void
- OnUpdateEntityAttribute() : void
- The hook is called on attribute updates
- RegisterHooks() : array<string|int, mixed>
- Register system hooks
- RequestOnUrlParsed() : mixed
- The request hook
- ServeRequest() : mixed
- Serve request
- settings() : Result|object
- Get/Set the settings
- SetupTemplate() : mixed
- handleConfig() : void
- Handle the context requests
- hasAccess() : bool
- Check if endpoint is accessible for this user group
- isInContext() : bool
- Is in certain context?
- setupAttributes() : void
- Set up the permission attribute table
- handleConfigPreset() : void
- Handle the context requests
- handleEdit() : mixed
- Handle add/edit operation
- handleLoadDetails() : void
- Handle details load operation
- handlePreview() : void
- Handle preview operation
- handleSearch() : void
- Handle the search operation
- resolveParent() : BaseContent|null
- Resolve the parental chain from all segments
- resolveTypes() : array<string|int, mixed>
- testChain() : null|array<string|int, mixed>
Properties
$config
Buffer for configuration
protected
stdClass|null
$config
= null
$defaultPermissions
The default permission set
protected
array<string|int, mixed>
$defaultPermissions
= [['endpoint' => 'config', 'root' => true, 'admin' => true]]
$dir
The implementation directory
protected
string
$dir
= ''
$name
Name of the plugin
protected
string
$name
= ''
Methods
__construct()
set the plugin name
public
__construct() : mixed
Handler constructor.
Return values
mixed —GetAccessList()
public
GetAccessList(User $user) : array<string|int, mixed>
Parameters
- $user : User
Return values
array<string|int, mixed> —Name()
public
Name() : string
Return values
string —OnMapArrayIncludes()
public
OnMapArrayIncludes( $param) : void
Parameters
Return values
void —OnRegisterWidgetIncludes()
public
OnRegisterWidgetIncludes( $param) : void
Parameters
Return values
void —OnUpdateEntityAttribute()
The hook is called on attribute updates
public
static OnUpdateEntityAttribute(HookArgument $param) : void
Parameters
- $param : HookArgument
-
The hook values
Return values
void —RegisterHooks()
Register system hooks
public
RegisterHooks() : array<string|int, mixed>
Register a set of handler functions to be called in certain positions.
Return values
array<string|int, mixed> —A list of hooks to register
RequestOnUrlParsed()
The request hook
public
RequestOnUrlParsed(HookArgument $param) : mixed
Parameters
- $param : HookArgument
-
The hook values
Return values
mixed —ServeRequest()
Serve request
public
ServeRequest(Request $request, Response $response) : mixed
Serve the request and return appropriate result.
Parameters
Return values
mixed —settings()
Get/Set the settings
public
settings([null|object $new = null ]) : Result|object
This method is cached per instance
Parameters
- $new : null|object = null
-
New set of settings to store
Return values
Result|object —SetupTemplate()
public
SetupTemplate([mixed $data = null ]) : mixed
Parameters
- $data : mixed = null
Tags
Return values
mixed —handleConfig()
Handle the context requests
protected
handleConfig(Request &$request, Response &$response) : void
Parameters
Return values
void —hasAccess()
Check if endpoint is accessible for this user group
protected
hasAccess(string|array<string|int, string> $right[, Response|null $response = null ][, User|null $user = null ]) : bool
Parameters
Return values
bool —isInContext()
Is in certain context?
protected
isInContext(HookArgument $param, string $type, string $widget) : bool
Parameters
- $param : HookArgument
-
The hook argument
- $type : string
-
The type can be scss, css and js to search in widgets or _ to search in global includes
- $widget : string
-
The widget to search for
Return values
bool —setupAttributes()
Set up the permission attribute table
protected
setupAttributes( &$attributes, $l) : void
Parameters
Return values
void —handleConfigPreset()
Handle the context requests
private
handleConfigPreset(Request $request, Response $response) : void
Parameters
Return values
void —handleEdit()
Handle add/edit operation
private
handleEdit( $action, Response &$resp, Request &$request, $segments) : mixed
Parameters
Return values
mixed —handleLoadDetails()
Handle details load operation
private
handleLoadDetails(Response $resp, Request $request, array<string|int, mixed> $segments, array<string|int, mixed> $action) : void
Parameters
- $resp : Response
-
The response
- $request : Request
-
The request
- $segments : array<string|int, mixed>
-
The segments
- $action : array<string|int, mixed>
-
The action id and information
Return values
void —handlePreview()
Handle preview operation
private
handlePreview(array<string|int, mixed> $action, Response $resp, Request $request, array<string|int, mixed> $segments) : void
Parameters
- $action : array<string|int, mixed>
-
The action setup
- $resp : Response
-
The response interface
- $request : Request
-
The request
- $segments : array<string|int, mixed>
-
The path segments
Return values
void —handleSearch()
Handle the search operation
private
handleSearch(array<string|int, mixed> $action, Response $resp, Request $request) : void
Parameters
Return values
void —resolveParent()
Resolve the parental chain from all segments
private
resolveParent(array<string|int, mixed> $segments, Request $request[, bool $direct_parent = false ]) : BaseContent|null
Parameters
- $segments : array<string|int, mixed>
- $request : Request
- $direct_parent : bool = false
Return values
BaseContent|null —resolveTypes()
private
resolveTypes(stdClass &$head) : array<string|int, mixed>
Parameters
- $head : stdClass
Return values
array<string|int, mixed> —testChain()
private
testChain(Response $response, Request $request, array<string|int, mixed> &$segments) : null|array<string|int, mixed>