FilePickerProfile View code

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' ] );
package

CMS

license

GPL

author

Robert Campbell calguy1000@cmsmadesimple.org

since 2.2
property-read

The top directory for the filepicker (relative to the CMSMS uploads directory)

property-read

The CMSMS FileType representing what files can be selected.

property-read

List only files/items that have the specified prefix.

property-read

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

property-read

Users of the filepicker can create new directories.

property-read

Users of the filepicker can upload new files (of the specified type)

property-read

Users of the filepicker can remove files.

property-read

Whether thumbnail images should be shown in place of normal icons for images.

property-read

Indicates that hidden files should be shown in the filepicker.

property-read

Indicates whether files should be sorted before listing them in the filepicker.

Methods

setValue(string $key, mixed $val) 

Set a value into this profile

Arguments

string $key

The key to set

mixed $val

The value to set.

__construct(array $params = null) 

Constructor

Arguments

array $params

An associative array of params suitable for hte setValue method.

overrideWith(array $params) : \CMSMS\FilePickerProfile

Create a new profile object based on the current one, with various aadjusments.

Arguments

array $params

Associative array of paramaters for the setValue method.

Response

\CMSMS\FilePickerProfile

Constants

FLAG_NONE

FLAG_NONE

FLAG_YES

FLAG_YES

FLAG_BYGROUP

FLAG_BYGROUP

Properties

top

top : string

The top directory for the filepicker (relative to the CMSMS uploads directory)

Type(s)

string

type

type : \CMSMS\FileType

The CMSMS FileType representing what files can be selected.

Type(s)

\CMSMS\FileType

match_prefix

match_prefix : string

List only files/items that have the specified prefix.

Type(s)

string

 : string

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

Type(s)

string

can_mkdir

can_mkdir : boolean

Users of the filepicker can create new directories.

Type(s)

boolean

can_upload

can_upload : boolean

Users of the filepicker can upload new files (of the specified type)

Type(s)

boolean

can_delete

can_delete : boolean

Users of the filepicker can remove files.

Type(s)

boolean

show_thumbs

show_thumbs : boolean

Whether thumbnail images should be shown in place of normal icons for images.

Type(s)

boolean

show_hidden

show_hidden : boolean

Indicates that hidden files should be shown in the filepicker.

Type(s)

boolean

sort

sort : boolean

Indicates whether files should be sorted before listing them in the filepicker.

Type(s)

boolean