MediaManager
Media Manager widget.
class Backend\Widgets\MediaManager
extends Backend\Classes\WidgetBase
Extends
Class | Description |
---|---|
WidgetBase
|
Widget base class. |
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 |
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 | Type | Value | Description |
---|---|---|---|
FILTER_ALL
|
string |
"all"
|
string
"all"
|
FOLDER_ROOT
|
string |
"\/"
|
string
"\/"
|
SELECTION_MODE_FIXED_RATIO
|
string |
"fixed-ratio"
|
string
"fixed-ratio"
|
SELECTION_MODE_FIXED_SIZE
|
string |
"fixed-size"
|
string
"fixed-size"
|
SELECTION_MODE_NORMAL
|
string |
"normal"
|
string
"normal"
|
VIEW_MODE_GRID
|
string |
"grid"
|
string
"grid"
|
VIEW_MODE_LIST
|
string |
"list"
|
string
"list"
|
VIEW_MODE_TILES
|
string |
"tiles"
|
string
"tiles"
|
Properties
public
$bottomToolbar
:
bool
= false
Determines whether the bottom toolbar is visible.
public
$cropAndInsertButton
:
bool
= false
Determines whether the Crop & Insert button is visible.
public
$filterDisplay
:
bool
= true
Determines whether the Display filters are visible.
public
$readOnly
:
bool
= false
Determines whether the widget is in readonly mode or not.
inherited public $alias : string
Defined alias used for this widget.
inherited public $assetPath : string
Specifies a path to the asset directory.
inherited public $config : object
Supplied configuration.
inherited
public
$implement
:
string
|
array
|
null
= null
Extensions implemented by this class.
inherited public $layout : string
Layout to use for the view.
inherited
public
$suppressLayout
:
bool
= false
Prevents the use of a layout.
inherited
public
$vars
:
array
= []
A list of variables to pass to the page.
inherited
protected
$assets
:
array
= {"js":[],"css":[],"rss":[],"vite":[]}
Collection of assets to display in the layout.
inherited protected $configPath : string
Specifies a path to the config directory.
inherited protected $controller : Backend\Classes\Controller
Backend controller object.
inherited
protected
$defaultAlias
:
string
= "widget"
A unique alias to identify this widget.
inherited
protected
static
$extendableCallbacks
:
array
= []
Used to extend the constructor of an extendable class. Eg:
Class::extend(function($obj) { })
inherited
protected
static
$extendableClassLoader
:
ClassLoader
|
null
= null
Class loader instance.
inherited
protected
$extendableConstructed
:
bool
= false
Indicates if the extendable constructor has completed.
inherited
protected
static
$extendableStaticMethods
:
array
= []
Collection of static methods used by behaviors.
inherited
protected
$extensionData
:
array
= {"extensions":[],"methods":[],"dynamicMethods":[],"dynamicProperties":[]}
Class reflection information, including behaviors.
inherited protected $fatalError : string
Object used for storing a fatal error.
inherited protected $layoutPath : string
Specifies a path to the layout directory.
inherited
protected
$localCallbacks
:
array
= []
This stores any locally-scoped callbacks fired before the extendable constructor had completed.
inherited protected $orderFactor : integer
Ensures "first-come, first-served" applies to assets of the same ordering.
inherited
protected
static
$preferenceCache
:
array
= []
Cache for retrieved user preferences.
inherited protected $viewPath : string | array
Specifies a path to the views directory.
Methods
public
__construct ($controller, $alias, boolean $readOnly = false
)
Constructor.
Property | Type | Description |
---|---|---|
$controller | mixed |
mixed
|
$alias | mixed |
mixed
|
$readOnly | boolean |
boolean
|
public onApplyName () : void
Rename the provided path from the request ("originalPath") to the new name ("name")
public onChangeView () : array
Render the view for the provided "path" and "view" mode from the request
public onCreateFolder () : array
Create a new folder ("name") in the provided "path" from the request
public onCropImage () : array
Crop image AJAX handler
public onDeleteItem () : array
Deletes the provided paths from the request ("paths")
public onGenerateThumbnails () : array
Generate thumbnails for the provided array of thumbnail info ("batch")
public onGetSidebarThumbnail () : array
Get the thumbnail for the provided path ("path") and lastModified date ("lastModified")
public onGoToFolder () : array
Go to the path specified in the request ("path")
public onLoadImageCropPopup () : string
Prepares & renders the image crop popup body
public onLoadMovePopup () : string
Render the move popup with a list of folders to move the selected items to excluding the provided paths in the request ("exclude")
public onLoadPopup () : string
Renders the widget in a popup body (options include "bottomToolbar" and "cropAndInsertButton")
public onLoadRenamePopup () : string
Render the rename popup for the provided "path" from the request
public onMoveItems () : array
Move the selected items ("files", "folders") to the provided destination path from the request ("dest")
public onResizeImage () : array
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.
public onSearch () : array
Perform a search with the query specified in the request ("search")
public onSetFilter () : array
Set the current filter from the request ("filter")
public onSetSidebarVisible () : void
Sets the sidebar visibility state from the request ("visible")
public onSetSorting () : array
Set the current sorting configuration from the request ("sortBy", "sortDirection")
public render () : string
Renders the widget.
protected abortIfReadOnly () : void
Abort the request with an access-denied code if readOnly mode is active
protected
deduplicatePath (string $path, $suffix = null
)
: string
Process the provided path and add a suffix of _$int to prevent conflicts with existing paths
Property | Type | Description |
---|---|---|
$path | string |
string
|
$suffix | mixed |
mixed
|
protected findFiles (string $searchTerm, string $filter, string $sortBy) : mixed
Finds files from within the media library based on supplied criteria, returns an array of MediaLibraryItem objects.
Property | Type | Description |
---|---|---|
$searchTerm | string |
string
|
$filter | string |
string
|
$sortBy | string |
string
|
protected
generateThumbnail (array $thumbnailInfo, array | null $thumbnailParams = null
)
: array
Generate thumbnail
Property | Type | Description |
---|---|---|
$thumbnailInfo | array |
array
|
$thumbnailParams | array | null |
array | null
|
protected getCurrentFolder () : string
Gets the user's current folder from the session
protected getFilter () : string
Gets the user filter from the session state
protected getFilterDisplay () : bool
Gets the filter display option for the request
protected getPlaceholderId (System\Classes\MediaLibraryItem $item) : string
Get placeholder identifier
Property | Type | Description |
---|---|---|
$item | System\Classes\MediaLibraryItem |
protected getPreferenceKey () : string
Returns a unique identifier for this widget and controller action for preference storage.
protected getResizedImageUrl (string $path, array $params) : string
Get the URL to the resized image based on the provided path and parameters
Property | Type | Description |
---|---|---|
$path | string |
string
|
$params | array |
array
|
protected getSearchTerm () : string | null
Gets the user search term from the session state
protected getSelectionParams () : array
Gets the user selection parameters from the session state
protected getSidebarVisible () : bool
Checks if the sidebar is visible
protected getSortBy () : string
Gets the current column to sort by
protected getSortDirection () : string
Gets the user sort direction from the session state
protected
getThumbnailParams ($viewMode = null
)
: array
Returns thumbnail parameters
Property | Type | Description |
---|---|---|
$viewMode | mixed |
mixed
|
protected getViewMode () : string
Returns the current view mode stored in the session
protected isVector (string $path) : bool
Detect if image is vector graphic (SVG)
Property | Type | Description |
---|---|---|
$path | string |
string
|
protected itemTypeToIconClass (System\Classes\MediaLibraryItem | null $item, string | null $itemType) : string
Returns an icon for the item type
Property | Type | Description |
---|---|---|
$item | System\Classes\MediaLibraryItem | null |
System\Classes\MediaLibraryItem | null
|
$itemType | string | null |
string | null
|
protected listFolderItems ($folder, string $filter, string $sortBy) : mixed
Returns a list of folders and files in a Library folder.
Property | Type | Description |
---|---|---|
$folder | mixed |
mixed
|
$filter | string |
string
|
$sortBy | string |
string
|
protected loadAssets () : void
Adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.
protected prepareVars ()
Internal method to prepare view variables.
protected setCurrentFolder (string $path) : void
Sets the provided path as the current folder in the session
Property | Type | Description |
---|---|---|
$path | string |
string
|
protected setFilter (string $filter) : void
Sets the user filter from the session
Property | Type | Description |
---|---|---|
$filter | string |
string
|
protected setFilterDisplay (bool $status) : void
Sets the filter display option for the request
Property | Type | Description |
---|---|---|
$status | bool |
bool
|
protected setSearchTerm (string $searchTerm) : void
Sets the user search term from the session state
Property | Type | Description |
---|---|---|
$searchTerm | string |
string
|
protected setSelectionParams (string $selectionMode, int $selectionWidth, int $selectionHeight) : void
Stores the user selection parameters in the session state
Property | Type | Description |
---|---|---|
$selectionMode | string |
string
|
$selectionWidth | int |
int
|
$selectionHeight | int |
int
|
protected setSidebarVisible (bool $visible) : void
Sets the sidebar visible state
Property | Type | Description |
---|---|---|
$visible | bool |
bool
|
protected setSortBy (string $sortBy) : void
Sets the sort column
Property | Type | Description |
---|---|---|
$sortBy | string |
string
|
protected setSortDirection (string $sortDirection) : void
Sets the sort direction from the session state
Property | Type | Description |
---|---|---|
$sortDirection | string |
string
|
protected setViewMode (string $viewMode) : void
Stores a view mode in the session
Property | Type | Description |
---|---|---|
$viewMode | string |
string
|
protected splitPathToSegments (string $path) : array
Splits a path in to segments
Property | Type | Description |
---|---|---|
$path | string |
string
|
inherited public __call ($name, $params)
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
$params | mixed |
mixed
|
inherited public static __callStatic ($name, $params)
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
$params | mixed |
mixed
|
inherited public __get ($name)
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
inherited public __set ($name, $value)
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
$value | mixed |
mixed
|
inherited
public
addCss (string | array $name, array $attributes = []
)
: void
Adds StyleSheet asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.
Property | Type | Description |
---|---|---|
$name | string | array |
string | array
When an array of paths are provided they will be passed to the Asset Combiner |
$attributes | array |
array
When a string is provided it will be used as the 'build' attribute value |
inherited
public
addDynamicMethod (string $dynamicName, callable $method, string $extension = null
)
Programmatically adds a method to the extendable class
Property | Type | Description |
---|---|---|
$dynamicName | string |
string
|
$method | callable |
callable
|
$extension | string |
string
|
inherited
public
addDynamicProperty (string $dynamicName, mixed $value = null
)
: void
Programmatically adds a property to the extendable class
Property | Type | Description |
---|---|---|
$dynamicName | string |
string
The name of the property to add |
$value | mixed |
mixed
The value of the property |
inherited
public
addJs (string | array $name, array $attributes = []
)
: void
Adds JavaScript asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.
Property | Type | Description |
---|---|---|
$name | string | array |
string | array
When an array of paths are provided they will be passed to the Asset Combiner |
$attributes | array |
array
When a string is provided it will be used as the 'build' attribute value |
inherited
public
addRss (string $name, array $attributes = []
)
: void
Adds an RSS link asset to the asset list. Call $this->makeAssets() in a view to output corresponding markup.
Property | Type | Description |
---|---|---|
$name | string |
string
|
$attributes | array |
array
|
inherited public addViewPath (string | array $path) : void
Prepends a path on the available view path locations.
Property | Type | Description |
---|---|---|
$path | string | array |
string | array
|
inherited
public
addVite (array | string $entrypoints, ?string $package = null
)
: void
Adds Vite tags
Property | Type | Description |
---|---|---|
$entrypoints | array | string |
array | string
The list of entry points for Vite |
$package | ?string |
?string
The package name of the plugin or theme |
inherited public asExtension (string $shortName) : mixed
Short hand for getClassExtension()
method, except takes the short
extension name, example:
$this->asExtension('FormController')
Property | Type | Description |
---|---|---|
$shortName | string |
string
|
inherited public bindToController () : void
Binds a widget to the controller for safe use.
inherited public static clearExtendedClasses () : void
Clear the list of extended classes so they will be re-extended.
inherited public clearUserPreference (string $key) : void
Clears a single preference key from the user preferences for this controller/widget.
Property | Type | Description |
---|---|---|
$key | string |
string
Unique key for the data store. |
inherited public clearUserPreferences () : void
Clears all user preferences for this controller/widget.
inherited
public
combineAssets (array $assets, string $localPath = ""
)
: string
Run the provided assets through the Asset Combiner
Property | Type | Description |
---|---|---|
$assets | array |
array
|
$localPath | string |
string
|
inherited public extendClassWith (string $extensionName) : void
Dynamically extend a class with a specified behavior
Property | Type | Description |
---|---|---|
$extensionName | string |
string
|
inherited
public
static
extendableAddExtension (callable $callback, boolean $scoped = false
, $outerScope = null
)
: void
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.
Property | Type | Description |
---|---|---|
$callback | callable |
callable
|
$scoped | boolean |
boolean
|
$outerScope | mixed |
mixed
|
inherited
public
extendableCall (string $name, array $params = null
)
: mixed
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
Property | Type | Description |
---|---|---|
$name | string |
string
|
$params | array |
array
|
inherited
public
static
extendableCallStatic (string $name, array $params = null
)
: mixed
Magic method for __callStatic()
Property | Type | Description |
---|---|---|
$name | string |
string
|
$params | array |
array
|
inherited public extendableConstruct ()
This method should be called as part of the constructor.
inherited
public
static
extendableExtendCallback (callable $callback, boolean $scoped = false
, $outerScope = null
)
: void
Helper method for ::extend()
static method.
Property | Type | Description |
---|---|---|
$callback | callable |
callable
|
$scoped | boolean |
boolean
|
$outerScope | mixed |
mixed
|
inherited public extendableGet (string $name) : mixed | null
Magic method for __get()
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited public extendableSet (string $name, mixed $value) : void
Magic method for __set()
Property | Type | Description |
---|---|---|
$name | string |
string
|
$value | mixed |
mixed
|
inherited
public
fireSystemEvent (string $event, array $params = []
, boolean $halt = true
)
: mixed
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);
Property | Type | Description |
---|---|---|
$event | string |
string
Event name |
$params | array |
array
Event parameters |
$halt | boolean |
boolean
Halt after first non-null result |
inherited
public
fireViewEvent (string $event, array $params = []
)
: string
Special event function used for extending within view files, allowing HTML to be injected multiple times.
For example:
= $this->fireViewEvent('backend.auth.extendSigninView') ?>Property | Type | Description |
---|---|---|
$event | string |
string
Event name |
$params | array |
array
Event parameters |
inherited public flushAssets () : void
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.
inherited
public
getAssetPath (string $fileName, $assetPath = null
)
: string
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.
Property | Type | Description |
---|---|---|
$fileName | string |
string
|
$assetPath | mixed |
mixed
|
inherited public getAssetPaths () : array
Returns an array of all registered asset paths.
Assets will be prioritized based on their defined ordering.
inherited public getClassExtension (string $name) : mixed
Returns a behavior object from an extendable class, example:
$this->getClassExtension('Backend.Behaviors.FormController')
Property | Type | Description |
---|---|---|
$name | string |
string
Fully qualified behavior name |
inherited public getClassMethods () : array
Get a list of class methods, extension equivalent of get_class_methods()
inherited
public
getConfig (string $name, string $default = null
)
: string
Safe accessor for configuration values.
Property | Type | Description |
---|---|---|
$name | string |
string
Config name, supports array names like "field[key]" |
$default | string |
string
Default value if nothing is found |
inherited
public
getConfigPath (string $fileName, mixed $configPath = null
)
: string
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.
Property | Type | Description |
---|---|---|
$fileName | string |
string
File to load. |
$configPath | mixed |
mixed
Explicitly define a config path. |
Full path to the config file.
inherited public getController ()
Returns the controller using this widget.
inherited public getDynamicProperties () : array
Returns all dynamic properties and their values
['property' => 'value']
inherited public getEventHandler (string $name) : string
Returns a fully qualified event handler name for this widget.
Property | Type | Description |
---|---|---|
$name | string |
string
The ajax event handler name. |
inherited public getFatalError () : string
The fatal error message
inherited
public
getId (string $suffix = null
)
: string
Returns a unique ID for this widget. Useful in creating HTML markup.
Property | Type | Description |
---|---|---|
$suffix | string |
string
An extra string to append to the ID. |
A unique identifier.
inherited
public
getUserPreference (string $key = null
, mixed $default = null
)
: mixed
Retrieves a widget related key/value pair from the user preferences
Property | Type | Description |
---|---|---|
$key | string |
string
Unique key for the data store. |
$default | mixed |
mixed
A default value to use when value is not found. |
inherited public getUserPreferences () : array
Retrieves and caches all user preferences for this particular controller/widget.
inherited
public
getViewPath (string $fileName, $viewPaths = null
)
: string
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.
Property | Type | Description |
---|---|---|
$fileName | string |
string
|
$viewPaths | mixed |
mixed
|
inherited public getViewPaths () : array
Returns the active view path locations.
inherited
public
guessConfigPath (string $suffix = ""
)
: string
Guess the package path for the called class.
Property | Type | Description |
---|---|---|
$suffix | string |
string
An extra path to attach to the end |
inherited
public
guessConfigPathFrom (string $class, string $suffix = ""
)
: string
Guess the package path from a specified class.
Property | Type | Description |
---|---|---|
$class | string |
string
Class to guess path from. |
$suffix | string |
string
An extra path to attach to the end |
inherited
public
guessViewPath (string $suffix = ""
, boolean $isPublic = false
)
: string | null
Guess the package path for the called class.
Property | Type | Description |
---|---|---|
$suffix | string |
string
An extra path to attach to the end |
$isPublic | boolean |
boolean
Returns public path instead of an absolute one |
inherited
public
guessViewPathFrom (string $class, string $suffix = ""
, boolean $isPublic = false
)
: string | null
Guess the package path from a specified class.
Property | Type | Description |
---|---|---|
$class | string |
string
Class to guess path from. |
$suffix | string |
string
An extra path to attach to the end |
$isPublic | boolean |
boolean
Returns public path instead of an absolute one |
inherited public handleError ($exception)
Sets standard page variables in the case of a controller error.
Property | Type | Description |
---|---|---|
$exception | mixed |
mixed
|
inherited public hasAssetsDefined () : bool
Returns true if assets any have been added.
inherited public hasFatalError () : bool
Whether a fatal error has been set or not.
inherited public init () : void
Initialize the widget, called by the constructor and free from its parameters.
inherited public isClassExtendedWith (string $name) : bool
Check if extendable class is extended with a behavior object
Property | Type | Description |
---|---|---|
$name | string |
string
Fully qualified behavior name |
inherited
public
makeAssets ($type = null
)
: string | null
Outputs <link>
and <script>
tags to load assets previously added
with addJs, addCss, & addRss method calls depending on the provided $type
Property | Type | Description |
---|---|---|
$type | mixed |
mixed
|
inherited
public
makeConfig (array $configFile = []
, array $requiredConfig = []
)
: array | stdClass
Reads the contents of the supplied file and applies it to this object.
Property | Type | Description |
---|---|---|
$configFile | array |
array
|
$requiredConfig | array |
array
|
inherited
public
makeConfigFromArray (array $configArray = []
)
: stdClass
Makes a config object from an array, making the first level keys properties of a new object.
Property | Type | Description |
---|---|---|
$configArray | array |
array
Config array. |
The config object
inherited
public
makeFileContents (string $filePath, array $extraParams = []
)
: string
Includes a file path using output buffering, making the provided vars available.
Property | Type | Description |
---|---|---|
$filePath | string |
string
|
$extraParams | array |
array
|
inherited
public
makeFormWidget (string $class, array $fieldConfig = []
, array $widgetConfig = []
)
: Backend\Classes\FormWidgetBase
Makes a form widget object with the supplied form field and widget configuration.
Property | Type | Description |
---|---|---|
$class | string |
string
Widget class name |
$fieldConfig | array |
array
A field name, an array of config or a FormField object. |
$widgetConfig | array |
array
An array of config. |
The widget object
inherited
public
makeLayout ($name = null
, array $params = []
, boolean $throwException = true
)
: string | bool
Render a layout, defaulting to the layout propery specified on the class
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
$params | array |
array
|
$throwException | boolean |
boolean
|
The layout contents, or false.
inherited
public
makeLayoutPartial (string $partial, array $params = []
)
: string
Renders a layout partial
Property | Type | Description |
---|---|---|
$partial | string |
string
|
$params | array |
array
|
inherited
public
makePartial (string $partial, array $params = []
, boolean $throwException = true
)
: mixed
Render a partial file contents located in the views folder.
Property | Type | Description |
---|---|---|
$partial | string |
string
|
$params | array |
array
|
$throwException | boolean |
boolean
|
Partial contents or false if not throwing an exception.
inherited public makeView (string $view) : string
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
Property | Type | Description |
---|---|---|
$view | string |
string
|
inherited
public
makeViewContent (string $contents, $layout = null
)
: string
Renders supplied contents inside a layout.
Property | Type | Description |
---|---|---|
$contents | string |
string
|
$layout | mixed |
mixed
|
inherited
public
makeWidget (string $class, array $widgetConfig = []
)
: mixed | Backend\Classes\WidgetBase
Makes a widget object with the supplied configuration file.
Property | Type | Description |
---|---|---|
$class | string |
string
Widget class name |
$widgetConfig | array |
array
An array of config. |
The widget object
inherited public mergeConfig (mixed $configA, mixed $configB) : stdClass
Merges two configuration sources, either prepared or not, and returns them as a single configuration object.
Property | Type | Description |
---|---|---|
$configA | mixed |
mixed
|
$configB | mixed |
mixed
|
The config object
inherited public methodExists (string $name) : bool
Checks if a method exists, extension equivalent of method_exists()
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited public onUpload () : Illuminate\Http\Response | null
Process file uploads submitted via AJAX
inherited public orderAssets (array $assets) : array
Prioritize assets based on the given order.
Property | Type | Description |
---|---|---|
$assets | array |
array
|
inherited public propertyExists (string $name) : bool
Checks if a property exists, extension equivalent of property_exists()
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited public putUserPreference (string $key, mixed $value) : void
Saves a widget related key/value pair in to the users preferences
Property | Type | Description |
---|---|---|
$key | string |
string
Unique key for the data store. |
$value | mixed |
mixed
The value to store. |
inherited public resetSession () : void
Resets all session data related to this widget.
inherited public uploadableGetDisk () : Illuminate\Filesystem\FilesystemAdapter
Returns the disk that will be used to store the uploaded file
inherited public uploadableGetUploadPath (string $fileName) : string
Returns the path on the disk to store the uploaded file
Property | Type | Description |
---|---|---|
$fileName | string |
string
|
inherited public uploadableGetUploadUrl (string $diskPath) : string
Returns the URL to the uploaded file
Property | Type | Description |
---|---|---|
$diskPath | string |
string
|
inherited public validateMediaFileName (string $fileName, string $extension) : string
Property | Type | Description |
---|---|---|
$fileName | string |
string
|
$extension | string |
string
|
inherited protected addAsset (string $type, string $path, array $attributes) : void
Adds the provided asset to the internal asset collections
Property | Type | Description |
---|---|---|
$type | string |
string
|
$path | string |
string
|
$attributes | array |
array
|
inherited protected cleanFileName (string $name) : string
Creates a slug form the string. A modified version of Str::slug with the main difference that it accepts @-signs
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited
protected
extendableAddLocalExtension (Closure $callback, $outerScope = null
)
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.
Property | Type | Description |
---|---|---|
$callback | Closure |
Closure
|
$outerScope | mixed |
mixed
|
inherited protected extendableIsAccessible (mixed $class, string $propertyName) : bool
Checks if a property is accessible, property equivalent of is_callable()
Property | Type | Description |
---|---|---|
$class | mixed |
mixed
|
$propertyName | string |
string
|
inherited protected extensionCallMethod (ReflectionClass $class, string $method, array $params)
Calls a method through reflection.
Property | Type | Description |
---|---|---|
$class | ReflectionClass |
ReflectionClass
|
$method | string |
string
|
$params | array |
array
|
inherited protected extensionExtractMethods (string $extensionName, object $extensionObject) : void
Extracts the available methods from a behavior and adds it to the list of callable methods.
Property | Type | Description |
---|---|---|
$extensionName | string |
string
|
$extensionObject | object |
object
|
inherited protected extensionGetClassLoader () : Winter\Storm\Support\ClassLoader | null
Gets the class loader
inherited
protected
extensionGetParentClass ($instance = null
)
: ReflectionClass | false
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.
Property | Type | Description |
---|---|---|
$instance | mixed |
mixed
|
inherited protected extensionMethodExists (ReflectionClass $class, string $methodName) : bool
Determines if the given class reflection contains the given method.
Property | Type | Description |
---|---|---|
$class | ReflectionClass |
ReflectionClass
|
$methodName | string |
string
|
inherited protected extensionNormalizeClassName (string $name) : string
Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited
protected
fillFromConfig (array $properties = null
)
: void
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.
Property | Type | Description |
---|---|---|
$properties | array |
array
|
inherited protected getAssetEntryBuildPath (array $asset) : string
Internal helper, attaches a build code to an asset path
Property | Type | Description |
---|---|---|
$asset | array |
array
|
inherited protected getAssetScheme (string $asset) : string
Internal helper, get asset scheme
Property | Type | Description |
---|---|---|
$asset | string |
string
|
inherited protected getLocalPath (string | null $relativePath) : string
Property | Type | Description |
---|---|---|
$relativePath | string | null |
string | null
|
inherited protected getPreferenceStorage () : Winter\Storm\Database\Model
inherited
protected
getSession (string $key = null
, string $default = null
)
: string
Retrieves a widget related key/value pair from session data.
Property | Type | Description |
---|---|---|
$key | string |
string
Unique key for the data store. |
$default | string |
string
A default value to use when value is not found. |
inherited protected handleViewException (Throwable $e, integer $obLevel) : void
Handle a view exception.
Property | Type | Description |
---|---|---|
$e | Throwable |
Throwable
|
$obLevel | integer |
integer
|
inherited protected makeSessionId () : string
Returns a unique session identifier for this widget and controller action.
inherited protected onUploadDirect () : Illuminate\Http\Response
inherited protected putSession (string $key, mixed $value) : void
Saves a widget related key/value pair in to session data.
Property | Type | Description |
---|---|---|
$key | string |
string
Unique key for the data store. |
$value | mixed |
mixed
The value to store. |
inherited protected removeDuplicates () : void
Removes duplicate assets from the entire collection.
inherited protected validateFileName ($name) : bool
Validate a proposed media item file name.
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
inherited protected validateFileType ($name) : bool
Check for blocked / unsafe file extensions
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
Extended by
Class | Description |
---|---|
MediaManager
|
Media Manager widget. |