Class TreeView.

Implementation for tree displaying.

 Methods

Handle ajax rendering of a sub tree.

ajaxTreeView(string $rootId, string $providerName, int $level) : string

Parameters

$rootId

string

Id of the root node.

$providerName

string

Name of the data provider where the model is contained within.

$level

int

Level depth of the model in the whole tree.

Returns

string

{@inheritDoc}

enforceModelRelationship($model) 

Parameters

$model

Handle an ajax call.

handleAjaxCall() : void
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Load the collection of child items and the parent item for the currently selected parent item.

loadCollection(string $rootId, int $intLevel, string $providerName) : \ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

Parameters

$rootId

string

The root element (or null to fetch everything).

$intLevel

int

The current level in the tree (of the optional root element).

$providerName

string

The data provider from which the optional root element shall be taken from.

Returns

{@inheritDoc}

paste(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

Render the paste button for pasting into the root of the tree.

renderPasteRootButton(\ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetPasteRootButtonEvent $event) : string
Static

Parameters

Returns

string

{@inheritdoc}

showAll(\ContaoCommunityAlliance\DcGeneral\Action $action) 

Parameters

$action

Calculate the fields needed by a tree label for the given data provider name.

calcLabelFields(string $strTable) : array

Parameters

$strTable

string

The name of the data provider.

Returns

array

Render the tree view and return it as string.

generateTreeView(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $objCollection, string $treeClass) : string

Parameters

$objCollection

\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface

The collection to iterate over.

$treeClass

string

The class to use for the tree.

Returns

string

Retrieve the id for this view.

getToggleId() : string

Returns

string

Determine if the passed model is expanded.

isModelOpen(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) : bool

Parameters

Returns

bool

Load the parent model for the current list.

loadParentModel() : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If the parent view requirements are not fulfilled - either no data provider defined or no parent model id given.

Returns

Render a given model.

parseModel(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objModel, string $strToggleID) : string

Parameters

$strToggleID

string

The id of the toggler.

Returns

string

Save a tree node states instance to the session.

saveTreeNodeStates(\ContaoCommunityAlliance\DcGeneral\Controller\TreeNodeStates $states) : void

Parameters

Render the tree view.

viewTree(\ContaoCommunityAlliance\DcGeneral\Data\CollectionInterface $collection) : string

Parameters

Returns

string

Check the get parameters if there is any node toggling.

handleNodeStateChanges() : void
CAUTION: If there has been any action, the browser will get redirected and the script therefore exited.

Toggle the model with the given id from the given provider.

toggleModel(string $providerName, mixed $modelId) : void

Parameters

$providerName

string

The data provider name.

$modelId

mixed

The id of the model.