\Horde_Core_Tree_Renderer_Javascript

The Horde_Core_Tree_Renderer_Javascript class provides javascript rendering of a tree.

Copyright 2003-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()
isSupported()
renderNodeDefinitions()
No public properties found
No constants found
_generateUrlTag()
_generateImage()
$_images
N/A
No private methods found
No private properties found
N/A

Properties

$_images

$_images : array

Images array.

Values correspond to 'horde-tree-image-#' CSS classes in horde/themes/screen.css.

Type

array

Methods

__construct()

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

Constructor.

Parameters

\Horde_Tree $tree

A tree object.

array $params

Additional parameters.

  • jsvar: The JS variable name to store the tree object in. DEFAULT: Instance name.

fallback()

fallback() : string

Provide a simpler renderer to fallback to.

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.

Returns

string —

The HTML code of the rendered tree.

isSupported()

isSupported() : boolean

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

We check for DOM support in the browser.

Returns

boolean —

Whether or not this backend will function.

renderNodeDefinitions()

renderNodeDefinitions() : object

Returns just the JS node definitions as a string.

Returns

object —

Object with the following properties: 'is_static', 'nodes', 'root_nodes'.

_generateUrlTag()

_generateUrlTag(string  $node_id) : string

Generate a link URL tag.

Parameters

string $node_id

The node ID.

Returns

string —

The link tag.

_generateImage()

_generateImage(string  $src, string  $class = '', string  $alt = null) : string

Generate the icon image.

Parameters

string $src

The source image.

string $class

Additional class to add to image.

string $alt

Alt text to add to the image.

Returns

string —

A HTML tag to display the image.