PHP Class Horde_Tree_Renderer_Html, horde

Additional node parameters: - class: CSS class to use with this node - icon: Icon to display next node - iconalt: Alt text to use for the icon - iconopen: Icon to indicate this node as expanded - url: URL to link the node to - urlclass: CSS class for the node's URL - target: Target for the 'url' link - title: Link tooltip title Copyright 2003-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: Marko Djukic ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends Horde_Tree_Renderer_Base
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_altCount integer Current value of the alt tag count.
$_dropline array Drop line cache.
$_images array Images array.
$_node_pos array Node position list.

Public Methods

Method Description
__construct ( string $name, array $params = [] ) Constructor.
getTree ( boolean $static = false ) : string Returns the tree.
setHeader ( array $header ) Adds column headers to the tree table.

Protected Methods

Method Description
_addColumn ( $column )
_buildHeader ( ) : string Returns the HTML code for a header row, if necessary.
_buildLine ( string $node_id ) : string Function to create a single line of the tree.
_buildTree ( string $node_id ) : string Recursive function to walk through the tree array and build the output.
_generateImage ( string $src, string $class = '', string $alt = null ) : string Generate the icon image.
_generateUrlTag ( string $node_id ) : string Generate a link URL.
_setLabel ( string $node_id ) : string Sets the label on the tree line.
_setNodeIcon ( string $node_id ) : string Sets the icon for the node.
_setNodeToggle ( string $node_id ) : string Sets the node toggle on the tree line.

Method Details

__construct() public method

Constructor.
public __construct ( string $name, array $params = [] )
$name string The name of this tree instance.
$params array Additional parameters:
alternate - (boolean) Alternate shading in the table?
            DEFAULT: false
class - (string) The class to use for the table.
        DEFAULT: ''
hideHeaders - (boolean) Don't render any HTML for the header row, just
              use the widths.
              DEFAULT: false
lines - (boolean) Show tree lines?
        DEFAULT: true
lines_base - (boolean) Show tree lines for the base level? Requires
             'lines' to be true also.
             DEFAULT: false
multiline - (boolean) Do the node labels contain linebreaks?
            DEFAULT: false

_addColumn() protected method

protected _addColumn ( $column )

_buildHeader() protected method

Returns the HTML code for a header row, if necessary.
protected _buildHeader ( ) : string
return string The HTML code of the header row or an empty string.

_buildLine() protected method

Function to create a single line of the tree.
protected _buildLine ( string $node_id ) : string
$node_id string The Node ID.
return string The rendered line.

_buildTree() protected method

Recursive function to walk through the tree array and build the output.
protected _buildTree ( string $node_id ) : string
$node_id string The Node ID.
return string The tree rendering.

_generateImage() protected method

Generate the icon image.
protected _generateImage ( string $src, string $class = '', string $alt = null ) : string
$src string The source image.
$class string Additional class to add to image.
$alt string Alt text to add to the image.
return string A HTML tag to display the image.

_generateUrlTag() protected method

Generate a link URL.
protected _generateUrlTag ( string $node_id ) : string
$node_id string The node ID.
return string The link tag.

_setLabel() protected method

Sets the label on the tree line.
protected _setLabel ( string $node_id ) : string
$node_id string The Node ID.
return string The label for the tree line.

_setNodeIcon() protected method

Sets the icon for the node.
protected _setNodeIcon ( string $node_id ) : string
$node_id string The Node ID.
return string The node icon for the tree line.

_setNodeToggle() protected method

Sets the node toggle on the tree line.
protected _setNodeToggle ( string $node_id ) : string
$node_id string The Node ID.
return string The node toggle for the tree line.

getTree() public method

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.
return string The HTML code of the rendered tree.

setHeader() public method

Adds column headers to the tree table.
public setHeader ( array $header )
$header array An array containing hashes with header information. The following keys are allowed:
class - The CSS class of the header cell
html - The HTML content of the header cell

Property Details

$_altCount protected_oe property

Current value of the alt tag count.
protected int $_altCount
return integer

$_dropline protected_oe property

Drop line cache.
protected array $_dropline
return array

$_images protected_oe property

Images array.
protected array $_images
return array

$_node_pos protected_oe property

Node position list.
protected array $_node_pos
return array