DB_NestedSet
[ class tree: DB_NestedSet ] [ index: DB_NestedSet ] [ all elements ]

Class: DB_NestedSet_Output

Source Location: /DB_NestedSet-1.4.1/NestedSet/Output.php

Class Overview


DB_NestedSet_Output is a unified API for other output drivers Status is beta


Author(s):

Version:

  • $Revision: 199223 $

Variables

Methods


Child classes:

DB_NestedSet_GraphViz
A helper class to translate the data from a nested set table into a GraphViz diagram using PEAR::Image_GraphViz developped by Sebastian Bergmann.
DB_NestedSet_CoolMenu
This class can be used to generate the data to build javascript popup menu from a DB_NestedSet node array.
DB_NestedSet_Menu
DB_NestedSet_Menu
DB_NestedSet_TigraMenu
This class can be used to generate the data to build javascript popup menu from a DB_NestedSet node array.
DB_NestedSet_TreeMenu
DB_NestedSet_TreeMenu

Inherited Variables

Inherited Methods


Class Details

[line 73]
DB_NestedSet_Output is a unified API for other output drivers Status is beta

At the moment PEAR::HTML_TreeMenu written by Jason Rust is supported A driver for treemenu.org will follow soon.

Usage example:

require_once('DB_NestedSet/NestedSet/Output.php'); $icon = 'folder.gif'; $expandedIcon = 'folder-expanded.gif'; // get data (important to fetch it as an array, using the true flag) $data = $NeSe->getAllNodes(true); // change the events for one of the elements $data[35]['events'] = array('onexpand' => 'alert("we expanded!");'); // add links to each item foreach ($data as $a_data) { $a_data['link'] = 'http://foo.com/foo.php?' . $a_data['id']; } $params = array( 'structure' => $data, 'options' => array( 'icon' => $icon, 'expandedIcon' => $expandedIcon, ), 'textField' => 'name', 'linkField' => 'link', ); $menu =& DB_NestedSet_Output::factory('TreeMenu', $params); $menu->printListbox();

  • Author: Daniel Khan <dk@webcluster.at>
  • Version: $Revision: 199223 $
  • Access: public


[ Top ]


Class Variables

$options = array()

[line 86]

  • Var: Array of options to be passed to the ouput methods
  • Access: public

Type:   array


[ Top ]



Method Detail

factory   [line 100]

object The &factory( array $params, [string $driver = 'TreeMenu'])

Returns a output driver object
  • Return: DB_NestedSet_Ouput object
  • Access: public

Parameters:

array   $params     A DB_NestedSet nodeset
string   $driver     (optional) The driver, such as TreeMenu (default)

[ Top ]

listbox_toHTML   [line 205]

string listbox_toHTML( )

Returns the HTML for the listbox. This method can be used instead of printListbox() to use the menu system with a template system.
  • Return: The HTML for the listbox
  • Author: Emanuel Zueger
  • Access: public

Overridden in child classes as:

DB_NestedSet_TreeMenu::listbox_toHTML()
Returns the HTML for the listbox. This method can be used instead of printListbox() to use the menu system with a template system.

[ Top ]

printListbox   [line 172]

void printListbox( )

Print's a listbox representing the current tree Overriden by the driver class
  • Access: public

Overridden in child classes as:

DB_NestedSet_TreeMenu::printListbox()
Print's a listbox representing the current tree

[ Top ]

printTree   [line 159]

void printTree( )

Print's the current tree using the output driver Overriden by the driver class
  • Access: public

Overridden in child classes as:

DB_NestedSet_GraphViz::printTree()
Outputs the graph as an image
DB_NestedSet_CoolMenu::printTree()
Print's the current tree using the output driver
DB_NestedSet_TigraMenu::printTree()
Print's the current tree using the output driver
DB_NestedSet_TreeMenu::printTree()
Print's the current tree using the output driver

[ Top ]

returnStructure   [line 216]

mixed returnStructure( )

  • Access: public

Overridden in child classes as:

DB_NestedSet_Menu::returnStructure()
DB_NestedSet_Menu::returnStructure()

[ Top ]

setOptions   [line 126]

bool setOptions( string $group, array $options)

Set's options for a specific output group (printTree, printListbox) This enables you to set specific options for each output method
  • Access: public

Parameters:

string   $group     Output group ATM 'printTree' or 'printListbox'
array   $options     Hash with options

[ Top ]

tree_toHTML   [line 189]

string tree_toHTML( )

Returns the HTML for the DHTML-menu. This method can be used instead of printMenu() to use the menu system with a template system.
  • Return: The HTML for the menu
  • Author: Emanuel Zueger
  • Access: public

Overridden in child classes as:

DB_NestedSet_TreeMenu::tree_toHTML()
Returns the HTML for the DHTML-menu. This method can be used instead of printMenu() to use the menu system with a template system.

[ Top ]


Documentation generated on Sun, 25 Apr 2010 21:30:10 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.