def getSetups(): availableSetups = [ "{ text : '%s', url : '%s' }" % (setupName, diracURL(controller="web/userdata", action="changeSetup", id=setupName)) for setupName in gWebConfig.getSetups() ] return "[%s]" % ",".join(availableSetups)
def htmlSetups(): selectedSetup = "<strong>%s</strong>" % credentials.getSelectedSetup() availableSetups = [ (setupName, diracURL(controller="web/userdata", action="changeSetup", id=setupName)) for setupName in gWebConfig.getSetups() ] return yuiWidgets.dropDownMenu("UserSetupPos", selectedSetup, availableSetups)
def getSetups(): availableSetups = [ "{ text : '%s', url : '%s' }" % (setupName, diracURL( controller='web/userdata', action='changeSetup', id=setupName)) for setupName in gWebConfig.getSetups() ] return "[%s]" % ",".join(availableSetups)
def getSelectedSetup(): if 'setup' in session: selectedSetup = session['setup'] if selectedSetup in gWebConfig.getSetups(): return selectedSetup else: return gWebConfig.getDefaultSetup() else: return gWebConfig.getDefaultSetup()
def htmlSetups(): selectedSetup = "<strong>%s</strong>" % credentials.getSelectedSetup() availableSetups = [(setupName, diracURL(controller='web/userdata', action='changeSetup', id=setupName)) for setupName in gWebConfig.getSetups()] return yuiWidgets.dropDownMenu("UserSetupPos", selectedSetup, availableSetups)
def getSelectedSetup(): if "setup" in session: selectedSetup = session["setup"] if selectedSetup in gWebConfig.getSetups(): return selectedSetup else: return gWebConfig.getDefaultSetup() else: return gWebConfig.getDefaultSetup()
def changeSetup(self): return self.__changeURLPropertyAndRedirect('dsetup', gWebConfig.getSetups())
def setSelectedSetup(setup): if setup in gWebConfig.getSetups(): session['setup'] = setup session.save()
def __checkSetup(setup): if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup
def getSelectedSetup(): setup = request.environ['pylons.routes_dict']['dsetup'] if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup
def setSelectedSetup(setup): if setup in gWebConfig.getSetups(): session["setup"] = setup session.save()
def getSelectedSetup(): setup = request.environ["pylons.routes_dict"]["dsetup"] if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup
def changeSetup( self ): return self.__changeURLPropertyAndRedirect( 'dsetup', gWebConfig.getSetups() )