示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
def getSelectedSetup():
    if 'setup' in session:
        selectedSetup = session['setup']
        if selectedSetup in gWebConfig.getSetups():
            return selectedSetup
        else:
            return gWebConfig.getDefaultSetup()
    else:
        return gWebConfig.getDefaultSetup()
示例#5
0
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)
示例#6
0
def getSelectedSetup():
    if "setup" in session:
        selectedSetup = session["setup"]
        if selectedSetup in gWebConfig.getSetups():
            return selectedSetup
        else:
            return gWebConfig.getDefaultSetup()
    else:
        return gWebConfig.getDefaultSetup()
示例#7
0
 def changeSetup(self):
     return self.__changeURLPropertyAndRedirect('dsetup',
                                                gWebConfig.getSetups())
示例#8
0
def setSelectedSetup(setup):
    if setup in gWebConfig.getSetups():
        session['setup'] = setup
        session.save()
示例#9
0
def __checkSetup(setup):
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
示例#10
0
def getSelectedSetup():
    setup = request.environ['pylons.routes_dict']['dsetup']
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
示例#11
0
def setSelectedSetup(setup):
    if setup in gWebConfig.getSetups():
        session["setup"] = setup
        session.save()
示例#12
0
def __checkSetup(setup):
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
示例#13
0
def getSelectedSetup():
    setup = request.environ["pylons.routes_dict"]["dsetup"]
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
示例#14
0
 def changeSetup( self ):
   return self.__changeURLPropertyAndRedirect( 'dsetup', gWebConfig.getSetups() )