MediaManager

Media Manager widget.

 class Cms\Widgets\MediaManager
extends Backend\Widgets\MediaManager

Extends

Class Description
MediaManager

Media Manager widget.

Traits

Trait Description
AssetMaker

Asset Maker Trait Adds asset based methods to a class

ConfigMaker

Config Maker Trait Adds configuration based methods to a class

ErrorMaker

Error Maker Trait Adds exception based methods to a class, goes well with System\Traits\ViewMaker.

EventEmitter

Adds system event related features to any class.

ExtendableTrait

This extension trait is used when access to the underlying base class is not available, such as classes that belong to the foundation framework (Laravel). It is currently used by the Controller and Model classes.

PreferenceMaker

Preference Maker Trait

SessionMaker

Session Maker Trait

UploadableWidget

Uploadable Widget Trait Adds media library upload features to back-end widgets

ViewMaker

View Maker Trait Adds view based methods to a class

WidgetMaker

Widget Maker Trait

Constants

Constant Description
FILTER_ALL
string "all"
FOLDER_ROOT
string "\/"
SELECTION_MODE_FIXED_RATIO
string "fixed-ratio"
SELECTION_MODE_FIXED_SIZE
string "fixed-size"
SELECTION_MODE_NORMAL
string "normal"
VIEW_MODE_GRID
string "grid"
VIEW_MODE_LIST
string "list"
VIEW_MODE_TILES
string "tiles"

Properties

inherited public $alias : string

Inherited from MediaManager

Defined alias used for this widget.

inherited public $assetPath : string

Inherited from MediaManager

Specifies a path to the asset directory.

inherited public $bottomToolbar : bool

Inherited from MediaManager

Determines whether the bottom toolbar is visible.

inherited public $config : object

Inherited from MediaManager

Supplied configuration.

inherited public $cropAndInsertButton : bool

Inherited from MediaManager

Determines whether the Crop & Insert button is visible.

inherited public $filterDisplay : bool

Inherited from MediaManager

Determines whether the Display filters are visible.

inherited public $implement : string | array | null

Inherited from MediaManager

Extensions implemented by this class.

inherited public $layout : string

Inherited from MediaManager

Layout to use for the view.

inherited public $readOnly : bool

Inherited from MediaManager

Determines whether the widget is in readonly mode or not.

inherited public $suppressLayout : bool

Inherited from MediaManager

Prevents the use of a layout.

inherited public $vars : array

Inherited from MediaManager

A list of variables to pass to the page.

inherited protected $assets : array

Inherited from MediaManager

Collection of assets to display in the layout.

inherited protected $configPath : string

Inherited from MediaManager

Specifies a path to the config directory.

inherited protected $controller : Backend\Classes\Controller

Inherited from MediaManager

Backend controller object.

inherited protected $defaultAlias : string

Inherited from MediaManager

A unique alias to identify this widget.

inherited protected static $extendableCallbacks : array

Inherited from MediaManager

Used to extend the constructor of an extendable class. Eg:

Class::extend(function($obj) { })

inherited protected static $extendableClassLoader : ClassLoader | null

Inherited from MediaManager

Class loader instance.

inherited protected $extendableConstructed : bool

Inherited from MediaManager

Indicates if the extendable constructor has completed.

inherited protected static $extendableStaticMethods : array

Inherited from MediaManager

Collection of static methods used by behaviors.

inherited protected $extensionData : array

Inherited from MediaManager

Class reflection information, including behaviors.

inherited protected $fatalError : string

Inherited from MediaManager

Object used for storing a fatal error.

inherited protected $layoutPath : string

Inherited from MediaManager

Specifies a path to the layout directory.

inherited protected $localCallbacks : array

Inherited from MediaManager

This stores any locally-scoped callbacks fired before the extendable constructor had completed.

inherited protected $orderFactor : integer

Inherited from MediaManager

Ensures "first-come, first-served" applies to assets of the same ordering.

inherited protected static $preferenceCache : array

Inherited from MediaManager

Cache for retrieved user preferences.

inherited protected $viewPath : string | array

Inherited from MediaManager

Specifies a path to the views directory.

