First of all, my congratulations to the developers of this menu, it is a wonderful tool that I will probably use in my future sites
Anyway, I have a javascript error ("_M has no properties") if one of the menus has no items in it.
Example :
with(milonic=new menuname("taxe")){
itemwidth=200;
borderwidth=1;
style=styleMenus;
alignment="left";
}
It does not happen if there is at least one item in the menu (i.e. one call to aI(...) )
Error if a menu is empty
you can use one line like this:
I also use type=header; to make it match menu color.
regards
maz
Code: Select all
aI("text= ;");
regards
maz
In fact, I'd like to implement user rights on the menu.
Each menu item can be disabled if the user doesn't have the right to use it :
<% if user_has_the_rights() {%>
aI(...)
<% } %>
Thus, it can happen that a user has no rights for any item of a menu.
The workaround could be to make one more test to hide the menu if all its items are disabled
Anyway, I planned to use the "type=disabled" option to disable the menu items. But it is not visual enough (I would have liked a greyed line for example). If there is a way to do it, that would be great
Thanks for your replies
Each menu item can be disabled if the user doesn't have the right to use it :
<% if user_has_the_rights() {%>
aI(...)
<% } %>
Thus, it can happen that a user has no rights for any item of a menu.
The workaround could be to make one more test to hide the menu if all its items are disabled
Anyway, I planned to use the "type=disabled" option to disable the menu items. But it is not visual enough (I would have liked a greyed line for example). If there is a way to do it, that would be great
Thanks for your replies
I see your case. The menu doesn't inheritly support such ability when disabling an item, but since you are doing your menus based on user permissions, you can manually set the colors to a color close to the background color so it definetly looks disabled..try this...
Code: Select all
if( user_has_permission )
{
secToken = "showmenu=secureMenu;";
}else{
secToken = "type=disabled;oncolor=#aaaaaa;offcolor=#aaaaaa;";
}
...
aI("text=High Security Stuff;url=#;" + secToken);
...
Dave Hergert
Software Engineer
"Helping to make the menu better, one
at a time."
Software Engineer
"Helping to make the menu better, one
