public function __construct($menu) { //******************************************* // Nav Type / Format //******************************************* if (isset($_SESSION['nav_xml_format'])) { $valid_formats = array('numeric' => 'numeric', 'rewrite' => 'rewrite', 'long_url' => 'long_url'); $this->nav_type = isset($valid_formats[$_SESSION['nav_xml_format']]) ? $valid_formats[$_SESSION['nav_xml_format']] : 'numeric'; } else { $this->nav_type = 'numeric'; } // Build the XML version of the Nav $tmp = new gen_element('nav'); $tmp->display_tree(); $tmp->set_tabs(1); $tmp->add_child(new gen_element('nav_xml_format', $this->nav_type)); $this->build_xml_nav($tmp, $menu, '/', 0, 0, '-1'); $this->xml = $tmp->render(true); }