Methods

public __construct ()

Constructor.

Returns
mixed

inherited public __call ($name, $params)

Inherited from MediaManager
Parameters
Property Description
$name
mixed
$params
mixed
Returns
mixed

inherited public static __callStatic ($name, $params)

Inherited from MediaManager
Parameters
Property Description
$name
mixed
$params
mixed
Returns
mixed

inherited public __get ($name)

Inherited from MediaManager
Parameters
Property Description
$name
mixed
Returns
mixed

inherited public __set ($name, $value)

Inherited from MediaManager
Parameters
Property Description
$name
mixed
$value
mixed
Returns
mixed

inherited public addCss (string | array $name, array $attributes = []) : void

Inherited from MediaManager

Adds StyleSheet asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
string | array

When an array of paths are provided they will be passed to the Asset Combiner

$attributes
array

When a string is provided it will be used as the 'build' attribute value

Returns
void

inherited public addDynamicMethod (string $dynamicName, callable $method, string $extension = null)

Inherited from MediaManager

Programmatically adds a method to the extendable class

Parameters
Property Description
$dynamicName
string
$method
callable
$extension
string
Returns
mixed

inherited public addDynamicProperty (string $dynamicName, mixed $value = null) : void

Inherited from MediaManager

Programmatically adds a property to the extendable class

Parameters
Property Description
$dynamicName
string

The name of the property to add

$value
mixed

The value of the property

Returns
void

inherited public addJs (string | array $name, array $attributes = []) : void

Inherited from MediaManager

Adds JavaScript asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
string | array

When an array of paths are provided they will be passed to the Asset Combiner

$attributes
array

When a string is provided it will be used as the 'build' attribute value

Returns
void

inherited public addRss (string $name, array $attributes = []) : void

Inherited from MediaManager

Adds an RSS link asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.

Parameters
Property Description
$name
string
$attributes
array
Returns
void

inherited public addViewPath (string | array $path) : void

Inherited from MediaManager

Prepends a path on the available view path locations.

Parameters
Property Description
$path
string | array
Returns
void

inherited public addVite (array | string $entrypoints, ?string $package = null) : void

Inherited from MediaManager

Adds Vite tags

Parameters
Property Description
$entrypoints
array | string

The list of entry points for Vite

$package
?string

The package name of the plugin or theme

Returns
void

inherited public asExtension (string $shortName) : mixed

Inherited from MediaManager

Short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

Parameters
Property Description
$shortName
string
Returns
mixed

inherited public bindToController () : void

Inherited from MediaManager

Binds a widget to the controller for safe use.

Returns
void

inherited public static clearExtendedClasses () : void

Inherited from MediaManager

Clear the list of extended classes so they will be re-extended.

Returns
void

inherited public clearUserPreference (string $key) : void

Inherited from MediaManager

Clears a single preference key from the user preferences for this controller/widget.

Parameters
Property Description
$key
string

Unique key for the data store.

Returns
void

inherited public clearUserPreferences () : void

Inherited from MediaManager

Clears all user preferences for this controller/widget.

Returns
void

inherited public combineAssets (array $assets, string $localPath = "") : string

Inherited from MediaManager

Run the provided assets through the Asset Combiner

Parameters
Property Description
$assets
array
$localPath
string
Returns
string

inherited public extendClassWith (string $extensionName) : void

Inherited from MediaManager

Dynamically extend a class with a specified behavior

Parameters
Property Description
$extensionName
string
Returns
void

inherited public static extendableAddExtension (callable $callback, boolean $scoped = false, $outerScope = null) : void

Inherited from MediaManager

Extends the class using a closure.

The closure will be provided a single parameter which is the instance of the extended class, by default.

You may optionally specify the callback as a scoped callback, which inherits the scope of the extended class and provides access to protected and private methods and properties. This makes any call using $this act on the extended class, not the class providing the extension.

If you use a scoped callback, you can provide the "outer" scope - or the scope of the class providing the extension, with the third parameter. The outer scope object will then be passed as the single parameter to the closure.

Parameters
Property Description
$callback
callable
$scoped
boolean
$outerScope
mixed
Returns
void

