user_session = new Zend_Session_Namespace("user_session");
if (!isset($this->user_session->auth)) {
$this->menu_type = 'guest';
}
$this->generate_menu();
}
private function generate_menu()
{
$rows = $this->_db->fetchAll('select * from ' . self::TABLE . ' where
access="'.$this->menu_type.'" and type="root"');
$this->menu = '
';
}
private function get_children($parent)
{
$rows = $this->_db->fetchAll('select * from ' . self::TABLE . ' where
access="'.$this->menu_type.'" and parent="'. $parent . '"');
if (!empty($rows)) {
foreach ($rows as $cval) {
if ($cval["type"] == "branch") {
$this->menu_sub .= ''.
$cval["name"].' »';
$this->get_children($cval["id"]);
$this->menu_sub .= "
";
} else {
$this->menu_sub .= ''.
$cval["name"].'';
}
}
}
}
}