PHP Класс 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.
Автор: Michael Slusarz ([email protected])
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_buildTree ( $id ) : string Recursive function to walk through the tree array and build the output.

Описание методов

__construct() публичный Метод

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

_buildTree() защищенный Метод

Should be overwritten by a sub-class if it doesn't implement its own getTree() method.
protected _buildTree ( $id ) : string
Результат string The tree rendering.

addNode() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

Provide a simpler renderer to fallback to.
public fallback ( ) : string
Результат string The next best renderer.

getOption() публичный Метод

Gets an option's value.
public getOption ( string $option ) : mixed
$option string The name of the option to fetch.
Результат mixed The option's value.

getTree() публичный Метод

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.
Результат string The HTML code of the rendered tree.

isSupported() публичный Метод

Check the current environment to see if we can render the tree.
public isSupported ( ) : boolean
Результат boolean Whether or not this backend will function.

renderTree() публичный Метод

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() публичный Метод

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

setOption() публичный Метод

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

sort() публичный Метод

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

Описание свойств

$_colsLeft защищенное свойство

Keep count of how many extra columns there are on the left side of the node.
protected int $_colsLeft
Результат integer

$_colsRight защищенное свойство

Keep count of how many extra columns there are on the right side of the node.
protected int $_colsRight
Результат integer

$_extra защищенное свойство

An array containing extra columns for the tree nodes.
protected array $_extra
Результат array

$_header защищенное свойство

Hash with header information.
protected array $_header
Результат array

$_nodes защищенное свойство

An array containing all the tree nodes.
protected array $_nodes
Результат array

$_options защищенное свойство

Option values.
protected array $_options
Результат array

$_sortCriteria защищенное свойство

Stores the sorting criteria temporarily.
protected string $_sortCriteria
Результат string

$_static защищенное свойство

Should the tree be rendered statically?
protected bool $_static
Результат boolean

$_tree защищенное свойство

The tree object.
protected Horde_Tree $_tree
Результат Horde_Tree