inherited public extendableCall (string $name, array $params = null) : mixed

Inherited from MediaManager

Magic method for __call().

Callback priority is as follows:

  • "Dynamic Methods" added locally to the object via addDynamicMethod($name, $callable)
  • Methods available on Behaviors that have been implemented by the object
  • Pass it to the parent's __call() method if it defines one
Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public static extendableCallStatic (string $name, array $params = null) : mixed

Inherited from MediaManager

Magic method for __callStatic()

Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public extendableConstruct ()

Inherited from MediaManager

This method should be called as part of the constructor.

Returns
mixed

inherited public static extendableExtendCallback (callable $callback, boolean $scoped = false, $outerScope = null) : void

Inherited from MediaManager

Helper method for ::extend() static method.

Parameters
Property Description
$callback
callable
$scoped
boolean
$outerScope
mixed
Returns
void

inherited public extendableGet (string $name) : mixed | null

Inherited from MediaManager

Magic method for __get()

Parameters
Property Description
$name
string
Returns
mixed | null

inherited public extendableSet (string $name, mixed $value) : void

Inherited from MediaManager

Magic method for __set()

Parameters
Property Description
$name
string
$value
mixed
Returns
void

inherited public fireSystemEvent (string $event, array $params = [], boolean $halt = true) : mixed

Inherited from MediaManager

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

For example:

$this->fireSystemEvent('backend.list.myEvent', ['my value']);

Is equivalent to:

$this->fireEvent('list.myEvent', ['myvalue'], true);

Event::fire('backend.list.myEvent', [$this, 'myvalue'], true);
Parameters
Property Description
$event
string

Event name

$params
array

Event parameters

$halt
boolean

Halt after first non-null result

Returns
mixed

inherited public fireViewEvent (string $event, array $params = []) : string

Inherited from MediaManager

Special event function used for extending within view files, allowing HTML to be injected multiple times.

For example:

= $this->fireViewEvent('backend.auth.extendSigninView') ?>
Parameters
Property Description
$event
string

Event name

$params
array

Event parameters

Returns
string

inherited public flushAssets () : void

Inherited from MediaManager

Disables the use, and subequent broadcast, of assets. This is useful to call during an AJAX request to speed things up. This method works by specifically targeting the hasAssetsDefined method.

Returns
void

inherited public getAssetPath (string $fileName, $assetPath = null) : string

Inherited from MediaManager

Returns the URL to the provided asset. If the provided fileName is a relative path without a leading slash it will be assumbed to be relative to the asset path.

Parameters
Property Description
$fileName
string
$assetPath
mixed
Returns
string

inherited public getAssetPaths () : array

Inherited from MediaManager

Returns an array of all registered asset paths.

Assets will be prioritized based on their defined ordering.

Returns
array

inherited public getClassExtension (string $name) : mixed

Inherited from MediaManager

Returns a behavior object from an extendable class, example:

$this->getClassExtension('Backend.Behaviors.FormController')

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
mixed

inherited public getClassMethods () : array

Inherited from MediaManager

Get a list of class methods, extension equivalent of get_class_methods()

Returns
array

inherited public getConfig (string $name, string $default = null) : string

Inherited from MediaManager

Safe accessor for configuration values.

Parameters
Property Description
$name
string

Config name, supports array names like "field[key]"

$default
string

Default value if nothing is found

Returns
string

inherited public getConfigPath (string $fileName, mixed $configPath = null) : string

Inherited from MediaManager

Locates a file based on it's definition. If the file starts with the ~ symbol it will be returned in context of the application base path, otherwise it will be returned in context of the config path.

Parameters
Property Description
$fileName
string

File to load.

$configPath
mixed

Explicitly define a config path.

Returns
string

Full path to the config file.

inherited public getController ()

Inherited from MediaManager

Returns the controller using this widget.

Returns
mixed

inherited public getDynamicProperties () : array

Inherited from MediaManager

Returns all dynamic properties and their values

Returns
array

['property' => 'value']

inherited public getEventHandler (string $name) : string

Inherited from MediaManager

Returns a fully qualified event handler name for this widget.

