Hello, I’m looking for some help in writing my first plugin. I can’t seem to find anything on programmatic menu navigation. Basically I have it so that the menu function checks to see if the user can or is logged in. If not I want to send the user back to the parent menu. This is possible, right? Thanks!
Something like this:
def MainMenu():
oc = ObjectContainer(
title1 = ‘Menu’)
oc.add(DirectoryObject(
key = Callback(OtherMenu),
title = ‘Other Menu’)
return oc
def OtherMenu():
if login_ok():
oc = ObjectContainer(title1 = ‘Other Menu’)
oc.add (…)
else:
oc = MainMenu()
return oc
will probably work (assuming you define the login_ok() function and add something to the menu after that check). There are some some attributes you can add to the ObjectContainer to alter whether failed logins affect your stack of menus or not.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.