<?php


/**
* Presentation class
*
* Base class for other presentation classes to
* inherit from.
*/
class presentation
{
    /**
    * The TreeMenu structure
    * @var object
    */
    var $menu;

    /**
    * Base constructor simply sets the menu object
    *
    * @param object $structure The menu structure
    */
    function presentation(&$structure)
    {
        $this->menu = &$structure;
    }

    /**
    * Prints the HTML generated by the toHTML() method.
    * toHTML() must therefore be defined by the derived
    * class.
    *
    * @access public
    * @param  array  Options to set. Any options taken by
    *                the presentation class can be specified
    *                here.
    */
    function printMenu($options = array())
    {
        foreach ($options as $option => $value) {
            $this->$option = $value;
        }

        echo $this->toHTML();
    }
    
    function getMenu($options = array())
    {    
        foreach ($options as $option => $value) 
        {
            $this->$option = $value;
        }

        return $this->toHTML();
    }

    function show()
    {
        return $this->getMenu();
    }

}

?>