\Charcoal\Admin\WidgetFormSidebarWidget

Form Sidebar Widget

Summary

Methods
Properties
Constants
setDependencies()
setTemplate()
template()
setWidgetId()
widgetId()
setType()
type()
setIdent()
ident()
setDataSources()
dataSources()
dataSourceFilter()
setLabel()
label()
actions()
setShowActions()
showActions()
setShowLabel()
showLabel()
adminUrl()
setBaseUrl()
baseUrl()
setPriority()
priority()
setData()
setForm()
form()
setSidebarProperties()
sidebarProperties()
hasSidebarProperties()
numSidebarProperties()
setPropertiesOptions()
propertiesOptions()
formProperties()
showSidebarActions()
sidebarActions()
jsActionPrefix()
isObjDeletable()
isObjResettable()
isObjSavable()
isObjViewable()
setShowTitle()
showTitle()
setTitle()
title()
setShowSubtitle()
showSubtitle()
setSubtitle()
subtitle()
showFooter()
setShowFooter()
showLanguageSwitch()
languages()
requiredGlobalAclPermissions()
setRequiredGlobalAclPermissions()
$widgetId
DATA_SOURCE_REQUEST
DATA_SOURCE_OBJECT
DEFAULT_ACTION_PRIORITY
setModelFactory()
modelFactory()
addDataSources()
acceptedDataSources()
defaultDataSources()
defaultDataSourceFilters()
resolveDataSourceFilter()
mergeDataSources()
setSidebarActions()
createSidebarActions()
parseAsSidebarActions()
defaultSidebarActions()
checkPermission()
isAssoc()
$baseUrl
$adminConfig
$priority
$sidebarActions
$defaultSidebarActions
$parsedSidebarActions
$sidebarProperties
$title
$showFooter
N/A
No private methods found
$type
$template
$ident
$label
$lang
$showLabel
$showActions
$dataSources
$dataSourceFilters
$modelFactory
$form
$widgetType
$propertiesOptions
$showTitle
$showSubtitle
$subtitle
$requiredGlobalAclPermissions
N/A

Constants

DATA_SOURCE_REQUEST

DATA_SOURCE_REQUEST

DATA_SOURCE_OBJECT

DATA_SOURCE_OBJECT

DEFAULT_ACTION_PRIORITY

DEFAULT_ACTION_PRIORITY

Default sorting priority for an action.

Properties

$widgetId

$widgetId : string

Type

string

$baseUrl

$baseUrl : \Psr\Http\Message\UriInterface|string

The base URI.

Type

\Psr\Http\Message\UriInterface|string

$adminConfig

$adminConfig : \Charcoal\Admin\Config

Store a reference to the admin configuration.

Type

\Charcoal\Admin\Config

$priority

$priority : integer

Priority, or sorting index.

Type

integer

$sidebarActions

$sidebarActions : array|null

Store the sidebar actions.

Type

array|null

$defaultSidebarActions

$defaultSidebarActions : array|null

Store the default list actions.

Type

array|null

$parsedSidebarActions

$parsedSidebarActions : boolean

Keep track if sidebar actions are finalized.

Type

boolean

$sidebarProperties

$sidebarProperties : array

Type

array

$title

$title : \Charcoal\Translator\Translation|string|null

The sidebar's title.

Type

\Charcoal\Translator\Translation|string|null

$showFooter

$showFooter : boolean

Type

boolean

$type

$type : string

Type

string

$template

$template : string

Type

string

$ident

$ident : string

Type

string

$label

$label : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$lang

$lang : string

Type

string

$showLabel

$showLabel : boolean

Type

boolean

$showActions

$showActions : boolean

Type

boolean

$dataSources

$dataSources : array

Extra data sources to merge when setting data on an entity.

Type

array

$dataSourceFilters

$dataSourceFilters : array

Associative array of source identifiers and options to apply when merging.

Type

array

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$form

$form : \Charcoal\Ui\Form\FormInterface

Store a reference to the parent form widget.

Type

