cvs: pear /DB_NestedSet/NestedSet Output.php TreeMenu.php

From: Date: Mon, 06 Oct 2003 20:02:45 +0000
Subject: cvs: pear /DB_NestedSet/NestedSet Output.php TreeMenu.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13442@lists.php.net to get a copy of this message
datenpunk Mon Oct 6 16:02:45 2003 EDT Modified files: /pear/DB_NestedSet/NestedSet Output.php TreeMenu.php Log: - Added toHTML() method to tree menu output driver. Thank's to Emanuel Zueger. Index: pear/DB_NestedSet/NestedSet/Output.php diff -u pear/DB_NestedSet/NestedSet/Output.php:1.9 pear/DB_NestedSet/NestedSet/Output.php:1.10 --- pear/DB_NestedSet/NestedSet/Output.php:1.9 Mon Sep 1 18:54:02 2003 +++ pear/DB_NestedSet/NestedSet/Output.php Mon Oct 6 16:02:44 2003 @@ -16,7 +16,7 @@ // | Authors: Daniel Khan <dk@webcluster.at> | // | Jason Rust <jason@rustyparts.com> | // +----------------------------------------------------------------------+ -// $Id: Output.php,v 1.9 2003/09/01 22:54:02 datenpunk Exp $ +// $Id: Output.php,v 1.10 2003/10/06 20:02:44 datenpunk Exp $ // require_once 'PEAR.php'; @@ -64,7 +64,7 @@ * * @author Daniel Khan <dk@webcluster.at> * @package DB_NestedSet -* @version $Revision: 1.9 $ +* @version $Revision: 1.10 $ * @access public * */ @@ -174,5 +174,38 @@ } // }}} + + // {{{ 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. + * + * @access public + * @return string The HTML for the menu + * @author Emanuel Zueger + */ + function tree_toHTML() { + PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR); + } + + // }}} + // {{{ 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. + * + * @access public + * @return string The HTML for the listbox + * @author Emanuel Zueger + */ + function listbox_toHTML() { + PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR); + } + + // }}} } ?> Index: pear/DB_NestedSet/NestedSet/TreeMenu.php diff -u pear/DB_NestedSet/NestedSet/TreeMenu.php:1.11 pear/DB_NestedSet/NestedSet/TreeMenu.php:1.12 --- pear/DB_NestedSet/NestedSet/TreeMenu.php:1.11 Mon Sep 1 18:54:02 2003 +++ pear/DB_NestedSet/NestedSet/TreeMenu.php Mon Oct 6 16:02:44 2003 @@ -16,7 +16,7 @@ // | Authors: Jason Rust <jrust@rustyparts.com> | // +----------------------------------------------------------------------+ // -// $Id: TreeMenu.php,v 1.11 2003/09/01 22:54:02 datenpunk Exp $ +// $Id: TreeMenu.php,v 1.12 2003/10/06 20:02:44 datenpunk Exp $ // require_once 'HTML/TreeMenu.php'; @@ -30,7 +30,7 @@ * @see docs/TreeMenu_example.php * @author Jason Rust <jrust@rustyparts.com> * @package DB_NestedSet -* @version $Revision: 1.11 $ +* @version $Revision: 1.12 $ * @access public */ // }}} @@ -161,6 +161,43 @@ $options = $this->_getOptions('printListbox'); $listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options); $listBox->printMenu(); + } + // }}} + + // }}} + // {{{ 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. + * + * @access public + * @return string The HTML for the menu + * @Author Emanuel Zueger + */ + function tree_toHTML() { + $options = $this->_getOptions('toHTML'); + $tree =& new HTML_TreeMenu_DHTML($this->_structTreeMenu, $options); + return $tree->toHTML(); + } + + // }}} + // {{{ 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. + * + * @access public + * @return string The HTML for the listbox + * @author Emanuel Zueger + */ + function listbox_toHTML() { + $options = $this->_getOptions('toHTML'); + $listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options); + return $listBox->toHTML(); } // }}}

« previous php.pear.cvs (#13442) next »