2009年12月17日星期四

Re: [fw-mvc] Using Zend_Navigation for hierarchically menus

Andre,

Thank you. I kept at it and got to where I have a good enough understanding
now.

I was able to get the Navigation and the Acl to work together and only show
the menu/submenu item combos that the user had privileges for. For example,
a 'guest' would not see the 'activity' menu at all. Ans authenticated
'member' would see the 'activity' menu and the 'list' submenu. And an
authenticated admin would see the 'activity' menu and the 'list, add, edit'
submenus.

Here is a link to my example: http://gist.github.com/258911 if it helps
anyone.

Thanks,

Jim

Andre Fernandes wrote:
>
> Hi,
>
> Maybe I can help you, but first I need know a little more about what
> problems are you having, what is the difficult.
> I did have a lot of troubles using the nav at the first time use, having
> the
> documentation; luckly I could find my answers using the information on
> many
> blogs on ZF. And each blog has a different approach what is not always
> goo.
> An easier start using it would be perfect, no? :-)
>
> How is organized your directories? Do you use modules? And how is
> implemented the acl, is it registered in the session or another place?
> Whithout acl could you implement the zend_navigation?
>
> André.
>
> 2009/12/17 Nicolas GREVET <ngrevet@alteo.fr>
>
>> Hi,
>>
>> Count me in too.
>> We have the same problem here.
>>
>> Regards,
>> -- Nicolas
>>
>>
>> jscherer26 a écrit :
>>
>> Hi,
>>>
>>> I'd be interested in knowing how you solved this. I'm trying to learn
>>> about
>>> Zend_Navigation and it's integration with Zend_Acl and I'm struggling
>>> with
>>> it. I'm coming at it from a project in version 1.4 that I'm updating and
>>> I
>>> had created my own navigation for. I'm trying to see if Zend_Navigation
>>> can
>>> replace it. The documentation doesn't seem to help me much, so I'm open
>>> to
>>> any suggestions. Thanks in advance.
>>>
>>> Jim
>>>
>>>
>>> Cristian Bichis-3 wrote:
>>>
>>>> Hi,
>>>>
>>>> I have one problem with implementation of menus using Zend_Navigation
>>>> and
>>>> Menu view helper.
>>>>
>>>> I have a hierarchically (2+ levels) menu. Most of the menu items are
>>>> based based, and couple are url based. For grouping the items from
>>>> level 2 i
>>>> am using some "empty" nodes on level 1, which are basically some url
>>>> menu
>>>> items, with # as href. This is a very often case for drop down menus or
>>>> so,
>>>> so could be rendered fine both with Javascript or without (with just
>>>> CSS).
>>>>
>>>> Let's see a menu sample:
>>>>
>>>> About Us (with # as url)
>>>> - About Us (mvc)
>>>> - Contact (mvc)
>>>> - Jobs (mvc)
>>>> - Blog (url)
>>>> Support (with # as url)
>>>> - List tickets (mvc)
>>>> - New ticket (mvc)
>>>>
>>>>
>>>> Each mvc item has associated resource and privilege, and at view helper
>>>> i
>>>> am setting the acl and current role.
>>>>
>>>> Now, here is my problem. Let's suppose the use doesn't have access to
>>>> both "List tickets" and "New ticket". The view helper is rendering the
>>>> "Support" (with # as url) and of course there are no subitems to be
>>>> rendered...
>>>> This looks odd by many reasons... So the problem is: how should i make
>>>> the view helper to NOT render also "Support" if the child pages are not
>>>> rendered.
>>>>
>>>> There are couple of possible solutions:
>>>> - use custom partial script to render menu
>>>> - add an assert for the "empty" menu items to check if subitems would
>>>> be
>>>> rendered or not and decide by this
>>>> - maybe even other solutions...
>>>>
>>>> But i wannt to see what approach are you using for such problems...
>>>>
>>>> --
>>>> Best regards,
>>>> Cristian Bichis
>>>> www.zftutorials.com | www.zfforums.com | www.zftalk.com |
>>>> www.zflinks.com
>>>>
>>>>
>>>>
>>>>
>>>
>
>
> --
> André de Camargo Fernandes
>
>

--
View this message in context: http://n4.nabble.com/Using-Zend-Navigation-for-hierarchically-menus-tp668275p969065.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: