\Horde_Tree_Renderer_Jquerymobile

The Horde_Tree_Renderer_Jquerymobile class provides rendering of a tree as a jQuery Mobile list view.

Copyright 2010-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
fallback()
getTree()
renderTree()
setOption()
getOption()
addNode()
addNodeParams()
addNodeExtra()
setHeader()
sort()
isSupported()
No public properties found
No constants found
_buildTree()
_getIcon()
$_tree
$_header
$_nodes
$_extra
$_colsLeft
$_colsRight
$_options
$_sortCriteria
$_static
N/A
No private methods found
No private properties found
N/A

Properties

$_tree

$_tree : \Horde_Tree

The tree object.

Type

\Horde_Tree

$_header

$_header : array

Hash with header information.

Type

array

$_nodes

$_nodes : array

An array containing all the tree nodes.

Type

array

$_extra

$_extra : array

An array containing extra columns for the tree nodes.

Type

array

$_colsLeft

$_colsLeft : integer

Keep count of how many extra columns there are on the left side of the node.

Type

integer

$_colsRight

$_colsRight : integer

Keep count of how many extra columns there are on the right side of the node.

Type

integer

$_options

$_options : array

Option values.

Type

array

$_sortCriteria

$_sortCriteria : string

Stores the sorting criteria temporarily.

Type

string

$_static

$_static : boolean

Should the tree be rendered statically?

Type

boolean

Methods

__construct()

__construct(\Horde_Tree  $tree, array  $params = array()) 

Constructor.

Parameters

\Horde_Tree $tree

A tree object.

array $params

Additional parameters.

fallback()

fallback() : string

Provide a simpler renderer to fallback to.

Throws

\Horde_Tree_Exception

Returns

string —

The next best renderer.

getTree()

getTree(boolean  $static = false) : string

Returns the tree.

Parameters

boolean $static

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.

Returns

string —

The HTML code of the rendered tree.

renderTree()

renderTree(boolean  $static = false) 

Renders the tree.

Parameters

boolean $static

If true the tree nodes can't be expanded and collapsed and the tree gets rendered expanded.

setOption()

setOption(  $options, mixed  $value = null) 

Sets an option.

Parameters

$options
mixed $value

The option's value.

getOption()

getOption(string  $option) : mixed

Gets an option's value.

Parameters

string $option

The name of the option to fetch.

Returns

mixed —

The option's value.

addNode()

addNode(array  $node) 

Adds a node to the node tree array.

Parameters

array $node

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).

addNodeParams()

addNodeParams(string  $id, array  $params = array()) 

Adds additional parameters to a node.

Parameters

string $id

The unique node id.

array $params

Parameters to set (key/value pairs).

addNodeExtra()

addNodeExtra(mixed  $id, integer  $side, array  $extra) 

Adds extra columns to be displayed to the side of the node.

Parameters

mixed $id

The unique node id.

integer $side

Which side to place the extra columns on.

array $extra

Extra columns to display.

setHeader()

setHeader(array  $header) 

Adds column headers to the tree table.

Parameters

array $header

An array containing hashes with header information.

sort()

sort(string  $criteria) 

Sorts the tree by the specified node property.

Parameters

string $criteria

The node property to sort by.

isSupported()

isSupported() : boolean

Check the current environment to see if we can render the tree.

Returns

boolean —

Whether or not this backend will function.

_buildTree()

_buildTree(string  $node_id,   $special) : string

Recursive function to walk through the tree array and build the output.

Should be overwritten by a sub-class if it doesn't implement its own getTree() method.

Parameters

string $node_id

The Node ID.

$special

Returns

string —

The tree rendering.

_getIcon()

_getIcon(string  $node_id) : string

Sets the icon for the node.

Parameters

string $node_id

The Node ID.

Returns

string —

The node icon for the tree line.