It supports folding,
optional gridline marks and item icons.
deprecated |
[2012-07-12] This class was renamed to cGuiTree |
Methods
__construct()
__construct($uuid, $treename)
Parameters
$uuid
$treename
_buildImagePath()
_buildImagePath($image)
Inherited
inherited_from |
\cGuiTree::_buildImagePath() |
Parameters
$image
_getExpandCollapseIcon()
_getExpandCollapseIcon($object)
Inherited
inherited_from |
\cGuiTree::_getExpandCollapseIcon() |
Parameters
$object
Sets collapsed state
_setExpandCollapseLink(\cHTMLLink $link, \cTreeItem $object) : \cHTMLLink
Inherited
inherited_from |
\cGuiTree::_setExpandCollapseLink() |
Parameters
Returns
adds an item as a subitem to the current item
addItem(\cTreeItem $item) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::addItem() |
inherited_from |
\cTree::addItem() |
inherited_from |
\cGuiTree::addItem() |
Parameters
adds an item to a specific ID
addItemToID(string $id, \cTreeItem $item) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::addItemToID() |
inherited_from |
\cTree::addItemToID() |
inherited_from |
\cGuiTree::addItemToID() |
Parameters
$id
string
id ID to add the item to
Applies an action to all items with a certain attribute set.
applyActionByItemAttribute(array $attributes, \cApiClickableAction $action) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::applyActionByItemAttribute() |
Parameters
$attributes
array
attributes Values which need to match. The array key is the attribute name. Multiple array
entries are connected with "AND".
applies an action to all items in the tree.
applyGlobalAction(\cApiClickableAction $action) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::applyGlobalAction() |
Parameters
sets an action to a specific item.
applyItemAction(mixed $item, \cApiClickableAction $action) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::applyItemAction() |
Parameters
$item
mixed
item cTreeItem-Object or an id of a TreeItem-Object
cTree()
cTree($name)
Inherited
inherited_from |
\cTree::cTree() |
inherited_from |
\cGuiTree::cTree() |
Parameters
$name
cTreeItem()
cTreeItem($id, $name, $collapsed)
Inherited
inherited_from |
\cTreeItem::cTreeItem() |
inherited_from |
\cTree::cTreeItem() |
inherited_from |
\cGuiTree::cTreeItem() |
Parameters
$id
$name
$collapsed
deletes an attribute
deleteAttribute(string $attributeName) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::deleteAttribute() |
inherited_from |
\cTree::deleteAttribute() |
inherited_from |
\cGuiTree::deleteAttribute() |
Parameters
$attributeName
string
attributeName
deletes a subitem
deleteItem(mixed $id) : \deleted
Inherited
access |
public |
inherited_from |
\cTreeItem::deleteItem() |
inherited_from |
\cTree::deleteItem() |
inherited_from |
\cGuiTree::deleteItem() |
Parameters
$id
mixed
item object or ID to delete
Returns
\deleted
object
Exports a tree as an array of arrays.
exportTree() : array
Inherited
Array format:
array(
array("id" => "Item ID", "name" => "Item name", "level" => 1,
"attributes" => array("attr_name" => "attr_value"))
);
access |
public |
inherited_from |
\cTreeItem::exportTree() |
inherited_from |
\cTree::exportTree() |
inherited_from |
\cGuiTree::exportTree() |
Returns
array
flatTraverse
traverses the tree starting from this item, and returning
all objects as $objects in a flat array.
flatTraverse(integer $level)
Inherited
inherited_from |
\cTreeItem::flatTraverse() |
inherited_from |
\cTree::flatTraverse() |
inherited_from |
\cGuiTree::flatTraverse() |
Parameters
$level
integer
Level to start on
Removes all actions for items with specific attributes
flushActionByItemAttribute(array $attributes) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::flushActionByItemAttribute() |
Parameters
$attributes
array
attributes Values which need to match. The array key is the attribute name. Multiple array
entries are connected with "AND".
flushes all actions
flushGlobalActions() : void
Inherited
access |
public |
inherited_from |
\cGuiTree::flushGlobalActions() |
flushes all actions for a specific item
flushItemActions(mixed $item) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::flushItemActions() |
Parameters
$item
mixed
item cTreeItem-Object or an id of a TreeItem-Object
returns an attribute
getAttribute(string $attributeName) : mixed
Inherited
access |
public |
inherited_from |
\cTreeItem::getAttribute() |
inherited_from |
\cTree::getAttribute() |
inherited_from |
\cGuiTree::getAttribute() |
Parameters
$attributeName
string
attributeName
Returns
mixed
Collapsed state getter
getCollapsed() : bool
Inherited
inherited_from |
\cTreeItem::getCollapsed() |
inherited_from |
\cTree::getCollapsed() |
inherited_from |
\cGuiTree::getCollapsed() |
Returns
bool
getCollapsedList
Returns all items (as ID array) which are collapsed.
getCollapsedList(array $list)
Inherited
inherited_from |
\cTreeItem::getCollapsedList() |
inherited_from |
\cTree::getCollapsedList() |
inherited_from |
\cGuiTree::getCollapsedList() |
Parameters
$list
array
Contains the list with all collapsed items
getExpandedList
Returns all items (as ID array) which are expanded.
getExpandedList(array $list)
Inherited
inherited_from |
\cTreeItem::getExpandedList() |
inherited_from |
\cTree::getExpandedList() |
inherited_from |
\cGuiTree::getExpandedList() |
Parameters
$list
array
Contains the list with all expanded items
Id getter
getId() : string
Inherited
inherited_from |
\cTreeItem::getId() |
inherited_from |
\cTree::getId() |
inherited_from |
\cGuiTree::getId() |
Returns
string
Retrieves a specific item by its ID.
getItemByID(string $id) : \cTreeItem
Inherited
Note that this
function traverses all subitems to find the correct item.
access |
public |
inherited_from |
\cTreeItem::getItemByID() |
inherited_from |
\cTree::getItemByID() |
inherited_from |
\cGuiTree::getItemByID() |
Parameters
$id
string
id ID to retrieve
Returns
Name getter
getName() : string
Inherited
inherited_from |
\cTreeItem::getName() |
inherited_from |
\cTree::getName() |
inherited_from |
\cGuiTree::getName() |
Returns
string
Tree icon getter
getTreeIcon() : string
Inherited
inherited_from |
\cTree::getTreeIcon() |
inherited_from |
\cGuiTree::getTreeIcon() |
Returns
string
hasAttribute()
hasAttribute($attributeName, $bRecursive)
Inherited
inherited_from |
\cTreeItem::hasAttribute() |
inherited_from |
\cTree::hasAttribute() |
inherited_from |
\cGuiTree::hasAttribute() |
Parameters
$attributeName
$bRecursive
importStructuredArray()
importStructuredArray($array)
Inherited
inherited_from |
\cTreeItem::importStructuredArray() |
inherited_from |
\cTree::importStructuredArray() |
inherited_from |
\cGuiTree::importStructuredArray() |
Parameters
$array
Imports a table from an array of arrays.
importTable(array $flat_array) : void
Inherited
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!
access |
public |
inherited_from |
\cTreeItem::importTable() |
inherited_from |
\cTree::importTable() |
inherited_from |
\cGuiTree::importTable() |
Parameters
$flat_array
array
flat_array See above
moves an item to another object
moveItem(\cTreeItem $targetItem, mixed $itemToMove) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::moveItem() |
inherited_from |
\cTree::moveItem() |
inherited_from |
\cGuiTree::moveItem() |
Parameters
$targetItem
\cTreeItem
targetItem Item to move the subitem to
$itemToMove
mixed
itemToMove cTreeItem-Object or id of object to move
processParameters()
processParameters()
Inherited
inherited_from |
\cGuiTree::processParameters() |
Removes an action from all items with a certain attribute set.
removeActionByItemAttribute(array $attributes, \cApiClickableAction $action) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::removeActionByItemAttribute() |
Parameters
$attributes
array
attributes Values which need to match. The array key is the attribute name. Multiple array
entries are connected with "AND".
removes the action from all treeitems.
removeGlobalAction(\cApiClickableAction $action) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::removeGlobalAction() |
Parameters
unsets an action from a specific item.
removeItemAction(mixed $item, \cApiClickableAction $action) : void
Inherited
Note that you can unset global actions
using this method!
access |
public |
inherited_from |
\cGuiTree::removeItemAction() |
Parameters
$item
mixed
item cTreeItem-Object or an id of a TreeItem-Object
render()
render($with_root) : string
Inherited
access |
public |
inherited_from |
\cGuiTree::render() |
Parameters
$with_root
Returns
string
sets a custom attribute for this TreeItem
setAttribute(string $attributeName, array $attributeValue) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setAttribute() |
inherited_from |
\cTree::setAttribute() |
inherited_from |
\cGuiTree::setAttribute() |
Parameters
$attributeName
string
attributeName
$attributeValue
array
attributeValue The value(s) of the attribute
sets a bunch of attributes
setAttributes(string $aAttributeArray) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setAttributes() |
inherited_from |
\cTree::setAttributes() |
inherited_from |
\cGuiTree::setAttributes() |
Parameters
$aAttributeArray
string
attributeName
setBackgroundColors()
setBackgroundColors($colors)
Inherited
inherited_from |
\cGuiTree::setBackgroundColors() |
Parameters
$colors
setBackgroundMode()
setBackgroundMode($mode)
Inherited
inherited_from |
\cGuiTree::setBackgroundMode() |
Parameters
$mode
setBaseLink()
setBaseLink($link)
Inherited
inherited_from |
\cGuiTree::setBaseLink() |
Parameters
$link
setCollapsed()
setCollapsed(mixed $id) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setCollapsed() |
inherited_from |
\cTree::setCollapsed() |
inherited_from |
\cGuiTree::setCollapsed() |
Parameters
$id
mixed
collapse ID to collapse or an array with items to collapse
setExpanded()
setExpanded(mixed $id) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setExpanded() |
inherited_from |
\cTree::setExpanded() |
inherited_from |
\cGuiTree::setExpanded() |
Parameters
$id
mixed
expand ID of item to expand or array of item ID's to expand
setGridlineMode()
setGridlineMode(int $mode) : void
Inherited
access |
public |
inherited_from |
\cGuiTree::setGridlineMode() |
Parameters
$mode
int
mode Sets the gridline mode to one of the following values:
cGuiTree::TREEVIEW_GRIDLINE_SOLID
cGuiTree::TREEVIEW_GRIDLINE_DASHED
cGuiTree::TREEVIEW_GRIDLINE_DOTTED
cGuiTree::TREEVIEW_GRIDLINE_NONE
setIcon()
setIcon($path)
Inherited
inherited_from |
\cTree::setIcon() |
inherited_from |
\cGuiTree::setIcon() |
Parameters
$path
setMouseoverMode()
setMouseoverMode($mode)
Inherited
inherited_from |
\cGuiTree::setMouseoverMode() |
Parameters
$mode
setName
sets the Name for this item.
setName(string $name) : \none
Inherited
inherited_from |
\cTreeItem::setName() |
inherited_from |
\cTree::setName() |
inherited_from |
\cGuiTree::setName() |
Parameters
$name
string
New name for this item
Returns
\none
sets a payload object for later reference
setPayloadObject(object $payload) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setPayloadObject() |
inherited_from |
\cTree::setPayloadObject() |
inherited_from |
\cGuiTree::setPayloadObject() |
Parameters
$payload
object
payload The object to payload
Tree icon setter
setTreeIcon(string $path)
Inherited
inherited_from |
\cTree::setTreeIcon() |
inherited_from |
\cGuiTree::setTreeIcon() |
Parameters
$path
string
sets a new name for the tree.
setTreeName(string $name) : void
Inherited
inherited_from |
\cTree::setTreeName() |
inherited_from |
\cGuiTree::setTreeName() |
Parameters
$name
string
name Name of the tree
traverse
traverses the tree starting from this item, and returning
all objects as $objects in a nested array.
traverse(object $objects, integer $level)
Inherited
inherited_from |
\cTreeItem::traverse() |
inherited_from |
\cTree::traverse() |
inherited_from |
\cGuiTree::traverse() |
Parameters
$objects
object
all found objects
$level
integer
Level to start on
unsets a payload object
unsetPayloadObject() : object
Inherited
access |
public |
inherited_from |
\cTreeItem::unsetPayloadObject() |
inherited_from |
\cTree::unsetPayloadObject() |
inherited_from |
\cGuiTree::unsetPayloadObject() |
Returns
object
_collapseBelowID()
_collapseBelowID(int $id, $found) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::_collapseBelowID() |
inherited_from |
\cTree::_collapseBelowID() |
inherited_from |
\cGuiTree::_collapseBelowID() |
Parameters
$id
int
leveloffset Level offset. Ignores all expand operations below
the offset.
$found
_collapseBelowLevel()
_collapseBelowLevel(int $leveloffset) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::_collapseBelowLevel() |
inherited_from |
\cTree::_collapseBelowLevel() |
inherited_from |
\cGuiTree::_collapseBelowLevel() |
Parameters
$leveloffset
int
leveloffset Level offset. Ignores all expand operations below
the offset.
_expandBelowID()
_expandBelowID(int $id, $found) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::_expandBelowID() |
inherited_from |
\cTree::_expandBelowID() |
inherited_from |
\cGuiTree::_expandBelowID() |
Parameters
$id
int
leveloffset Level offset. Ignores all expand operations below
the offset.
$found
_expandBelowLevel()
_expandBelowLevel(int $leveloffset) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::_expandBelowLevel() |
inherited_from |
\cTree::_expandBelowLevel() |
inherited_from |
\cGuiTree::_expandBelowLevel() |
Parameters
$leveloffset
int
leveloffset Level offset. Ignores all expand operations below
the offset.
_flattenArray()
_flattenArray($sourcearray, $destarray, $lastid, $level)
Inherited
inherited_from |
\cTreeItem::_flattenArray() |
inherited_from |
\cTree::_flattenArray() |
inherited_from |
\cGuiTree::_flattenArray() |
Parameters
$sourcearray
$destarray
$lastid
$level
Properties
$_attributes : array
Inherited
inherited_from |
\cTreeItem::$$_attributes |
inherited_from |
\cTree::$$_attributes |
inherited_from |
\cGuiTree::$$_attributes |
$_collapsed : boolean
Inherited
inherited_from |
\cTreeItem::$$_collapsed |
inherited_from |
\cTree::$$_collapsed |
inherited_from |
\cGuiTree::$$_collapsed |
$_id : string
Inherited
inherited_from |
\cTreeItem::$$_id |
inherited_from |
\cTree::$$_id |
inherited_from |
\cGuiTree::$$_id |
$_level : integer
Inherited
inherited_from |
\cTreeItem::$$_level |
inherited_from |
\cTree::$$_level |
inherited_from |
\cGuiTree::$$_level |
$_name : string
Inherited
inherited_from |
\cTreeItem::$$_name |
inherited_from |
\cTree::$$_name |
inherited_from |
\cGuiTree::$$_name |
$_next : array
Inherited
inherited_from |
\cTreeItem::$$_next |
inherited_from |
\cTree::$$_next |
inherited_from |
\cGuiTree::$$_next |
$_parent : array
Inherited
inherited_from |
\cTreeItem::$$_parent |
inherited_from |
\cTree::$$_parent |
inherited_from |
\cGuiTree::$$_parent |
$_previous : array
Inherited
inherited_from |
\cTreeItem::$$_previous |
inherited_from |
\cTree::$$_previous |
inherited_from |
\cGuiTree::$$_previous |
$_subitems : array
Inherited
inherited_from |
\cTreeItem::$$_subitems |
inherited_from |
\cTree::$$_subitems |
inherited_from |
\cGuiTree::$$_subitems |
$_treeIcon : string
Inherited
inherited_from |
\cTree::$$_treeIcon |
inherited_from |
\cGuiTree::$$_treeIcon |
$_baseLink
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_baseLink |
$_globalActions
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_globalActions |
$_setAttributeActions
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_setAttributeActions |
$_setItemActions
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_setItemActions |
$_unsetAttributeActions
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_unsetAttributeActions |
$_unsetItemActions
Inherited
access |
private |
inherited_from |
\cGuiTree::$$_unsetItemActions |
Constants
TREEVIEW_BACKGROUND_NONE
TREEVIEW_BACKGROUND_NONE
Inherited
inherited_from |
\cGuiTree::TREEVIEW_BACKGROUND_NONE |
TREEVIEW_BACKGROUND_SHADED
TREEVIEW_BACKGROUND_SHADED
Inherited
inherited_from |
\cGuiTree::TREEVIEW_BACKGROUND_SHADED |
TREEVIEW_GRIDLINE_DASHED
TREEVIEW_GRIDLINE_DASHED
Inherited
inherited_from |
\cGuiTree::TREEVIEW_GRIDLINE_DASHED |
TREEVIEW_GRIDLINE_DOTTED
TREEVIEW_GRIDLINE_DOTTED
Inherited
inherited_from |
\cGuiTree::TREEVIEW_GRIDLINE_DOTTED |
TREEVIEW_GRIDLINE_NONE
TREEVIEW_GRIDLINE_NONE
Inherited
inherited_from |
\cGuiTree::TREEVIEW_GRIDLINE_NONE |
TREEVIEW_GRIDLINE_SOLID
TREEVIEW_GRIDLINE_SOLID
Inherited
inherited_from |
\cGuiTree::TREEVIEW_GRIDLINE_SOLID |
TREEVIEW_MOUSEOVER_MARK
TREEVIEW_MOUSEOVER_MARK
Inherited
inherited_from |
\cGuiTree::TREEVIEW_MOUSEOVER_MARK |
TREEVIEW_MOUSEOVER_NONE
TREEVIEW_MOUSEOVER_NONE
Inherited
inherited_from |
\cGuiTree::TREEVIEW_MOUSEOVER_NONE |