Parameters
Property Description
$name
string

The ajax event handler name.

Returns
string

inherited public getFatalError () : string

Inherited from MediaManager
Returns
string

The fatal error message

inherited public getId (string $suffix = null) : string

Inherited from MediaManager

Returns a unique ID for this widget. Useful in creating HTML markup.

Parameters
Property Description
$suffix
string

An extra string to append to the ID.

Returns
string

A unique identifier.

inherited public getUserPreference (string $key = null, mixed $default = null) : mixed

Inherited from MediaManager

Retrieves a widget related key/value pair from the user preferences

Parameters
Property Description
$key
string

Unique key for the data store.

$default
mixed

A default value to use when value is not found.

Returns
mixed

inherited public getUserPreferences () : array

Inherited from MediaManager

Retrieves and caches all user preferences for this particular controller/widget.

Returns
array

inherited public getViewPath (string $fileName, $viewPaths = null) : string

Inherited from MediaManager

Locates a file based on its definition. The file name can be prefixed with a symbol (~|$) to return in context of the application or plugin base path, otherwise it will be returned in context of this object view path.

If the fileName cannot be found it will be returned unmodified.

Parameters
Property Description
$fileName
string
$viewPaths
mixed
Returns
string

inherited public getViewPaths () : array

Inherited from MediaManager

Returns the active view path locations.

Returns
array

inherited public guessConfigPath (string $suffix = "") : string

Inherited from MediaManager

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

Returns
string

inherited public guessConfigPathFrom (string $class, string $suffix = "") : string

Inherited from MediaManager

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

Returns
string

inherited public guessViewPath (string $suffix = "", boolean $isPublic = false) : string | null

Inherited from MediaManager

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

inherited public guessViewPathFrom (string $class, string $suffix = "", boolean $isPublic = false) : string | null

Inherited from MediaManager

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

inherited public handleError ($exception)

Inherited from MediaManager

Sets standard page variables in the case of a controller error.

Parameters
Property Description
$exception
mixed
Returns
mixed

inherited public hasAssetsDefined () : bool

Inherited from MediaManager

Returns true if assets any have been added.

Returns
bool

inherited public hasFatalError () : bool

Inherited from MediaManager
Returns
bool

Whether a fatal error has been set or not.

inherited public init () : void

Inherited from MediaManager

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

Returns
void

inherited public isClassExtendedWith (string $name) : bool

Inherited from MediaManager

Check if extendable class is extended with a behavior object

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
bool

inherited public makeAssets ($type = null) : string | null

Inherited from MediaManager

Outputs <link> and <script> tags to load assets previously added with addJs, addCss, & addRss method calls depending on the provided $type

Parameters
Property Description
$type
mixed
Returns
string | null

inherited public makeConfig (array $configFile = [], array $requiredConfig = []) : array | stdClass

Inherited from MediaManager

Reads the contents of the supplied file and applies it to this object.

Parameters
Property Description
$configFile
array
$requiredConfig
array
Returns
array | stdClass

inherited public makeConfigFromArray (array $configArray = []) : stdClass

Inherited from MediaManager

Makes a config object from an array, making the first level keys properties of a new object.

Parameters
Property Description
$configArray
array

Config array.

Returns
stdClass

The config object

inherited public makeFileContents (string $filePath, array $extraParams = []) : string

Inherited from MediaManager

Includes a file path using output buffering, making the provided vars available.

Parameters
Property Description
$filePath
string
$extraParams
array
Returns
string

inherited public makeFormWidget (string $class, array $fieldConfig = [], array $widgetConfig = []) : Backend\Classes\FormWidgetBase

Inherited from MediaManager

Makes a form widget object with the supplied form field and widget configuration.

Parameters
Property Description
$class
string

Widget class name

$fieldConfig
array

A field name, an array of config or a FormField object.

$widgetConfig
array

An array of config.

Returns

The widget object

inherited public makeLayout ($name = null, array $params = [], boolean $throwException = true) : string | bool

Inherited from MediaManager

Render a layout, defaulting to the layout propery specified on the class

Parameters
Property Description
$name
mixed
$params
array
$throwException
boolean
Returns
string | bool

