Widget
extends BaseContent
in package
Table of Contents
- $accessList : array<string|int, mixed>
- The locale access list
- $is_system : bool
- Is a system widget
- $rootFolder : string|null
- internal root folder path
- __construct() : mixed
- Widget constructor.
- CheckAccess() : bool
- Check single group permission
- CheckUserAccess() : bool
- Check the user access
- Delete() : Result
- Delete this widget
- Endpoints() : array<string|int, Endpoint>
- Get list end points of this widget
- GetRootFolder() : string
- The root path getter
- GetTplPath() : bool|string
- Get path to a template file of this widget
- Instance() : Master|null|ReflectionClass
- Build instance of this widget
- IsSystem() : bool
- Is system widget
- MirrorPermissions() : Result
- Mirror permissions of one group to another
- Name() : string
- The widgets lower case name
- ReadAccessList() : array<string|int, mixed>|null
- Fetch the access list
- ReadExtraAccessList() : array<string|int, mixed>|null
- Fetch the additional access list
- Save() : Result
- Save the instance
- SearchFields() : array<string|int, mixed>
- The search fields
- ToPlainObject() : object
- Convert to plain data set
- Update() : Result|null
- Update instance and save to file system
- UpdateAccessList() : Result
- Save new permission sets
- UpdateEndpoints() : Result
- Update endpoints
Properties
$accessList
The locale access list
protected
array<string|int, mixed>
$accessList
= null
The list
$is_system
Is a system widget
private
bool
$is_system
= null
The buffered status
$rootFolder
internal root folder path
private
string|null
$rootFolder
= null
The buffered folder
Methods
__construct()
Widget constructor.
public
__construct(string $path[, string $language = null ]) : mixed
Parameters
- $path : string
-
Name of the folder
- $language : string = null
-
The local instance language
Return values
mixed —CheckAccess()
Check single group permission
public
CheckAccess(string $group[, string $flag = 'call' ]) : bool
Parameters
- $group : string
-
The group id
- $flag : string = 'call'
-
The permission to check, defaults to 'call'
Return values
bool —Has permission
CheckUserAccess()
Check the user access
public
CheckUserAccess(User &$user[, string $op = 'call' ]) : bool
Parameters
- $user : User
- $op : string = 'call'
Return values
bool —Delete()
Delete this widget
public
Delete([bool $skip = false ]) : Result
Parameters
- $skip : bool = false
-
Needed but not used
Return values
Result —A system result
Endpoints()
Get list end points of this widget
public
Endpoints([bool $resolved = false ]) : array<string|int, Endpoint>
Parameters
- $resolved : bool = false
Return values
array<string|int, Endpoint> —GetRootFolder()
The root path getter
public
GetRootFolder() : string
Return values
string —GetTplPath()
Get path to a template file of this widget
public
GetTplPath(string $file[, string|null $context = '' ]) : bool|string
Parameters
- $file : string
-
The file name
- $context : string|null = ''
Return values
bool|string —The found file path or false
Instance()
Build instance of this widget
public
Instance([bool $instance = false ]) : Master|null|ReflectionClass
Parameters
- $instance : bool = false
Return values
Master|null|ReflectionClass —IsSystem()
Is system widget
public
IsSystem() : bool
This method is cached in property
Return values
bool —Is it system?
MirrorPermissions()
Mirror permissions of one group to another
public
MirrorPermissions(string $source, string $target) : Result
Parameters
- $source : string
-
Source group id
- $target : string
-
Target group id
Return values
Result —A system result
Name()
The widgets lower case name
public
Name() : string
Return values
string —The name
ReadAccessList()
Fetch the access list
public
ReadAccessList() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —ReadExtraAccessList()
Fetch the additional access list
public
ReadExtraAccessList() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —Save()
Save the instance
public
Save([bool $force_new_id = false ]) : Result
Will save the widget data and clear the caches
Parameters
- $force_new_id : bool = false
-
New id needed: Not as this is a named content
Return values
Result —A system result
SearchFields()
The search fields
public
SearchFields() : array<string|int, mixed>
Return values
array<string|int, mixed> —ToPlainObject()
Convert to plain data set
public
ToPlainObject([string $language = null ][, bool $withparent = true ]) : object
Translate and expose the current data attribute as plain resolved object
Parameters
- $language : string = null
-
A system language code or empty for raw setup
- $withparent : bool = true
-
When set to true the attributes will be resolved witch parent attributes included
Return values
object —A simple attribute based php object
Update()
Update instance and save to file system
public
Update( $payload) : Result|null
Parameters
Return values
Result|null —UpdateAccessList()
Save new permission sets
public
UpdateAccessList(array<string|int, mixed> $input) : Result
Does an automated split when non system groups are involved
Parameters
- $input : array<string|int, mixed>
-
The new permissions
Return values
Result —A system result
UpdateEndpoints()
Update endpoints
public
UpdateEndpoints(array<string|int, mixed> $data) : Result
Will save to file, stage data and clear caches
Parameters
- $data : array<string|int, mixed>
-
The new end points
Return values
Result —A system result