Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cGuiBackendHelpbox
  • cGuiFileOverview
  • cGuiFoldingRow
  • cGuiList
  • cGuiMenu
  • cGuiNavigation
  • cGuiNotification
  • cGuiObjectPager
  • cGuiPage
  • cGuiScrollList
  • cGuiSourceEditor
  • cGuiTableForm
  • cGuiTree
  • cPager
  • cTemplate
  • cTree
  • cTreeItem
  • NoteLink
  • NoteList
  • NoteListItem
  • NoteView
  • TODOLink
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cTreeItem

Tree item class.

Direct known subclasses

cTree

Indirect known subclasses

cGuiTree
Package: Core\GUI
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Bjoern Behrens
Located at classes/tree/class.ctreeitem.php
Methods summary
public
# __construct( string $id = "", string $name = "", boolean $collapsed = false )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

Parameters

$id
string
$id [optional]
$name
string
$name [optional]
$collapsed
boolean
$collapsed [optional]
public string
# getId( )

Id getter.

Id getter.

Returns

string
public string
# getName( )

Name getter.

Name getter.

Returns

string
public boolean
# getCollapsed( )

Collapsed state getter.

Collapsed state getter.

Returns

boolean
public boolean
# importTable( array $flat_array )

Imports a table from an array of arrays.

Imports a table from an array of arrays.

The entries "collapsed" and "attributes" are optional!

Parameters

$flat_array
array
$flat_array array( array( "id" => "Item ID", "name" => "Item name", "level" => 1, "collapsed" => true|false, "attributes" => array( "attr_name" => "attr_value" ) ) )

Returns

boolean
public
# importStructuredArray( array $array )

Parameters

$array
array
$array
protected boolean
# _flattenArray( array $sourcearray, array & $destarray, integer & $lastid, integer & $level )

Parameters

$sourcearray
array
$sourcearray
$destarray
array
$destarray
$lastid
integer
$lastid
$level
integer
$level

Returns

boolean
public
# addItem( cTreeItem & $item )

Adds an item as a subitem to the current item.

Adds an item as a subitem to the current item.

Parameters

$item
cTreeItem
$item item object to add
public boolean
# addItemToID( string $id, cTreeItem & $item )

Adds an item to a specific ID.

Adds an item to a specific ID.

Parameters

$id
string
$id ID to add the item to
$item
cTreeItem
$item Item to add

Returns

boolean
public
# moveItem( cTreeItem $targetItem, mixed $itemToMove )

Moves an item to another object.

Moves an item to another object.

Parameters

$targetItem
cTreeItem
$targetItem Item to move the subitem to
$itemToMove
mixed
$itemToMove cTreeItem-Object or id of object to move
public object
# deleteItem( mixed $id )

Deletes a subitem.

Deletes a subitem.

Parameters

$id
mixed
$id item object or ID to delete

Returns

object
deleted object
public cTreeItem &
# getItemByID( string $id )

Retrieves a specific item by its ID.

Retrieves a specific item by its ID.

Note that this function traverses all subitems to find the correct item.

Parameters

$id
string
$id ID to retrieve

Returns

cTreeItem
public
# setAttribute( string $attributeName, array $attributeValue )

Sets a custom attribute for this TreeItem.

Sets a custom attribute for this TreeItem.

Parameters

$attributeName
string
$attributeName
$attributeValue
array
$attributeValue The value(s) of the attribute
public
# setAttributes( array $aAttributeArray )

Sets a bunch of attributes.

Sets a bunch of attributes.

Parameters

$aAttributeArray
array
$aAttributeArray
public mixed
# getAttribute( string $attributeName )

Returns an attribute.

Returns an attribute.

Parameters

$attributeName
string
$attributeName

Returns

mixed
public boolean
# deleteAttribute( string $attributeName )

Deletes an attribute.

Deletes an attribute.

Parameters

$attributeName
string
$attributeName

Returns

boolean
public boolean
# hasAttribute( string $attributeName, boolean $bRecursive = false )

Parameters

$attributeName
string
$attributeName
$bRecursive
boolean
$bRecursive [optional]

Returns

boolean
public boolean
# setExpanded( mixed $id )

Parameters

$id
mixed
$id expand ID of item to expand or array of item ID's to expand

Returns

boolean
public |boolean
# setCollapsed( mixed $id )

Parameters

$id
mixed
$id collapse ID to collapse or an array with items to collapse

Returns

|boolean
protected
# _expandBelowLevel( integer $leveloffset )

Parameters

$leveloffset
integer
$leveloffset leveloffset Level offset. Ignores all expand operations below the offset.
protected
# _collapseBelowLevel( integer $leveloffset )

Parameters

$leveloffset
integer
$leveloffset Level offset. Ignores all expand operations below the offset.
protected
# _expandBelowID( string $id, boolean $found = false )

Parameters

$id
string
$id
$found
boolean
$found [optional]
protected
# _collapseBelowID( string $id, boolean $found = false )

Parameters

$id
string
$id
$found
boolean
$found [optional]
public
# getCollapsedList( array & $list )

Returns all items (as ID array) which are collapsed.

Returns all items (as ID array) which are collapsed.

Parameters

$list
array
$list Contains the list with all collapsed items
public
# getExpandedList( array & $list )

Returns all items (as ID array) which are expanded.

Returns all items (as ID array) which are expanded.

Parameters

$list
array
$list Contains the list with all expanded items
public
# setPayloadObject( object $payload )

Sets a payload object for later reference.

Sets a payload object for later reference.

Parameters

$payload
object
$payload The object to payload
public object
# unsetPayloadObject( )

Unsets a payload object.

Unsets a payload object.

Returns

object
public
# traverse( array & $objects, integer $level = 0 )

Traverses the tree starting from this item, and returning all objects as $objects in a nested array.

Traverses the tree starting from this item, and returning all objects as $objects in a nested array.

Parameters

$objects
array
$objects all found objects
$level
integer
$level [optional] Level to start on
public array
# flatTraverse( integer $level = 0 )

Traverses the tree starting from this item, and returning all objects as $objects in a flat array.

Traverses the tree starting from this item, and returning all objects as $objects in a flat array.

Parameters

$level
integer
$level [optional] Level to start on

Returns

array
public
# setName( string $name )

Sets the name for this item.

Sets the name for this item.

Parameters

$name
string
$name New name for this item
Properties summary
protected array $_subitems array()
#

Sub Items of this tree item

Sub Items of this tree item

protected boolean $_collapsed
#

Determinates if this tree item is collapsed

Determinates if this tree item is collapsed

protected string $_id
#

ID of this tree item

ID of this tree item

protected string $_name
#

Name of this tree item

Name of this tree item

protected integer $_level
#

level of this tree item

level of this tree item

protected array $_attributes array()
#

Contains custom entries

Contains custom entries

protected array $_parent false
#

parent of this tree item

parent of this tree item

protected array $_next false
#

next sibling of this tree item

next sibling of this tree item

protected array $_previous false
#

previous sibling of this tree item

previous sibling of this tree item

CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0