The layout contents, or false.

inherited public makeLayoutPartial (string $partial, array $params = []) : string

Inherited from MediaManager

Renders a layout partial

Parameters
Property Description
$partial
string
$params
array
Returns
string

inherited public makePartial (string $partial, array $params = [], boolean $throwException = true) : mixed

Inherited from MediaManager

Render a partial file contents located in the views folder.

Parameters
Property Description
$partial
string
$params
array
$throwException
boolean
Returns
mixed

Partial contents or false if not throwing an exception.

inherited public makeView (string $view) : string

Inherited from MediaManager

Loads the specified view. Applies the layout if one is set.

The view file must have the .php extension (or ".htm" for historical reasons) and be located in the views directory

Parameters
Property Description
$view
string
Returns
string

inherited public makeViewContent (string $contents, $layout = null) : string

Inherited from MediaManager

Renders supplied contents inside a layout.

Parameters
Property Description
$contents
string
$layout
mixed
Returns
string

inherited public makeWidget (string $class, array $widgetConfig = []) : mixed | Backend\Classes\WidgetBase

Inherited from MediaManager

Makes a widget object with the supplied configuration file.

Parameters
Property Description
$class
string

Widget class name

$widgetConfig
array

An array of config.

Returns

The widget object

inherited public mergeConfig (mixed $configA, mixed $configB) : stdClass

Inherited from MediaManager

Merges two configuration sources, either prepared or not, and returns them as a single configuration object.

Parameters
Property Description
$configA
mixed
$configB
mixed
Returns
stdClass

The config object

inherited public methodExists (string $name) : bool

Inherited from MediaManager

Checks if a method exists, extension equivalent of method_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public onApplyName () : void

Inherited from MediaManager

Rename the provided path from the request ("originalPath") to the new name ("name")

Returns
void

inherited public onChangeView () : array

Inherited from MediaManager

Render the view for the provided "path" and "view" mode from the request

Returns
array

inherited public onCreateFolder () : array

Inherited from MediaManager

Create a new folder ("name") in the provided "path" from the request

Returns
array

inherited public onCropImage () : array

Inherited from MediaManager

Crop image AJAX handler

Returns
array

inherited public onDeleteItem () : array

Inherited from MediaManager

Deletes the provided paths from the request ("paths")

Returns
array

inherited public onGenerateThumbnails () : array

Inherited from MediaManager

Generate thumbnails for the provided array of thumbnail info ("batch")

Returns
array

inherited public onGetSidebarThumbnail () : array

Inherited from MediaManager

Get the thumbnail for the provided path ("path") and lastModified date ("lastModified")

Returns
array

inherited public onGoToFolder () : array

Inherited from MediaManager

Go to the path specified in the request ("path")

Returns
array

inherited public onLoadImageCropPopup () : string

Inherited from MediaManager

Prepares & renders the image crop popup body

Returns
string

inherited public onLoadMovePopup () : string

Inherited from MediaManager

Render the move popup with a list of folders to move the selected items to excluding the provided paths in the request ("exclude")

Returns
string

inherited public onLoadPopup () : string

Inherited from MediaManager

Renders the widget in a popup body (options include "bottomToolbar" and "cropAndInsertButton")

Returns
string

inherited public onLoadRenamePopup () : string

Inherited from MediaManager

Render the rename popup for the provided "path" from the request

Returns
string

inherited public onMoveItems () : array

Inherited from MediaManager

Move the selected items ("files", "folders") to the provided destination path from the request ("dest")

Returns
array

inherited public onResizeImage () : array

Inherited from MediaManager

Handles resizing the provided image and returns the URL to the resized image Used by the Crop & Insert popup to resize the image being cropped on the canvas before cropping it.

Returns
array

inherited public onSearch () : array

Inherited from MediaManager

Perform a search with the query specified in the request ("search")

Returns
array

inherited public onSetFilter () : array

Inherited from MediaManager

Set the current filter from the request ("filter")

Returns
array

inherited public onSetSidebarVisible () : void

Inherited from MediaManager

Sets the sidebar visibility state from the request ("visible")

