Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • BaseView
  • ContaoBackendViewTemplate
  • ContaoWidgetManager
  • ListView
  • ParentView
  • TreeView

Interfaces

  • BackendViewInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class TreeView

Class TreeView.

Implementation for tree displaying.

DcGeneral\Contao\View\Contao2BackendView\BaseView implements DcGeneral\Contao\View\Contao2BackendView\BackendViewInterface
Extended by DcGeneral\Contao\View\Contao2BackendView\TreeView
Namespace: DcGeneral\Contao\View\Contao2BackendView
Package: DcGeneral\Contao\View\Contao2BackendView
Located at Contao/View/Contao2BackendView/TreeView.php
Methods summary
protected string
# getToggleId( )

Retrieve the id for this view.

Retrieve the id for this view.

Returns

string
protected array
# getOpenElements( )

Retrieve the ids of all tree nodes that are expanded.

Retrieve the ids of all tree nodes that are expanded.

Returns

array
protected
# toggleModel( string $providerName, mixed $id )

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

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

Parameters

$providerName
string
$providerName The data provider name.
$id
mixed
$id The id of the model.
protected boolean
# isModelOpen( DcGeneral\Data\ModelInterface $model )

Determine if the passed model is expanded.

Determine if the passed model is expanded.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model to check.

Returns

boolean
public DcGeneral\Data\CollectionInterface
# loadCollection( mixed $rootId = null, integer $intLevel = 0, null $providerName = null )

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

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

Parameters

$rootId
mixed
$rootId The root element (or null to fetch everything).
$intLevel
integer
$intLevel The current level in the tree (of the optional root element).
$providerName
null
$providerName The data provider from which the optional root element shall be taken from.

Returns

DcGeneral\Data\CollectionInterface
protected DcGeneral\Data\ModelInterface
# loadParentModel( )

Load the parent model for the current list.

Load the parent model for the current list.

Returns

DcGeneral\Data\ModelInterface

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If the parent view requirements are not fulfilled - either no data provider defined or no parent model id given.
protected array
# calcLabelFields( string $strTable )

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

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

Parameters

$strTable
string
$strTable The name of the data provider.

Returns

array
protected
# determineModelState( DcGeneral\Data\ModelInterface $model, integer $level )

Check the state of a model and set the metadata accordingly.

Check the state of a model and set the metadata accordingly.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model of which the state shall be checked of.
$level
integer
$level The tree level the model is contained within.
protected
# treeWalkModel( DcGeneral\Data\ModelInterface $objModel, integer $intLevel, array $arrSubTables = array() )

This "renders" a model for tree view.

This "renders" a model for tree view.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to render.
$intLevel
integer
$intLevel The current level in the tree hierarchy.
$arrSubTables
array
$arrSubTables The names of data providers that shall be rendered "below" this item.
public DcGeneral\Data\CollectionInterface
# getTreeCollectionRecursive( array $rootId, integer $intLevel = 0, string $providerName = null )

Recursively retrieve a collection of all complete node hierarchy.

Recursively retrieve a collection of all complete node hierarchy.

Parameters

$rootId
array
$rootId The ids of the root node.
$intLevel
integer
$intLevel The level the items are residing on.
$providerName
string
$providerName The data provider from which the root element originates from.

Returns

DcGeneral\Data\CollectionInterface
protected string
# parseModel( DcGeneral\Data\ModelInterface $objModel, string $strToggleID )

Render a given model.

Render a given model.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to render.
$strToggleID
string
$strToggleID The id of the toggler.

Returns

string
protected string
# generateTreeView( DcGeneral\Data\CollectionInterface $objCollection, string $treeClass )

Parameters

$objCollection
DcGeneral\Data\CollectionInterface
$objCollection The collection to iterate over.
$treeClass
string
$treeClass The class to use for the tree.

Returns

string
public static string
# renderPasteRootButton( DcGeneral\Contao\View\Contao2BackendView\Event\GetPasteRootButtonEvent $event )

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

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

Parameters

$event
DcGeneral\Contao\View\Contao2BackendView\Event\GetPasteRootButtonEvent
$event The event that has been triggered.

Returns

string
protected string
# viewTree( DcGeneral\Data\CollectionInterface $collection )

Render the tree view.

Render the tree view.

Parameters

$collection
DcGeneral\Data\CollectionInterface
$collection The collection of items.

Returns

string
public
# enforceModelRelationship( DcGeneral\Data\ModelInterface $model )

Abstract method to be overridden in the certain child classes.

Abstract method to be overridden in the certain child classes.

Parameters

$model
DcGeneral\Data\ModelInterface
$model The model to be updated.

Overrides

DcGeneral\Contao\View\Contao2BackendView\BaseView::enforceModelRelationship()
public string
# showAll( )

Show all entries from one table.

Show all entries from one table.

Returns

string

Overrides

DcGeneral\Contao\View\Contao2BackendView\BaseView::showAll()
public
# handleAjaxCall( )

Handle an ajax call.

Handle an ajax call.

Overrides

DcGeneral\Contao\View\Contao2BackendView\BaseView::handleAjaxCall()
public string
# ajaxTreeView( string $id, string $providerName, integer $level )

Handle ajax rendering of a sub tree.

Handle ajax rendering of a sub tree.

Parameters

$id
string
$id Id of the root node.
$providerName
string
$providerName Name of the data provider where the model is contained within.
$level
integer
$level Level depth of the model in the whole tree.

Returns

string
Methods inherited from DcGeneral\Contao\View\Contao2BackendView\BaseView
addToTemplate(), breadcrumb(), buildCommand(), checkClipboard(), checkLanguage(), checkRestoreVersion(), copy(), copyAll(), create(), createEditMask(), createEmptyModelWithDefaults(), cut(), cutAll(), delete(), dispatchEvent(), edit(), formatCurrentValue(), formatModel(), generateAjaxPalette(), generateButtons(), generateHeaderButton(), generateHeaderButtons(), getBackCommand(), getButtonLabel(), getClearClipboardCommand(), getCreateModelCommand(), getDataDefinition(), getEditButtons(), getEnvironment(), getGroupingMode(), getLabelForShow(), getPanel(), getReadableFieldValue(), getSelectButtons(), getTemplate(), getViewSection(), handleSubmit(), isMultiLanguage(), isPopup(), isSelectModeActive(), move(), panel(), paste(), processInput(), redirectHome(), renderPasteAfterButton(), renderPasteIntoButton(), setEnvironment(), setPanel(), show(), storeVersion(), translate(), undo()
Properties inherited from DcGeneral\Contao\View\Contao2BackendView\BaseView
$environment, $notImplMsg, $panel
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0