contenido\classes\tree\class.ctree.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: logical cTree

Requirements:

Author
Timo Hummel  
Con_php_req
5.0  
Copyright
four for business AG  
License
http://www.contenido.org/license/LIZENZ.txt  
Link
http://www.4fb.de  
Link
{@internal created 2004-08-04 $Id: class.ctree.php,v 1.2 2004/08/04 07:56:19 timo.hummel Exp $ }}  
Package
Contenido Backend classes  
Version
1.12  

\cTree

Package: Default
class cTree
Parent(s)
\cTreeItem
Children
\cWidgetTreeView

Properties

>VPropertypublicarray $_attributes
inherited
Contains custom entries
Inherited from: \cTreeItem::$$_attributes
Details
Type
array
Inherited_from
\cTreeItem::$$_attributes  
>VPropertypublicboolean $_collapsed
inherited
Determinates if this tree item is collapsed
Inherited from: \cTreeItem::$$_collapsed
Details
Type
boolean
Inherited_from
\cTreeItem::$$_collapsed  
>VPropertypublicstring $_id
inherited
ID for this item
Inherited from: \cTreeItem::$$_id
Details
Type
string
Inherited_from
\cTreeItem::$$_id  
>VPropertypublicinteger $_level
inherited
Contains the level of this item
Inherited from: \cTreeItem::$$_level
Details
Type
integer
Inherited_from
\cTreeItem::$$_level  
>VPropertypublicstring $_name
inherited
Name for this item
Inherited from: \cTreeItem::$$_name
Details
Type
string
Inherited_from
\cTreeItem::$$_name  
>VPropertypublicarray $_next
inherited
Contains the next item
Inherited from: \cTreeItem::$$_next
Details
Type
array
Inherited_from
\cTreeItem::$$_next  
>VPropertypublicarray $_parent
inherited
Contains the parent of this item
Inherited from: \cTreeItem::$$_parent
Details
Type
array
Inherited_from
\cTreeItem::$$_parent  
>VPropertypublicarray $_previous
inherited
Contains the previous item
Inherited from: \cTreeItem::$$_previous
Details
Type
array
Inherited_from
\cTreeItem::$$_previous  
>VPropertypublicarray $_subitems
inherited
Sub Items for this tree item
Inherited from: \cTreeItem::$$_subitems
Details
Type
array
Inherited_from
\cTreeItem::$$_subitems  
>VPropertypublic$_treeIcon
Details
Type
n/a

Methods

methodpublic_flattenArray( $sourcearray,  $destarray,  $lastid,  $level) : void
inherited

Inherited from: \cTreeItem::_flattenArray()
Parameters
NameTypeDescription
$sourcearray
$destarray
$lastid
$level
methodpublicaddItem(\cTreeItem $item) : void
inherited

adds an item as a subitem to the current item

Inherited from: \cTreeItem::addItem()
Parameters
NameTypeDescription
$item\cTreeItem

item item object to add

Details
Access
public  
methodpublicaddItemToID(string $id, \cTreeItem $item) : void
inherited

adds an item to a specific ID

Inherited from: \cTreeItem::addItemToID()
Parameters
NameTypeDescription
$idstring

id ID to add the item to

$item\cTreeItem

item Item to add

Details
Access
public  
methodpubliccTree( $name = "") : void

Parameters
NameTypeDescription
$name
methodpubliccTreeItem( $id = "",  $name = "",  $collapsed = false) : void
inherited

Inherited from: \cTreeItem::cTreeItem()
Parameters
NameTypeDescription
$id
$name
$collapsed
methodpubliccollapseBelowID(int $id,  $found = false) : void
inherited

Inherited from: \cTreeItem::collapseBelowID()
Parameters
NameTypeDescription
$idint

leveloffset Level offset. Ignores all expand operations below the offset.

$found
Details
Access
public  
methodpubliccollapseBelowLevel(int $leveloffset) : void
inherited

Inherited from: \cTreeItem::collapseBelowLevel()
Parameters
NameTypeDescription
$leveloffsetint

leveloffset Level offset. Ignores all expand operations below the offset.

Details
Access
public  
methodpublicdeleteAttribute(string $attributeName) : void
inherited

deletes an attribute

Inherited from: \cTreeItem::deleteAttribute()
Parameters
NameTypeDescription
$attributeNamestring

attributeName

Details
Access
public  
methodpublicdeleteItem(mixed $id) : \deleted
inherited

deletes a subitem

Inherited from: \cTreeItem::deleteItem()
Parameters
NameTypeDescription
$idmixed

item object or ID to delete

Returns
TypeDescription
\deletedobject
Details
Access
public  
methodpublicexpandBelowID(int $id,  $found = false) : void
inherited

Inherited from: \cTreeItem::expandBelowID()
Parameters
NameTypeDescription
$idint

leveloffset Level offset. Ignores all expand operations below the offset.

$found
Details
Access
public  
methodpublicexpandBelowLevel(int $leveloffset) : void
inherited

Inherited from: \cTreeItem::expandBelowLevel()
Parameters
NameTypeDescription
$leveloffsetint

