FilePickerProfile
in package
A simple class that defines a profile of information used by the filepicker to indicate how it should behave and what functionality should be provided.
This is an immutable class.
The constructor and overrideWith methods of this class accept an associative array of parameters (see the properties below) to allow building or altering a profile object. Ths is the only time when properties of a profile can be adjusted.
$obj = new \CMSMS\FilePickerProfile( [ 'type'=>FileType::TYPE_IMAGE,
'exclude_prefix'=>'foo' ] );
Tags
Table of Contents
Constants
- FLAG_BYGROUP = 2
- FLAG_NONE = 0
- FLAG_YES = 1
Properties
- $can_delete : bool
- $can_mkdir : bool
- $can_upload : bool
- $match_prefix : string
- $show_hidden : bool
- $show_thumbs : bool
- $sort : bool
- $top : string
- $type : FileType
Methods
- __construct() : mixed
- Constructor
- overrideWith() : FilePickerProfile
- Create a new profile object based on the current one, with various aadjusments.
- setValue() : mixed
- Set a value into this profile
Constants
FLAG_BYGROUP
public
mixed
FLAG_BYGROUP
= 2
FLAG_NONE
public
mixed
FLAG_NONE
= 0
FLAG_YES
public
mixed
FLAG_YES
= 1
Properties
$can_delete read-only
public
bool
$can_delete
Users of the filepicker can remove files.
$can_mkdir read-only
public
bool
$can_mkdir
Users of the filepicker can create new directories.
$can_upload read-only
public
bool
$can_upload
Users of the filepicker can upload new files (of the specified type)
$match_prefix read-only
public
string
$match_prefix
List only files/items that have the specified prefix.
$show_hidden read-only
public
bool
$show_hidden
Indicates that hidden files should be shown in the filepicker.
$show_thumbs read-only
public
bool
$show_thumbs
Whether thumbnail images should be shown in place of normal icons for images.
$sort read-only
public
bool
$sort
Indicates whether files should be sorted before listing them in the filepicker.
$top read-only
public
string
$top
The top directory for the filepicker (relative to the CMSMS uploads directory)
$type read-only
public
FileType
$type
The CMSMS FileType representing what files can be selected.
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $params = null ]) : mixed
Parameters
- $params : array<string|int, mixed> = null
-
An associative array of params suitable for hte setValue method.
overrideWith()
Create a new profile object based on the current one, with various aadjusments.
public
overrideWith(array<string|int, mixed> $params) : FilePickerProfile
Parameters
- $params : array<string|int, mixed>
-
Associative array of paramaters for the setValue method.
Return values
FilePickerProfilesetValue()
Set a value into this profile
protected
setValue(string $key, mixed $val) : mixed
Parameters
- $key : string
-
The key to set
- $val : mixed
-
The value to set.