Documentation

Horde_Core_Tree_Renderer_Javascript extends Horde_Core_Tree_Renderer_Html
in package

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.

Tags
author

Marko Djukic marko@oblo.com

author

Michael Slusarz slusarz@horde.org

author

Jan Schneider jan@horde.org

category

Horde

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

Properties

$_images  : array<string|int, mixed>
Images array.

Methods

__construct()  : mixed
Constructor.
fallback()  : string
Provide a simpler renderer to fallback to.
getTree()  : string
Returns the tree.
isSupported()  : bool
Check the current environment to see if we can render the HTML tree.
renderNodeDefinitions()  : object
Returns just the JS node definitions as a string.
_generateImage()  : string
Generate the icon image.
_generateUrlTag()  : string
Generate a link URL tag.

Properties

$_images

Images array.

protected array<string|int, mixed> $_images = array('line' => 1, 'blank' => '', 'join' => 2, 'join_bottom' => 4, 'join_top' => 3, 'plus' => 10, 'plus_bottom' => 11, 'plus_only' => 12, 'minus' => 6, 'minus_bottom' => 7, 'minus_only' => 8, 'null_only' => 13, 'folder' => 14, 'folderopen' => 15, 'leaf' => 16)

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

Methods

__construct()

Constructor.

public __construct(Horde_Tree $tree[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
$tree : Horde_Tree

A tree object.

$params : array<string|int, mixed> = array()

Additional parameters.

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

fallback()

Provide a simpler renderer to fallback to.

public fallback() : string
Return values
string

The next best renderer.

getTree()

Returns the tree.

public getTree([bool $static = false ]) : string
Parameters
$static : bool = false

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

Return values
string

The HTML code of the rendered tree.

isSupported()

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

public isSupported() : bool

We check for DOM support in the browser.

Return values
bool

Whether or not this backend will function.

renderNodeDefinitions()

Returns just the JS node definitions as a string.

public renderNodeDefinitions() : object
Return values
object

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

_generateImage()

Generate the icon image.

protected _generateImage(string $src[, string $class = '' ][, string $alt = null ]) : string
Parameters
$src : string

The source image.

$class : string = ''

Additional class to add to image.

$alt : string = null

Alt text to add to the image.

Return values
string

A HTML tag to display the image.

_generateUrlTag()

Generate a link URL tag.

protected _generateUrlTag(string $node_id) : string
Parameters
$node_id : string

The node ID.

Return values
string

The link tag.


        
On this page

Search results