CMS Made Simple API

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
license

GPL

author

Robert Campbell calguy1000@cmsmadesimple.org

since
2.2
@property-read

string exclude_prefix Exclude any files/items that have the specified prefix.

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

Properties

$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)

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
FilePickerProfile

setValue()

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.


        
On this page

Search results