\Charcoal\Ui\Form\FormInterface

$widgetType

$widgetType : string

Type

string

$propertiesOptions

$propertiesOptions : array

Type

array

$showTitle

$showTitle : boolean

The title is displayed by default.

Type

boolean

$showSubtitle

$showSubtitle : boolean

The subtitle is displayed by default.

Type

boolean

$subtitle

$subtitle : \Charcoal\Translator\Translation|string|null

The sidebar's subtitle.

Type

\Charcoal\Translator\Translation|string|null

$requiredGlobalAclPermissions

$requiredGlobalAclPermissions : array<mixed,string>

The required Acl permissions for the whole sidebar.

Type

array<mixed,string>

Methods

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Parameters

\Pimple\Container $container

Pimple DI container.

setTemplate()

setTemplate(string  $template) : \Charcoal\Admin\UiItemInterface

Parameters

string $template

The UI item's template (identifier).

Throws

\InvalidArgumentException

If the template identifier is not a string.

Returns

\Charcoal\Admin\UiItemInterface —

Chainable

template()

template() : string

Returns

string

setWidgetId()

setWidgetId(string  $widgetId) : \Charcoal\Admin\AdminWidget

Parameters

string $widgetId

The widget identifier.

Returns

\Charcoal\Admin\AdminWidget

Chainable

widgetId()

widgetId() : string

Returns

string

setType()

setType(string  $type) : \Charcoal\Admin\AdminWidget

Parameters

string $type

The widget type.

Throws

\InvalidArgumentException

If the argument is not a string.

Returns

\Charcoal\Admin\AdminWidget

Chainable

type()

type() : string

Returns

string

setIdent()

setIdent(string  $ident) : \Charcoal\Admin\AdminWidget

Parameters

string $ident

The widget ident.

Throws

\InvalidArgumentException

If the ident is not a string.

Returns

\Charcoal\Admin\AdminWidget

(Chainable)

ident()

ident() : string

Returns

string

setDataSources()

setDataSources(mixed  $sources) : \Charcoal\Admin\AdminWidget

Set extra data sources to merge when setting data on an entity.

Parameters

mixed $sources

One or more data source identifiers to merge data from. Pass NULL to reset the entity back to default sources. Pass FALSE, an empty string or array to disable extra sources.

Returns

\Charcoal\Admin\AdminWidget

Chainable

dataSources()

dataSources() : array<mixed,string>

Retrieve the extra data sources to merge when setting data on an entity.

Returns

array<mixed,string>

dataSourceFilter()

dataSourceFilter(string  $sourceIdent) : callable|null

Retrieve the callable filter for the given data source.

Parameters

string $sourceIdent

A data source identifier.

Throws

\InvalidArgumentException

If the data source is invalid.

Returns

callable|null —

Returns a callable variable.

setLabel()

setLabel(mixed  $label) : \Charcoal\Admin\AdminWidget

Parameters

mixed $label

The label.

Returns

\Charcoal\Admin\AdminWidget

Chainable

label()

label() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

actions()

actions() : array

Returns

array

setShowActions()

setShowActions(boolean  $show) : \Charcoal\Admin\AdminWidget

Parameters

boolean $show

The show actions flag.

Returns

\Charcoal\Admin\AdminWidget

Chainable

showActions()

showActions() : boolean

Returns

boolean

setShowLabel()

setShowLabel(boolean  $show) : \Charcoal\Admin\AdminWidget

Parameters

boolean $show

The show label flag.

Returns

\Charcoal\Admin\AdminWidget

Chainable

showLabel()

showLabel() : boolean

Returns

boolean

adminUrl()

adminUrl() : \Psr\Http\Message\UriInterface|string

Retrieve the base URI of the administration area.

Returns

\Psr\Http\Message\UriInterface|string

setBaseUrl()

setBaseUrl(\Psr\Http\Message\UriInterface|string  $uri) : self

Set the base URI of the application.

Parameters

\Psr\Http\Message\UriInterface|string $uri

The base URI.

