Overview

Packages

  • Tree

Classes

  • Horde_Tree
  • Horde_Tree_Base
  • Horde_Tree_Exception
  • Horde_Tree_Html
  • Horde_Tree_Jquerymobile
  • Horde_Tree_Select
  • Horde_Tree_Simplehtml
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Tree_Base

The Horde_Tree_Base:: class provides the abstract interface that all drivers must derive from.

Copyright 2010-2012 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.

Horde_Tree_Base implements Countable

Direct known subclasses

Horde_Tree_Html, Horde_Tree_Jquerymobile, Horde_Tree_Select, Horde_Tree_Simplehtml
Abstract
Package: Tree
Category: Horde
License: LGPL 2.1
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Tree/Base.php
Methods summary
public
# __construct( string $name, array $params = array() )

Constructor.

Constructor.

Parameters

$name
The name of this tree instance.
$params
Additional parameters. <pre>session - (<span class="php-keyword1">array</span>) Callbacks used to store session data. Must <span class="php-keyword2">define</span> two keys: <span class="php-quote">'get'</span> <span class="php-keyword1">and</span> <span class="php-quote">'set'</span>. <span class="php-keyword1">Function</span> definitions: (string) = get([string - Instance], [string - ID]); set([string - Instance], [string - ID], [boolean - value]); <span class="php-keyword1">DEFAULT</span>: No session storage</pre>
public string
# fallback( )

Provide a simpler renderer to fallback to.

Provide a simpler renderer to fallback to.

Returns

string
The next best renderer.

Throws

Horde_Tree_Exception
abstract public string
# getTree( boolean $static = false )

Returns the tree.

Returns the tree.

Parameters

$static
<p>If true the tree nodes can't be expanded and collapsed and the tree gets rendered expanded.</p>

Returns

string
The HTML code of the rendered tree.
public
# renderTree( boolean $static = false )

Renders the tree.

Renders the tree.

Parameters

$static
<p>If true the tree nodes can't be expanded and collapsed and the tree gets rendered expanded.</p>
public
# setOption( mixed $options, mixed $value = null )

Sets an option.

Sets an option.

Parameters

$options
<p>$option The option name -or- an array of option name/value pairs. See constructor for available options.</p>
$value
The option's value.
public mixed
# getOption( string $option )

Gets an option's value.

Gets an option's value.

Parameters

$option
The name of the option to fetch.

Returns

mixed
The option's value.
public
# addNode( string $id, string $parent, string $label, string $indent = null, boolean $expanded = true, array $params = array(), array $extra_right = array(), array $extra_left = array() )

Adds a node to the node tree array.

Adds a node to the node tree array.

Parameters

$id
The unique node id.
$parent
The parent's unique node id.
$label
The text label for the node.
$indent
<p>Deprecated, this is calculated automatically based on the parent node.</p>
$expanded
Is this level expanded or not.
$params
<p>Any other parameters to set (@see self::addNodeParams() for full details).</p>
$extra_right
<p>Any other columns to display to the right of the tree.</p>
$extra_left
<p>Any other columns to display to the left of the tree.</p>
public
# addNodeParams( string $id, array $params = array() )

Adds additional parameters to a node.

Adds additional parameters to a node.

Parameters

$id
The unique node id.
$params
Parameters to set (key/value pairs).
public
# addNodeExtra( mixed $id, integer $side, array $extra )

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

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

Parameters

$id
The unique node id.
$side
Which side to place the extra columns on.
$extra
Extra columns to display.
public
# sort( string $criteria, integer $id = -1 )

Sorts the tree by the specified node property.

Sorts the tree by the specified node property.

Parameters

$criteria
The node property to sort by.
$id
Used internally for recursion.
public
# sortHelper( mixed $a, mixed $b )

Helper method for sort() to compare two tree elements.

Helper method for sort() to compare two tree elements.

public boolean
# isExpanded( mixed $id )

Returns whether the specified node is currently expanded.

Returns whether the specified node is currently expanded.

Parameters

$id
The unique node id.

Returns

boolean
True if the specified node is expanded.
public
# setHeader( array $header )

Adds column headers to the tree table.

Adds column headers to the tree table.

Parameters

$header
<p>An array containing hashes with header information.</p>
public boolean
# isSupported( )

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

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

Returns

boolean
Whether or not this backend will function.
public
# count( )

Implementation of

Countable::count()
API documentation generated by ApiGen