<?php
$menu = "";
$nameControllerArticle = 'article';
$nameControllerUser = 'user';
$menu = '
<ul id="nav" class="dropdown dropdown-horizontal">
    		<li>
        		<a href="/eclipse/creator/public/index.php/">Home</a>
        	</li>
        	<!---->
            <li class="dir">
                <a href="/eclipse/creator/public/index.php/user">User</a>
                <ul>
                	<li>
                        <a href="/eclipse/creator/public/index.php/user/login">Login</a>
                    </li>
                    <li>
                        <a href="/eclipse/creator/public/index.php/user/logout">Logout</a>
                    </li>';
		if (Zend_Auth::getInstance()->hasIdentity()){
			$acl = MyWeb_Acl::getInstance();
			if ($acl->isAllowed(Zend_Auth::getInstance()->getIdentity()->role_role,$nameControllerUser,'New')){
				$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/user/list">List</a>
                    </li>';
			}
		}
		if (Zend_Auth::getInstance()->hasIdentity()){
			$acl = MyWeb_Acl::getInstance();
			if ($acl->isAllowed(Zend_Auth::getInstance()->getIdentity()->role_role,$nameControllerUser,'New')){
				$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/user/edit">Edit</a>
                    </li>';
			}
		}
		$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/user/new">New</a>
                    </li>';
        if (Zend_Auth::getInstance()->hasIdentity()){
			$acl = MyWeb_Acl::getInstance();
			if ($acl->isAllowed(Zend_Auth::getInstance()->getIdentity()->role_role,$nameControllerUser,'New')){
				$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/user/search">Search</a>
                    </li>';
			}
        }
        $menu .= '
                 </ul>
            </li>';
        
        $menu .= '
            <li class="dir" >
                <a href="/eclipse/creator/public/index.php/Article">Article</a>
                <ul>';
        
		if (Zend_Auth::getInstance()->hasIdentity()){
			$acl = MyWeb_Acl::getInstance();
			if ($acl->isAllowed(Zend_Auth::getInstance()->getIdentity()->role_role,$nameControllerArticle,'New')){
				$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/Article/new">New</a>
                    </li>';
			}
		}
		if (Zend_Auth::getInstance()->hasIdentity()){
			$acl = MyWeb_Acl::getInstance();
			if ($acl->isAllowed(Zend_Auth::getInstance()->getIdentity()->role_role,$nameControllerArticle,'New')){
				$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/Article/edit">Edit</a>
                    </li>';
			}
		}
		$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/Article/list">List</a>
                    </li>';
		$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/Article/search">Search</a>
                    </li>';
		$menu .= '
                    <li>
                        <a href="/eclipse/creator/public/index.php/Article/show">Show</a>
                    </li>';
                    
		$menu .= '
                </ul>
            </li>
</ul></div>';

echo $menu;