Returns

self

baseUrl()

baseUrl() : \Psr\Http\Message\UriInterface|string

Retrieve the base URI of the application.

Returns

\Psr\Http\Message\UriInterface|string

setPriority()

setPriority(integer  $priority) : \Charcoal\Admin\Widget\FormSidebarWidget

Set the widget's priority or sorting index.

Parameters

integer $priority

An index, for sorting.

Throws

\InvalidArgumentException

If the priority is not a number.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

priority()

priority() : integer

Retrieve the widget's priority or sorting index.

Returns

integer

setData()

setData(array|\Charcoal\Admin\Widget\ArrayInterface  $data) : \Charcoal\Admin\Widget\FormSidebarWidget

Parameters

array|\Charcoal\Admin\Widget\ArrayInterface $data

Class data.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

setForm()

setForm(\Charcoal\Ui\Form\FormInterface  $form) : \Charcoal\Admin\Widget\FormSidebarWidget

Set the form widget the sidebar belongs to.

Parameters

\Charcoal\Ui\Form\FormInterface $form

The related form widget.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

form()

form() : \Charcoal\Ui\Form\FormInterface

Retrieve the form widget the sidebar belongs to.

Returns

\Charcoal\Ui\Form\FormInterface

setSidebarProperties()

setSidebarProperties(array  $properties) : \Charcoal\Admin\Widget\FormSidebarWidget

Set the form's object properties to show in the sidebar.

Parameters

array $properties

The form's object properties.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

sidebarProperties()

sidebarProperties() : mixed

Retrieve the form's object properties to show in the sidebar.

Returns

mixed

hasSidebarProperties()

hasSidebarProperties() : boolean

Determine if the sidebar has any object properties.

Returns

boolean

numSidebarProperties()

numSidebarProperties() : integer

Count the number of object properties in the sidebar.

Returns

integer

setPropertiesOptions()

setPropertiesOptions(array  $properties) : \Charcoal\Admin\Widget\FormSidebarWidget

Set the map of object property customizations.

Parameters

array $properties

The options to customize the group properties.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

propertiesOptions()

propertiesOptions() : array

Retrieve the map of object property customizations.

Returns

array

formProperties()

formProperties() : mixed|\Charcoal\Admin\Widget\Generator

Retrieve the object's properties from the form.

Returns

mixed|\Charcoal\Admin\Widget\Generator

showSidebarActions()

showSidebarActions() : boolean

Determine if the sidebar's actions should be shown.

Returns

boolean

sidebarActions()

sidebarActions() : array

Retrieve the sidebar's actions.

Returns

array

jsActionPrefix()

jsActionPrefix() : string

Returns

string

isObjDeletable()

isObjDeletable() : boolean

Determine if the object can be deleted.

If TRUE, the "Delete" button is shown. The object can still be deleted programmatically or via direct action on the database.

Returns

boolean

isObjResettable()

isObjResettable() : boolean

Determine if the object can be reset.

If TRUE, the "Reset" button is shown. The object can still be reset to its default values programmatically or emptied via direct action on the database.

Returns

boolean

isObjSavable()

isObjSavable() : boolean

Determine if the object can be saved.

If TRUE, the "Save" button is shown. The object can still be saved programmatically.

Returns

boolean

isObjViewable()

isObjViewable() : boolean

Determine if the object can be viewed (on the front-end).

If TRUE, any "View" button is shown. The object can still be saved programmatically.

Returns

boolean

setShowTitle()

setShowTitle(boolean  $show) : \Charcoal\Admin\Widget\UiItemInterface

Show/hide the widget's title.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the title.

Returns

\Charcoal\Admin\Widget\UiItemInterface —

Chainable

showTitle()

showTitle() : boolean

Determine if the title is to be displayed.

Returns

boolean —

If TRUE or unset, check if there is a title.

title()

title() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setShowSubtitle()

setShowSubtitle(boolean  $show) : \Charcoal\Admin\Widget\FormSidebarWidget

Parameters