leveloffset Level offset. Ignores all expand operations below the offset.

Details
Access
public  
methodpublicexportTree() : array
inherited

Exports a tree as an array of arrays.

Inherited from: \cTreeItem::exportTree()

Array format: array( array("id" => "Item ID", "name" => "Item name", "level" => 1, "attributes" => array("attr_name" => "attr_value")) );

Returns
TypeDescription
array
Details
Access
public  
methodpublicflatTraverse(integer $level = 0) : void
inherited

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

Inherited from: \cTreeItem::flatTraverse()
Parameters
NameTypeDescription
$levelinteger

Level to start on

methodpublicgetAttribute(string $attributeName) : mixed
inherited

returns an attribute

Inherited from: \cTreeItem::getAttribute()
Parameters
NameTypeDescription
$attributeNamestring

attributeName

Returns
TypeDescription
mixed
Details
Access
public  
methodpublicgetCollapsedList(array $list) : void
inherited

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

Inherited from: \cTreeItem::getCollapsedList()
Parameters
NameTypeDescription
$listarray

Contains the list with all collapsed items

methodpublicgetExpandedList(array $list) : void
inherited

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

Inherited from: \cTreeItem::getExpandedList()
Parameters
NameTypeDescription
$listarray

Contains the list with all expanded items

methodpublicgetItemByID(string $id) : \cTreeItem
inherited

Retrieves a specific item by its ID.

Inherited from: \cTreeItem::getItemByID()

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

Parameters
NameTypeDescription
$idstring

id ID to retrieve

Returns
TypeDescription
\cTreeItem
Details
Access
public  
methodpublichasAttribute( $attributeName,  $bRecursive = false) : void
inherited

Inherited from: \cTreeItem::hasAttribute()
Parameters
NameTypeDescription
$attributeName
$bRecursive
methodpublicimportStructuredArray( $array) : void
inherited

Inherited from: \cTreeItem::importStructuredArray()
Parameters
NameTypeDescription
$array
methodpublicimportTable(array $flat_array) : void
inherited

Imports a table from an array of arrays.

Inherited from: \cTreeItem::importTable()

Array format: array( array("id" => "Item ID", "name" => "Item name", "level" => 1, "collapsed" => true|false, "attributes" => array("attr_name" => "attr_value")) );

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

Parameters
NameTypeDescription
$flat_arrayarray

flat_array See above

Details
Access
public  
methodpublicmoveItem(\cTreeItem $targetItem, mixed $itemToMove) : void
inherited

moves an item to another object

Inherited from: \cTreeItem::moveItem()
Parameters
NameTypeDescription
$targetItem\cTreeItem

targetItem Item to move the subitem to

$itemToMovemixed

itemToMove cTreeItem-Object or id of object to move

Details
Access
public  
methodpublicsetAttribute(string $attributeName, array $attributeValue) : void
inherited

sets a custom attribute for this TreeItem

Inherited from: \cTreeItem::setAttribute()
Parameters
NameTypeDescription
$attributeNamestring

attributeName

$attributeValuearray

attributeValue The value(s) of the attribute

Details
Access
public  
methodpublicsetAttributes(string $aAttributeArray) : void
inherited

sets a bunch of attributes

Inherited from: \cTreeItem::setAttributes()
Parameters
NameTypeDescription
$aAttributeArraystring

attributeName

Details
Access
public  
methodpublicsetCollapsed(mixed $id) : void
inherited

Inherited from: \cTreeItem::setCollapsed()
Parameters
NameTypeDescription
$idmixed

collapse ID to collapse or an array with items to collapse

Details
Access
public  
methodpublicsetExpanded(mixed $id) : void
inherited

Inherited from: \cTreeItem::setExpanded()
Parameters
NameTypeDescription
$idmixed

expand ID of item to expand or array of item ID's to expand

Details
Access
public  
methodpublicsetIcon( $path) : void

Parameters
NameTypeDescription
$path
methodpublicsetName(string $name) : \none
inherited

setName sets the Name for this item.

Inherited from: \cTreeItem::setName()
Parameters
NameTypeDescription
$namestring

New name for this item

Returns
TypeDescription
\none
methodpublicsetPayloadObject(object $payload) : void
inherited

sets a payload object for later reference

Inherited from: \cTreeItem::setPayloadObject()
Parameters
NameTypeDescription
$payloadobject

payload The object to payload

Details
Access
public  
methodpublicsetTreeName(string $name) : void

sets a new name for the tree.

Parameters
NameTypeDescription
$namestring

name Name of the tree

Details
Access
public  
methodpublictraverse(object $objects, integer $level = 0) : void
inherited

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

Inherited from: \cTreeItem::traverse()
Parameters
NameTypeDescription
$objectsobject

all found objects

$levelinteger

Level to start on

methodpublicunsetPayloadObject() : object
inherited

unsets a payload object

Inherited from: \cTreeItem::unsetPayloadObject()
Returns
TypeDescription
object
Details
Access
public  
Documentation was generated by phpDocumentor 2.0.0a12.