Returns
void

inherited public onSetSorting () : array

Inherited from MediaManager

Set the current sorting configuration from the request ("sortBy", "sortDirection")

Returns
array

inherited public onUpload () : Illuminate\Http\Response | null

Inherited from MediaManager

Process file uploads submitted via AJAX

Returns
Illuminate\Http\Response | null

inherited public orderAssets (array $assets) : array

Inherited from MediaManager

Prioritize assets based on the given order.

Parameters
Property Description
$assets
array
Returns
array

inherited public propertyExists (string $name) : bool

Inherited from MediaManager

Checks if a property exists, extension equivalent of property_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public putUserPreference (string $key, mixed $value) : void

Inherited from MediaManager

Saves a widget related key/value pair in to the users preferences

Parameters
Property Description
$key
string

Unique key for the data store.

$value
mixed

The value to store.

Returns
void

inherited public render () : string

Inherited from MediaManager

Renders the widget.

Returns
string

inherited public resetSession () : void

Inherited from MediaManager

Resets all session data related to this widget.

Returns
void

inherited public uploadableGetDisk () : Illuminate\Filesystem\FilesystemAdapter

Inherited from MediaManager

Returns the disk that will be used to store the uploaded file

Returns
Illuminate\Filesystem\FilesystemAdapter

inherited public uploadableGetUploadPath (string $fileName) : string

Inherited from MediaManager

Returns the path on the disk to store the uploaded file

Parameters
Property Description
$fileName
string
Returns
string

inherited public uploadableGetUploadUrl (string $diskPath) : string

Inherited from MediaManager

Returns the URL to the uploaded file

Parameters
Property Description
$diskPath
string
Returns
string

inherited public validateMediaFileName (string $fileName, string $extension) : string

Inherited from MediaManager
Parameters
Property Description
$fileName
string
$extension
string
Returns
string

inherited protected abortIfReadOnly () : void

Inherited from MediaManager

Abort the request with an access-denied code if readOnly mode is active

Returns
void

inherited protected addAsset (string $type, string $path, array $attributes) : void

Inherited from MediaManager

Adds the provided asset to the internal asset collections

Parameters
Property Description
$type
string
$path
string
$attributes
array
Returns
void

inherited protected cleanFileName (string $name) : string

Inherited from MediaManager

Creates a slug form the string. A modified version of Str::slug with the main difference that it accepts @-signs

Parameters
Property Description
$name
string
Returns
string

inherited protected deduplicatePath (string $path, $suffix = null) : string

Inherited from MediaManager

Process the provided path and add a suffix of _$int to prevent conflicts with existing paths

Parameters
Property Description
$path
string
$suffix
mixed
Returns
string

inherited protected extendableAddLocalExtension (Closure $callback, $outerScope = null)

Inherited from MediaManager

Adds local extensibility to the current instance.

This rebinds a given closure to the current instance, making it able to access protected and private methods. This makes any call using $this within the closure act on the extended class, not the class providing the extension.

An outer scope may be provided by providing a second parameter, which will then be passed through to the closure as its first parameter. If this is not given, the current instance will be provided as the first parameter.

Parameters
Property Description
$callback
Closure
$outerScope
mixed
Returns
mixed

inherited protected extendableIsAccessible (mixed $class, string $propertyName) : bool

Inherited from MediaManager

Checks if a property is accessible, property equivalent of is_callable()

Parameters
Property Description
$class
mixed
$propertyName
string
Returns
bool

inherited protected extensionCallMethod (ReflectionClass $class, string $method, array $params)

Inherited from MediaManager

Calls a method through reflection.

Parameters
Property Description
$class
ReflectionClass
$method
string
$params
array
Returns
mixed

inherited protected extensionExtractMethods (string $extensionName, object $extensionObject) : void

Inherited from MediaManager

Extracts the available methods from a behavior and adds it to the list of callable methods.

Parameters
Property Description
$extensionName
string
$extensionObject
object
Returns
void

inherited protected extensionGetClassLoader () : Winter\Storm\Support\ClassLoader | null

Inherited from MediaManager

Gets the class loader