boolean $show

The show subtitle flag.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

showSubtitle()

showSubtitle() : boolean

Returns

boolean

setSubtitle()

setSubtitle(mixed  $subtitle) : \Charcoal\Admin\Widget\FormSidebarWidget

Parameters

mixed $subtitle

The sidebar widget subtitle.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable

subtitle()

subtitle() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

showFooter()

showFooter() : boolean

Returns

boolean

showLanguageSwitch()

showLanguageSwitch() : boolean

Returns

boolean

languages()

languages() : array

Retrieve the available languages, formatted for the sidebar language-switcher.

Returns

array

requiredGlobalAclPermissions()

requiredGlobalAclPermissions() : array<mixed,string>

Returns

array<mixed,string>

setRequiredGlobalAclPermissions()

setRequiredGlobalAclPermissions(array  $permissions) : self

Parameters

array $permissions

The GlobalAcl permissions required pby the form group.

Returns

self

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\AdminScript

Parameters

\Charcoal\Factory\FactoryInterface $factory

The factory used to create models.

Returns

\Charcoal\Admin\AdminScript

Chainable

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Returns

\Charcoal\Factory\FactoryInterface —

The model factory.

addDataSources()

addDataSources(mixed  $sourceIdent, mixed  $sourceFilter = null) : \Charcoal\Admin\AdminWidget

Set extra data sources to merge when setting data on an entity.

Parameters

mixed $sourceIdent

The data source identifier.

mixed $sourceFilter

Optional filter to apply to the source's data.

Throws

\InvalidArgumentException

If the data source is invalid.

Returns

\Charcoal\Admin\AdminWidget

Chainable

acceptedDataSources()

acceptedDataSources() : array<mixed,string>

Retrieve the available data sources (when setting data on an entity).

Returns

array<mixed,string>

defaultDataSources()

defaultDataSources() : array<mixed,string>

Retrieve the default data sources (when setting data on an entity).

Returns

array<mixed,string>

defaultDataSourceFilters()

defaultDataSourceFilters() : array

Retrieve the default data source filters (when setting data on an entity).

Returns

array

resolveDataSourceFilter()

resolveDataSourceFilter(mixed  $toResolve) : callable|null

Retrieve the default data source filters (when setting data on an entity).

Note: Adapted from \Slim\CallableResolver.

Parameters

mixed $toResolve

A callable used when merging data.

Returns

callable|null

mergeDataSources()

mergeDataSources(array|\Charcoal\Admin\ArrayInterface  $dataset = null) : \Charcoal\Admin\AdminWidget

Retrieve the available data sources (when setting data on an entity).

Parameters

array|\Charcoal\Admin\ArrayInterface $dataset

The entity data.

Returns

\Charcoal\Admin\AdminWidget

Chainable

setSidebarActions()

setSidebarActions(array  $actions) : \Charcoal\Admin\Widget\FormSidebarWidget

Set the sidebar's actions.

Parameters

array $actions

One or more actions.

Returns

\Charcoal\Admin\Widget\FormSidebarWidget

Chainable.

createSidebarActions()

createSidebarActions(array  $actions) : array

Build the sidebar's actions.

Sidebar actions should come from the form settings defined by the "sidebars". It is still possible to completly override those externally by setting the "actions" with the \self::setSidebarActions() method.

Parameters

array $actions

Actions to resolve.

Returns

array —

Sidebar actions.

parseAsSidebarActions()

parseAsSidebarActions(array  $actions) : array

Parse the given actions as object actions.

Parameters

array $actions

Actions to resolve.

Returns

array

defaultSidebarActions()

defaultSidebarActions() : array

Retrieve the sidebar's default actions.

Returns

array

checkPermission()

checkPermission(string  $permissionName) : boolean

Return true if the user as required permissions.

Parameters

string $permissionName

The permission name to check against the user's permissions.

Returns

boolean

isAssoc()

isAssoc(array  $array) : boolean

Parameters

array $array

Detect if $array is assoc or not.

Returns

boolean