Media\FormWidgets\MediaFinder

Overview

MediaFinder renders a record finder field.

image: label: Some image type: mediafinder

Extends

Public Properties

public string $mode

Display mode for the selection. Values: file, image.

public int $imageWidth

imageWidth for preview

public int $imageHeight

imageHeight for preview

public int|null $maxItems

maxItems allowed

public array $thumbOptions

thumbOptions used for generating thumbnails

public string $externalToolbarAppState

Defines a mount point for the editor toolbar. Must include a module name that exports the Vue application and a state element name. Format: module.name::stateElementName Only works in Vue applications and form document layouts.

public string $externalToolbarEventBus

Defines an event bus for an external toolbar. Must include a module name that exports the Vue application and a state element name. Format: module.name::eventBus Only works in Vue applications and form document layouts.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public prepareVars()

public prepareVars(): void

prepareVars for display

public render()

public render(): void

render the widget's primary contents.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected decorateFileAttributes()

protected decorateFileAttributes($file): Media\Classes\MediaLibraryItem 

decorateFileAttributes adds the bespoke attributes used internally by this widget. Added attributes are:

  • thumbUrl

protected findItemFromMediaLibrary()

protected findItemFromMediaLibrary($val): void

protected getDisplayMode()

protected getDisplayMode(): string 

getDisplayMode for the file upload. Eg: file-multi, image-single, etc

protected getFileList()

protected getFileList(): void

getFileList returns a list of associated files

protected isFileResizable()

protected isFileResizable($file): bool 

isFileResizable returns true if the file can be resized

protected isFolderMode()

protected isFolderMode(): void

isFolderMode returns true if the chosen media item is a folder.

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

protected processMaxItems()

protected processMaxItems(): void

protected shouldGenerateThumb()

protected shouldGenerateThumb(): void

shouldGenerateThumb determines if the resizer should be used

Show inherited protected methods

Inherited Protected Methods