PHP Class Horde_Tree_Renderer_Base, horde

Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Slusarz ([email protected])
Author: Jan Schneider ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_colsLeft integer Keep count of how many extra columns there are on the left side of the node.
$_colsRight integer Keep count of how many extra columns there are on the right side of the node.
$_extra array An array containing extra columns for the tree nodes.
$_header array Hash with header information.
$_nodes array An array containing all the tree nodes.
$_options array Option values.
$_sortCriteria string Stores the sorting criteria temporarily.
$_static boolean Should the tree be rendered statically?
$_tree Horde_Tree The tree object.

Méthodes publiques

Méthode Description
__construct ( Horde_Tree $tree, array $params = [] ) Constructor.
addNode ( array $node ) Adds a node to the node tree array.
addNodeExtra ( mixed $id, integer $side, array $extra ) Adds extra columns to be displayed to the side of the node.
addNodeParams ( string $id, array $params = [] ) Adds additional parameters to a node.
fallback ( ) : string Provide a simpler renderer to fallback to.
getOption ( string $option ) : mixed Gets an option's value.
getTree ( boolean $static = false ) : string Returns the tree.
isSupported ( ) : boolean Check the current environment to see if we can render the tree.
renderTree ( boolean $static = false ) Renders the tree.
setHeader ( array $header ) Adds column headers to the tree table.
setOption ( $options, mixed $value = null ) Sets an option.
sort ( string $criteria ) Sorts the tree by the specified node property.

Méthodes protégées

Méthode Description
_buildTree ( $id ) : string Recursive function to walk through the tree array and build the output.

Method Details

__construct() public méthode

Constructor.
public __construct ( Horde_Tree $tree, array $params = [] )
$tree Horde_Tree A tree object.
$params array Additional parameters.

_buildTree() protected méthode

Should be overwritten by a sub-class if it doesn't implement its own getTree() method.
protected _buildTree ( $id ) : string
Résultat string The tree rendering.

addNode() public méthode

Adds a node to the node tree array.
public addNode ( array $node )
$node array A hash with node properties: - id: (string) The unique node id. - parent: (string) The parent's unique node id. - label: (string) The text label for the node. - expanded: (boolean) Is this level expanded or not. - params: (array) Any other parameters to set (see addNodeParams() of the renderers for full details).

addNodeExtra() public méthode

Adds extra columns to be displayed to the side of the node.
public addNodeExtra ( mixed $id, integer $side, array $extra )
$id mixed The unique node id.
$side integer Which side to place the extra columns on.
$extra array Extra columns to display.

addNodeParams() public méthode

Adds additional parameters to a node.
public addNodeParams ( string $id, array $params = [] )
$id string The unique node id.
$params array Parameters to set (key/value pairs).

fallback() public méthode

Provide a simpler renderer to fallback to.
public fallback ( ) : string
Résultat string The next best renderer.

getOption() public méthode

Gets an option's value.
public getOption ( string $option ) : mixed
$option string The name of the option to fetch.
Résultat mixed The option's value.

getTree() public méthode

Returns the tree.
public getTree ( boolean $static = false ) : string
$static boolean If true the tree nodes can't be expanded and collapsed and the tree gets rendered expanded. This option has no effect in this driver.
Résultat string The HTML code of the rendered tree.

isSupported() public méthode

Check the current environment to see if we can render the tree.
public isSupported ( ) : boolean
Résultat boolean Whether or not this backend will function.

renderTree() public méthode

Renders the tree.
public renderTree ( boolean $static = false )
$static boolean If true the tree nodes can't be expanded and collapsed and the tree gets rendered expanded.

setHeader() public méthode

Adds column headers to the tree table.
public setHeader ( array $header )
$header array An array containing hashes with header information.

setOption() public méthode

Sets an option.
public setOption ( $options, mixed $value = null )
$value mixed The option's value.

sort() public méthode

Sorts the tree by the specified node property.
public sort ( string $criteria )
$criteria string The node property to sort by.

Property Details

$_colsLeft protected_oe property

Keep count of how many extra columns there are on the left side of the node.
protected int $_colsLeft
Résultat integer

$_colsRight protected_oe property

Keep count of how many extra columns there are on the right side of the node.
protected int $_colsRight
Résultat integer

$_extra protected_oe property

An array containing extra columns for the tree nodes.
protected array $_extra
Résultat array

$_header protected_oe property

Hash with header information.
protected array $_header
Résultat array

$_nodes protected_oe property

An array containing all the tree nodes.
protected array $_nodes
Résultat array

$_options protected_oe property

Option values.
protected array $_options
Résultat array

$_sortCriteria protected_oe property

Stores the sorting criteria temporarily.
protected string $_sortCriteria
Résultat string

$_static protected_oe property

Should the tree be rendered statically?
protected bool $_static
Résultat boolean

$_tree protected_oe property

The tree object.
protected Horde_Tree $_tree
Résultat Horde_Tree