Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Navigation & recursive Zend Acl
    primarykey
    data
    text
    <p>I would like to make navigation with Zend_Navigation based on Zend_Acl below is a piece of my navigation.xml file located in /application/configs dir</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;config&gt; &lt;nav&gt; &lt;menu1&gt; &lt;label&gt;solidData&lt;/label&gt; &lt;uri&gt;#&lt;/uri&gt; &lt;pages&gt; &lt;service&gt; &lt;label&gt;menuLabel1&lt;/label&gt; &lt;controller&gt;service&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;service&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/service&gt; &lt;attendance&gt; &lt;label&gt;menuLabel2&lt;/label&gt; &lt;controller&gt;attendance&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;attendance&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/attendance&gt; &lt;/pages&gt; &lt;/menu1&gt; &lt;menu2&gt; &lt;label&gt;systemData&lt;/label&gt; &lt;uri&gt;#&lt;/uri&gt; &lt;pages&gt; &lt;users&gt; &lt;label&gt;users&lt;/label&gt; &lt;controller&gt;users&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;users&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/users&gt; &lt;profile&gt; &lt;label&gt;profiles&lt;/label&gt; &lt;controller&gt;profile&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;profile&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/profile&gt; &lt;dictionary&gt; &lt;label&gt;dictionary&lt;/label&gt; &lt;controller&gt;dictionary&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;dictionary&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/dictionary&gt; &lt;language&gt; &lt;label&gt;languages&lt;/label&gt; &lt;controller&gt;language&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;language&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/language&gt; &lt;/pages&gt; &lt;/menu2&gt; &lt;/nav&gt; &lt;/config&gt; </code></pre> <p>I dont want to show section which all pages are deny in ACL.</p> <p>For example if there is user which has TYPE_DENY in ACL for all pages resource and privilege of <code>&lt;menu1&gt;</code> I dont want to create and display label "solidData"</p> <p>The main problem is structure of my menu, because as you see I have various resources in one menu section.</p> <p>I've try with my own Navigation class extending Zend_Navigation with function <b>isVisible()</b>" and "<b>isActive()</b>" but I cant find solution.</p> <p>I'll be grateful for any help</p> <p>[edit] Look at this fragment structure of my menu:</p> <pre><code>&lt;menu2&gt; &lt;label&gt;systemData&lt;/label&gt; &lt;uri&gt;#&lt;/uri&gt; &lt;pages&gt; &lt;users&gt; &lt;label&gt;users&lt;/label&gt; &lt;controller&gt;users&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;users&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/users&gt; &lt;profile&gt; &lt;label&gt;profiles&lt;/label&gt; &lt;controller&gt;profile&lt;/controller&gt; &lt;action&gt;index&lt;/action&gt; &lt;resource&gt;profile&lt;/resource&gt; &lt;privilege&gt;index&lt;/privilege&gt; &lt;/profile&gt; &lt;/pages&gt; &lt;/menu2&gt; </code></pre> <p>I cant <code>&lt;resource&gt;</code> to <code>&lt;menu2&gt;</code> because <code>&lt;menu2&gt;</code> include pages with different resources f.e. 'users' and 'profile'. maybe there is some possibility to add many resources to one menu. I try something like that:</p> <pre><code>&lt;menu2&gt; &lt;label&gt;systemData&lt;/label&gt; &lt;uri&gt;#&lt;/uri&gt; &lt;resource&gt;users&lt;/resource&gt; &lt;resource&gt;profile&lt;/resource&gt; &lt;pages&gt; ... &lt;/pages&gt; &lt;/menu2&gt; </code></pre> <p>but i get </p> <pre><code>Invalid argument: $resource must be null, a string, or an instance of Zend_Acl_Resource_Interface </code></pre> <p><b>EDIT</b></p> <p>Ok, but if I change a structure of menu I also have to change ACL. In my ACL resource is Controller the privilege is Action in contoller.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload