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)
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)
{@inheritdoc}
showAll(\ContaoCommunityAlliance\DcGeneral\Action $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
$treeClass
string
The class to use for the tree.
Returns
string
Retrieve the id for this view.
getToggleId() : string
Determine if the passed model is expanded.
isModelOpen(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) : bool
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
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.