Returns
Winter\Storm\Support\ClassLoader | null

inherited protected extensionGetParentClass ($instance = null) : ReflectionClass | false

Inherited from MediaManager

Gets the parent class using reflection.

The parent class must either not be the Extendable class, or must not be using the ExtendableTrait trait, in order to prevent infinite loops.

Parameters
Property Description
$instance
mixed
Returns
ReflectionClass | false

inherited protected extensionMethodExists (ReflectionClass $class, string $methodName) : bool

Inherited from MediaManager

Determines if the given class reflection contains the given method.

Parameters
Property Description
$class
ReflectionClass
$methodName
string
Returns
bool

inherited protected extensionNormalizeClassName (string $name) : string

Inherited from MediaManager

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

Parameters
Property Description
$name
string
Returns
string

inherited protected fillFromConfig (array $properties = null) : void

Inherited from MediaManager

Transfers config values stored inside the $config property directly on to the root object properties. If no properties are defined all config will be transferred if it finds a matching property.

Parameters
Property Description
$properties
array
Returns
void

inherited protected findFiles (string $searchTerm, string $filter, string $sortBy) : mixed

Inherited from MediaManager

Finds files from within the media library based on supplied criteria, returns an array of MediaLibraryItem objects.

Parameters
Property Description
$searchTerm
string
$filter
string
$sortBy
string
Returns
mixed

inherited protected generateThumbnail (array $thumbnailInfo, array | null $thumbnailParams = null) : array

Inherited from MediaManager

Generate thumbnail

Parameters
Property Description
$thumbnailInfo
array
$thumbnailParams
array | null
Returns
array

inherited protected getAssetEntryBuildPath (array $asset) : string

Inherited from MediaManager

Internal helper, attaches a build code to an asset path

Parameters
Property Description
$asset
array
Returns
string

inherited protected getAssetScheme (string $asset) : string

Inherited from MediaManager

Internal helper, get asset scheme

Parameters
Property Description
$asset
string
Returns
string

inherited protected getCurrentFolder () : string

Inherited from MediaManager

Gets the user's current folder from the session

Returns
string

inherited protected getFilter () : string

Inherited from MediaManager

Gets the user filter from the session state

Returns
string

inherited protected getFilterDisplay () : bool

Inherited from MediaManager

Gets the filter display option for the request

Returns
bool

inherited protected getLocalPath (string | null $relativePath) : string

Inherited from MediaManager
Parameters
Property Description
$relativePath
string | null
Returns
string

inherited protected getPlaceholderId (System\Classes\MediaLibraryItem $item) : string

Inherited from MediaManager

Get placeholder identifier

Parameters
Returns
string

inherited protected getPreferenceKey () : string

Inherited from MediaManager

Returns a unique identifier for this widget and controller action for preference storage.

Returns
string

inherited protected getPreferenceStorage () : Winter\Storm\Database\Model

Inherited from MediaManager

Specifies the model used for storing the user preferences.

Returns

inherited protected getResizedImageUrl (string $path, array $params) : string

Inherited from MediaManager

Get the URL to the resized image based on the provided path and parameters

Parameters
Property Description
$path
string
$params
array
Returns
string

inherited protected getSearchTerm () : string | null

Inherited from MediaManager

Gets the user search term from the session state

Returns
string | null

inherited protected getSelectionParams () : array

Inherited from MediaManager

Gets the user selection parameters from the session state

Returns
array

inherited protected getSession (string $key = null, string $default = null) : string

Inherited from MediaManager

Retrieves a widget related key/value pair from session data.

Parameters
Property Description
$key
string

Unique key for the data store.

$default
string

A default value to use when value is not found.

Returns
string

inherited protected getSidebarVisible () : bool

Inherited from MediaManager

Checks if the sidebar is visible

Returns
bool

inherited protected getSortBy () : string

Inherited from MediaManager

Gets the current column to sort by

Returns
string

inherited protected getSortDirection () : string

Inherited from MediaManager

Gets the user sort direction from the session state

Returns
string

inherited protected getThumbnailParams ($viewMode = null) : array

Inherited from MediaManager

Returns thumbnail parameters

