class cGuiTree
cGuiTree is a visual representation of a cTree.
It supports folding,
optional gridline marks and item icons.
Methods
__construct()
__construct($uuid, $treename)
Parameters
$uuid
$treename
_buildImagePath()
_buildImagePath($image)
_getExpandCollapseIcon()
_getExpandCollapseIcon($object)
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() |
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() |
Parameters
$id
stringid ID to add the item to
Applies an action to all items with a certain attribute set.
applyActionByItemAttribute(array $attributes, \cApiClickableAction $action) : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$attributes
arrayattributes 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
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
sets an action to a specific item.
applyItemAction(mixed $item, \cApiClickableAction $action) : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$item
mixeditem cTreeItem-Object or an id of a TreeItem-Object
cTree()
cTree($name)
Inherited
| inherited_from |
\cTree::cTree() |
Parameters
$name
cTreeItem()
cTreeItem($id, $name, $collapsed)
Inherited
| inherited_from |
\cTreeItem::cTreeItem() |
| inherited_from |
\cTree::cTreeItem() |
Parameters
$id
$name
$collapsed
deletes an attribute
deleteAttribute(string $attributeName) : void
Inherited
| access |
public |
| inherited_from |
\cTreeItem::deleteAttribute() |
| inherited_from |
\cTree::deleteAttribute() |
Parameters
$attributeName
stringattributeName
deletes a subitem
deleteItem(mixed $id) : \deleted
Inherited
| access |
public |
| inherited_from |
\cTreeItem::deleteItem() |
| inherited_from |
\cTree::deleteItem() |
Parameters
$id
mixeditem object or ID to delete
Returns
\deletedobject
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() |
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() |
Parameters
$level
integerLevel to start on
Removes all actions for items with specific attributes
flushActionByItemAttribute(array $attributes) : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$attributes
arrayattributes Values which need to match. The array key is the attribute name. Multiple array
entries are connected with "AND".
flushes all actions
flushGlobalActions() : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
flushes all actions for a specific item
flushItemActions(mixed $item) : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$item
mixeditem 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() |
Parameters
$attributeName
stringattributeName
Returns
mixed
Collapsed state getter
getCollapsed() : bool
Inherited
| inherited_from |
\cTreeItem::getCollapsed() |
| inherited_from |
\cTree::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() |
Parameters
$list
arrayContains 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() |
Parameters
$list
arrayContains the list with all expanded items
Id getter
getId() : string
Inherited
| inherited_from |
\cTreeItem::getId() |
| inherited_from |
\cTree::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() |
Parameters
$id
stringid ID to retrieve
Returns
Name getter
getName() : string
Inherited
| inherited_from |
\cTreeItem::getName() |
| inherited_from |
\cTree::getName() |
Returns
string
Tree icon getter
getTreeIcon() : string
Inherited
| inherited_from |
\cTree::getTreeIcon() |
Returns
string
hasAttribute()
hasAttribute($attributeName, $bRecursive)
Inherited
| inherited_from |
\cTreeItem::hasAttribute() |
| inherited_from |
\cTree::hasAttribute() |
Parameters
$attributeName
$bRecursive
importStructuredArray()
importStructuredArray($array)
Inherited
| inherited_from |
\cTreeItem::importStructuredArray() |
| inherited_from |
\cTree::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() |
Parameters
$flat_array
arrayflat_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() |
Parameters
$targetItem
\cTreeItemtargetItem Item to move the subitem to
$itemToMove
mixeditemToMove cTreeItem-Object or id of object to move
processParameters()
processParameters()
Removes an action from all items with a certain attribute set.
removeActionByItemAttribute(array $attributes, \cApiClickableAction $action) : void
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$attributes
arrayattributes 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
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
unsets an action from a specific item.
removeItemAction(mixed $item, \cApiClickableAction $action) : void
Note that you can unset global actions
using this method!
| deprecated |
[2012-07-12] Thisfunction doesn't do anything |
| access |
public |
Parameters
$item
mixeditem cTreeItem-Object or an id of a TreeItem-Object
render()
render($with_root) : string
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() |
Parameters
$attributeName
stringattributeName
$attributeValue
arrayattributeValue 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() |
Parameters
$aAttributeArray
stringattributeName
setBackgroundColors()
setBackgroundColors($colors)
setBackgroundMode()
setBackgroundMode($mode)
setBaseLink()
setBaseLink($link)
setCollapsed()
setCollapsed(mixed $id) : void
Inherited
| access |
public |
| inherited_from |
\cTreeItem::setCollapsed() |
| inherited_from |
\cTree::setCollapsed() |
Parameters
$id
mixedcollapse 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() |
Parameters
$id
mixedexpand ID of item to expand or array of item ID's to expand
setGridlineMode()
setGridlineMode(int $mode) : void
Parameters
$mode
intmode 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() |
Parameters
$path
setMouseoverMode()
setMouseoverMode($mode)
setName
sets the Name for this item.
setName(string $name) : \none
Inherited
| inherited_from |
\cTreeItem::setName() |
| inherited_from |
\cTree::setName() |
Parameters
$name
stringNew 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() |
Parameters
$payload
objectpayload The object to payload
Tree icon setter
setTreeIcon(string $path)
Inherited
| inherited_from |
\cTree::setTreeIcon() |
Parameters
$path
string
sets a new name for the tree.
setTreeName(string $name) : void
Inherited
| inherited_from |
\cTree::setTreeName() |
Parameters
$name
stringname 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() |
Parameters
$objects
objectall found objects
$level
integerLevel to start on
unsets a payload object
unsetPayloadObject() : object
Inherited
| access |
public |
| inherited_from |
\cTreeItem::unsetPayloadObject() |
| inherited_from |
\cTree::unsetPayloadObject() |
Returns
object
_collapseBelowID()
_collapseBelowID(int $id, $found) : void
Inherited
| access |
public |
| inherited_from |
\cTreeItem::_collapseBelowID() |
| inherited_from |
\cTree::_collapseBelowID() |
Parameters
$id
intleveloffset 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() |
Parameters
$leveloffset
intleveloffset 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() |
Parameters
$id
intleveloffset 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() |
Parameters
$leveloffset
intleveloffset Level offset. Ignores all expand operations below
the offset.
_flattenArray()
_flattenArray($sourcearray, $destarray, $lastid, $level)
Inherited
| inherited_from |
\cTreeItem::_flattenArray() |
| inherited_from |
\cTree::_flattenArray() |
Parameters
$sourcearray
$destarray
$lastid
$level
Properties
$_attributes : array
Inherited
| inherited_from |
\cTreeItem::$$_attributes |
| inherited_from |
\cTree::$$_attributes |
$_collapsed : boolean
Inherited
| inherited_from |
\cTreeItem::$$_collapsed |
| inherited_from |
\cTree::$$_collapsed |
$_id : string
Inherited
| inherited_from |
\cTreeItem::$$_id |
| inherited_from |
\cTree::$$_id |
$_level : integer
Inherited
| inherited_from |
\cTreeItem::$$_level |
| inherited_from |
\cTree::$$_level |
$_name : string
Inherited
| inherited_from |
\cTreeItem::$$_name |
| inherited_from |
\cTree::$$_name |
$_next : array
Inherited
| inherited_from |
\cTreeItem::$$_next |
| inherited_from |
\cTree::$$_next |
$_parent : array
Inherited
| inherited_from |
\cTreeItem::$$_parent |
| inherited_from |
\cTree::$$_parent |
$_previous : array
Inherited
| inherited_from |
\cTreeItem::$$_previous |
| inherited_from |
\cTree::$$_previous |
$_subitems : array
Inherited
| inherited_from |
\cTreeItem::$$_subitems |
| inherited_from |
\cTree::$$_subitems |
$_treeIcon : string
Inherited
| inherited_from |
\cTree::$$_treeIcon |
Constants
TREEVIEW_BACKGROUND_NONE
TREEVIEW_BACKGROUND_NONE
TREEVIEW_BACKGROUND_SHADED
TREEVIEW_BACKGROUND_SHADED
TREEVIEW_GRIDLINE_DASHED
TREEVIEW_GRIDLINE_DASHED
TREEVIEW_GRIDLINE_DOTTED
TREEVIEW_GRIDLINE_DOTTED
TREEVIEW_GRIDLINE_NONE
TREEVIEW_GRIDLINE_NONE
TREEVIEW_GRIDLINE_SOLID
TREEVIEW_GRIDLINE_SOLID
TREEVIEW_MOUSEOVER_MARK
TREEVIEW_MOUSEOVER_MARK
TREEVIEW_MOUSEOVER_NONE
TREEVIEW_MOUSEOVER_NONE