yaitskov
(Rtfm Rtfm Rtfm)
April 15, 2011, 9:37pm
1
AutoMenuFilter class can generate menu description in a format which CMenu class takes.
The class can work as Yii’s filter or Yii’s application component.
The filter synchronizes automatically visibiltiy menu items with theirs availability. Also it removes duplication code for creating a menu.
aleksdj
(Alex Fanjul)
April 16, 2011, 12:29am
2
I have installed it but I cant understand the functionality of the extension, could you please supply more detailed information?
What is the objetive of the extension? what is the menu that is automatically create? what is the differences between have this extension or not?
thanks in advance
mentel
(Yii)
April 16, 2011, 1:16am
3
I couldn’t find it in the extension repository (http://yiiframework.com/extension/ ).
Are you planning to add it there?
yaitskov
(Rtfm Rtfm Rtfm)
April 18, 2011, 5:17am
4
I’m Newbie therefore I cannot publish any extensions in yiiframework’s repository.
I haven’t got such rights.
yaitskov
(Rtfm Rtfm Rtfm)
April 18, 2011, 5:36am
5
aleksdj:
I have installed it but I cant understand the functionality of the extension, could you please supply more detailed information?
What is the objetive of the extension? what is the menu that is automatically create? what is the differences between have this extension or not?
thanks in advance
You can see a source code of the extension. Its volume is just one class which is in application.components.AutoMenuFilter.
Okay. I will try to describe problem set which resolve this class.
AutoMenuFilter class gets from its controller a description of a common menu.
This description is one for each action (view).
The filter with help CAccessControlFilter class detects availability an action
of each menu item.
An Yii’s application already has an information about users’ rights for actions.
So with my filter you don’t need to duplicate code validating permissions
in a pair’s key visible of CMenu’s description.
Also an action has same user caption ( label ). In case when a controller’s menu is in a view file
you must type the caption in each view file where menu item is used.
aleksdj
(Alex Fanjul)
April 18, 2011, 9:22am
6
Okkkkkk Dannel, I’v got it now!! Could I personalize the behaviour to access a menu depending on user rights? I mean, imagen I have 2 plans (basic and professional) for my end users, I would like all the users could see all the menus, but only proffesional ones could access some of theme, the rest of them (basic plan) would see a custom view asking them to better upgrade to proffesional plan to access this menu. Maybe with a pair of widget properties or something it could be done.
thanks,
alex