Parameters
Property Description
$viewMode
mixed
Returns
array

inherited protected getViewMode () : string

Inherited from MediaManager

Returns the current view mode stored in the session

Returns
string

inherited protected handleViewException (Throwable $e, integer $obLevel) : void

Inherited from MediaManager

Handle a view exception.

Parameters
Property Description
$e
Throwable
$obLevel
integer
Returns
void

inherited protected isVector (string $path) : bool

Inherited from MediaManager

Detect if image is vector graphic (SVG)

Parameters
Property Description
$path
string
Returns
bool

inherited protected itemTypeToIconClass (System\Classes\MediaLibraryItem | null $item, string | null $itemType) : string

Inherited from MediaManager

Returns an icon for the item type

Parameters
Property Description
$item
System\Classes\MediaLibraryItem | null
$itemType
string | null
Returns
string

inherited protected listFolderItems ($folder, string $filter, string $sortBy) : mixed

Inherited from MediaManager

Returns a list of folders and files in a Library folder.

Parameters
Property Description
$folder
mixed
$filter
string
$sortBy
string
Returns
mixed

inherited protected loadAssets () : void

Inherited from MediaManager

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

Returns
void

inherited protected makeSessionId () : string

Inherited from MediaManager

Returns a unique session identifier for this widget and controller action.

Returns
string

inherited protected onUploadDirect () : Illuminate\Http\Response

Inherited from MediaManager
Returns
Illuminate\Http\Response

inherited protected prepareVars ()

Inherited from MediaManager

Internal method to prepare view variables.

Returns
mixed

inherited protected putSession (string $key, mixed $value) : void

Inherited from MediaManager

Saves a widget related key/value pair in to session data.

Parameters
Property Description
$key
string

Unique key for the data store.

$value
mixed

The value to store.

Returns
void

inherited protected removeDuplicates () : void

Inherited from MediaManager

Removes duplicate assets from the entire collection.

Returns
void

inherited protected setCurrentFolder (string $path) : void

Inherited from MediaManager

Sets the provided path as the current folder in the session

Parameters
Property Description
$path
string
Returns
void

inherited protected setFilter (string $filter) : void

Inherited from MediaManager

Sets the user filter from the session

Parameters
Property Description
$filter
string
Returns
void

inherited protected setFilterDisplay (bool $status) : void

Inherited from MediaManager

Sets the filter display option for the request

Parameters
Property Description
$status
bool
Returns
void

inherited protected setSearchTerm (string $searchTerm) : void

Inherited from MediaManager

Sets the user search term from the session state

Parameters
Property Description
$searchTerm
string
Returns
void

inherited protected setSelectionParams (string $selectionMode, int $selectionWidth, int $selectionHeight) : void

Inherited from MediaManager

Stores the user selection parameters in the session state

Parameters
Property Description
$selectionMode
string
$selectionWidth
int
$selectionHeight
int
Returns
void

inherited protected setSidebarVisible (bool $visible) : void

Inherited from MediaManager

Sets the sidebar visible state

Parameters
Property Description
$visible
bool
Returns
void

inherited protected setSortBy (string $sortBy) : void

Inherited from MediaManager

Sets the sort column

Parameters
Property Description
$sortBy
string
Returns
void

inherited protected setSortDirection (string $sortDirection) : void

Inherited from MediaManager

Sets the sort direction from the session state

Parameters
Property Description
$sortDirection
string
Returns
void

inherited protected setViewMode (string $viewMode) : void

Inherited from MediaManager

Stores a view mode in the session

Parameters
Property Description
$viewMode
string
Returns
void

inherited protected splitPathToSegments (string $path) : array

Inherited from MediaManager

Splits a path in to segments

Parameters
Property Description
$path
string
Returns
array

inherited protected validateFileName ($name) : bool

Inherited from MediaManager

Validate a proposed media item file name.

Parameters
Property Description
$name
mixed
Returns
bool

inherited protected validateFileType ($name) : bool

Inherited from MediaManager

Check for blocked / unsafe file extensions

Parameters
Property Description
$name
mixed
Returns
bool
Copyright © 2024 Winter CMS