Class BaseView.

This class is the base class for the different backend view mode sub classes.

 Methods

{@inheritDoc}

create(\ContaoCommunityAlliance\DcGeneral\Action $action) 
SuppressWarnings (PHPMD.UnusedFormalParameter)

Parameters

$action

Exceptions

\RuntimeException This method os not in use anymore.

{@inheritDoc}

delete(\ContaoCommunityAlliance\DcGeneral\Action $action) 
NOTE: This method redirects the user to the listing and therefore the script will be ended.

Parameters

$action

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If the model to delete could not be loaded.

{@inheritdoc}

edit(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When the model could not be found by the data provider.

{@inheritdoc}

enforceModelRelationship($model) 

Parameters

$model

Return the formatted value for use in group headers as string.

formatCurrentValue(string $field, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, string $groupMode, int $groupLength) : string
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

$field

string

The name of the property to format.

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model from which the value shall be taken from.

$groupMode

string

The grouping mode in use.

$groupLength

int

The length of the value to use for grouping (only used when grouping mode is ListingConfigInterface::GROUP_CHAR).

Returns

string

{@inheritDoc}

getEnvironment() 

{@inheritDoc}

getPanel() 

{@inheritDoc}

getSubscribedEvents() 
Static

Handle the given action.

handleAction(\ContaoCommunityAlliance\DcGeneral\Event\ActionEvent $event) : void
SuppressWarnings (PHPMD.CyclomaticComplexity)
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

Handle an ajax call by passing it to the relevant handler class.

handleAjaxCall() : void
The handler class might(!) exit the script.

{@inheritDoc}

move(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

{@inheritdoc}

paste(\ContaoCommunityAlliance\DcGeneral\Action $action) 
This performs redirectHome() upon successful execution and throws an exception otherwise.

Parameters

$action

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When invalid parameters are encountered.

Render the paste after button.

renderPasteAfterButton(\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetPasteButtonEvent $event) : string

Parameters

Returns

string

Render the paste into button.

renderPasteIntoButton(\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetPasteButtonEvent $event) : string

Parameters

Returns

string

{@inheritDoc}

setEnvironment(\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface $environment) 

Parameters

$environment

{@inheritDoc}

setPanel($panelContainer) 

Parameters

$panelContainer

{@inheritdoc}

showAll(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

{@inheritdoc}

undo(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

Add the value to the template.

addToTemplate(string $name, mixed $value, \Template $template) : \ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\BaseView

Parameters

$name

string

Name of the value.

$value

mixed

The value to add to the template.

$template

\Template

The template to add the value to.

Returns

Get the breadcrumb navigation via event.

breadcrumb() : string
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Returns

string

Render a command button.

buildCommand(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\View\CommandInterface $objCommand, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel, bool $blnCircularReference, array $arrChildRecordIds, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $previous, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $next) : string

Parameters

$objModel

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model to which the command shall get applied.

$blnCircularReference

bool

Determinator if there exists a circular reference between the model and the model(s) contained in the clipboard.

$arrChildRecordIds

array

List of the ids of all child models of the current model.

$previous

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The previous model in the collection.

$next

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The next model in the collection.

Returns

string

Check the submitted data if we want to restore a previous version of a model.

checkRestoreVersion() : void
If so, the model will get loaded and marked as active version in the data provider and the client will perform a reload of the page.
SuppressWarnings (PHPMD.LongVariable)

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When the requested version could not be located in the database.

Create the edit mask.

createEditMask(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $originalModel, callable $preFunction, callable $postFunction) : string
SuppressWarnings (PHPMD.LongVariable)

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model with the current data.

$originalModel

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The data from the original data.

$preFunction

callable

The function to call before saving an item.

$postFunction

callable

The function to call after saving an item.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If the data container is not editable, closed.
\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException If an unknown property is encountered in the palette.

Returns

string

Create an empty model using the default values from the definition.

createEmptyModelWithDefaults() : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
deprecated Use Controller::createEmptyModelWithDefaults() instead!

Returns

Compile buttons from the table configuration array and return them as HTML.

generateButtons(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $previous, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $next) : string

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model for which the buttons shall be generated for.

$previous

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The previous model in the collection.

$next

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The next model in the collection.

Returns

string

Render a single header button.

generateHeaderButton(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\View\CommandInterface $command) : string

Parameters

Returns

string

Generate all buttons for the header of a view.

generateHeaderButtons(string $strButtonId) : string

Parameters

$strButtonId

string

The id for the surrounding html div element.

Returns

string

Calculate the label of a property to se in "show" view.

getLabelForShow(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\Properties\PropertyInterface $property) : string

Parameters

$property

\ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\Properties\PropertyInterface

The property for which the label shall be calculated.

Returns

string

Retrieve a list of html buttons to use in the bottom panel (submit area) when in select mode.

getSelectButtons() : string[]

Returns

string[]

Create a new instance of ContaoBackendViewTemplate with the template file of the given name.

getTemplate(string $strTemplate) : \ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\ContaoBackendViewTemplate

Parameters

$strTemplate

string

Name of the template to create.

Returns

Determine if we are currently working in multi language mode.

isMultiLanguage(mixed $mixId) : bool

Parameters

$mixId

mixed

The id of the current model.

Returns

bool

Determine if the select mode is currently active or not.

isSelectModeActive() : bool

Returns

bool

Render the panel.

panel(string[] $ignoredPanels) : string

Parameters

$ignoredPanels

string[]

A list with ignored elements [Optional].

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When no information of panels can be obtained from the data container.

Returns

string

Translate a string via the translator.

translate(string $path, string|null $section) : string

Parameters

$path

string

The path within the translation where the string can be found.

$section

stringnull

The section from which the translation shall be retrieved.

Returns

string

 Properties

 

The attached environment.

$environment : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface
 

The error message format string to use when a method is not implemented.

$notImplMsg : string