This topic is locked

Display pages under certain conditions - Urgent

2/27/2009 5:24:51 PM
PHPRunner General questions
K
kjonmyway author

I am hoping someone can help me with this. I have these tables - users, property, calendar.
In the cabins table, there are multiple fields that I want to control the display of the tables in the menu, (and the tabs on all pages). An example:
If, in the property table, the user has purchased the ability to use an availability calendar, then this field will show as yes.
I would like the calendar menu item only available if the this field is set to yes. If they have not purchased it, it should even be an option.
I can't do this in user permissions, because there are multiple fields that control multiple menus items.
Forgive me if this has been addressed before, I can't find it anywhere.

Thanks for any help in advance!!!

Sergey Kornilov admin 2/27/2009

Using Group Permissions is a first a best bet. Probably you need to elaborate further why it won't work for you.
As an alternative you can use BeforeDisplay event to hide some elements. Please note even if you do this users still be able to reach those pages typing in a direct URL.
Here is the sample code:

$xt->assign("tablename_tablelink",false);

K
kjonmyway author 2/27/2009

Thank you, the sample code you sent worked like a charm. I didn't want to use user groups, because I would have had to set up a ton of them. I only sent you one scenario, but it's significantly complicated.
Anyway, thank you very much for the response. It worked.

Using Group Permissions is a first a best bet. Probably you need to elaborate further why it won't work for you.

As an alternative you can use BeforeDisplay event to hide some elements. Please note even if you do this users still be able to reach those pages typing in a direct URL.
Here is the sample code: