Ejemplo n.º 1
0
 def edit(self, *args, **kw):
     "Inline edit view"
     queryDict = utility.getQueryDict(self.REQUEST.environ.get("QUERY_STRING", ""))
     format = '<table style="vertical-align:top;"><tr><td class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">%s</td><td style="vertical-align:top;">%s</td></tr></table>'
     return format % (
         NestedListURL.drawNestedListThemeroller(self.traverseContainer(queryDict=queryDict)),
         self.drawMenuSelected(),
     )
Ejemplo n.º 2
0
 def getTabOrder(self, doc=None, tabScript=None):
     "get the tabOrder list structure"
     doc = doc or self.getCompoundDoc()
     query = utility.getQueryDict(self.REQUEST.environ.get('QUERY_STRING', ''))
     configScript = tabScript or self.getConfigScript()
     if configScript is not None:
         return self.correctScriptTabOrder(configScript(doc), query)
     
     tabOrder = self.getConfig('tabOrder')
     if tabOrder is not None:
         return [(name,name, '', {}, query) for name in tabOrder]
     
     return []
Ejemplo n.º 3
0
    def getTabOrder(self, doc=None, tabScript=None):
        "get the tabOrder list structure"
        doc = doc or self.getCompoundDoc()
        query = utility.getQueryDict(
            self.REQUEST.environ.get('QUERY_STRING', ''))
        configScript = tabScript or self.getConfigScript()
        if configScript is not None:
            return self.correctScriptTabOrder(configScript(doc), query)

        tabOrder = self.getConfig('tabOrder')
        if tabOrder is not None:
            return [(name, name, '', {}, query) for name in tabOrder]

        return []
Ejemplo n.º 4
0
 def manage_absolute_urls(self, REQUEST={}):
     "create an absolute url sequence for management"
     url = self.absolute_url_path()
     manageTab = self.REQUEST.URLPATH0.replace('%s/' % url, '').split('/')[0]
     
     cssClasses = ''
     otherAttributes = ''
     queryDict = utility.getQueryDict(self.REQUEST.environ.get('QUERY_STRING', ''))
     menu = []
     for i in self.filtered_manage_options():
         selected = i['action'] == manageTab
         menu.append((os.path.join(url, i['action']),i['label'],selected,cssClasses,queryDict,otherAttributes))
     
     return NestedListUrl.listRenderer('Themeroller Tabs',menu, None)
Ejemplo n.º 5
0
    def edit(self, *args, **kw):
        """This draws the inline forms for the objects present."""
        origin = self.getOrigin()
        path = self.getFixedUpPath()
        if path or (not path and self.drawBlankPath) and origin is not None:
            obj = origin.unrestrictedTraverse(path, None)
        else:
            obj = None
        if obj is not None:
            queryString = self.REQUEST.environ.get('QUERY_STRING', '')
            draw_mode = self.getModeFromREQUEST(obj.drawDict)
            modes = sorted(obj.drawDict.keys())

            path = obj.absolute_url_path()

            temp = ['<div class="%s">' % self.cssClass]

            menu = []
            otherAttributes = ''
            cssClasses = ''
            queryDict = utility.getQueryDict(queryString)
            for mode in modes:
                selected = draw_mode == mode
                queryDict['renderType'] = mode
                menu.append((self.REQUEST.URL, mode, selected, cssClasses,
                             queryDict.copy(), otherAttributes))

            temp.append(
                NestedListUrl.listRenderer('Themeroller Tabs', menu, None))

            tab_format = '<div id="%s">%s<div>%s</div></div>'
            config_object = obj.getConfigObject()
            if config_object is not None and config_object is not self:
                mode_url = obj.drawDict[draw_mode]
                tabs = ((obj.absolute_url_path() + '/' + mode_url, 'Local'),
                        (config_object.absolute_url_path() + '/' + mode_url,
                         'Config'))
                temp.append('<div>%s</div>' % self.submitChanges())
                temp.append(com.javascript.tabs_html('control_tabs', tabs))
            else:
                temp.append(obj.draw(draw_mode))
                temp.append('<div>%s</div>' % self.submitChanges())
            return ''.join(temp)
        return ""
Ejemplo n.º 6
0
    def edit(self, *args, **kw):
        """This draws the inline forms for the objects present."""
        origin = self.getOrigin()
        path = self.getFixedUpPath()
        if path or (not path and self.drawBlankPath) and origin is not None:
            obj = origin.unrestrictedTraverse(path, None)
        else:
            obj = None
        if obj is not None:
            queryString = self.REQUEST.environ.get('QUERY_STRING', '')
            draw_mode = self.getModeFromREQUEST(obj.drawDict)
            modes = sorted(obj.drawDict.keys())
            
            path = obj.absolute_url_path()

            temp = ['<div class="%s">' % self.cssClass]
                     
            menu = []
            otherAttributes = ''
            cssClasses = ''
            queryDict = utility.getQueryDict(queryString)
            for mode in modes:
                selected = draw_mode == mode                
                queryDict['renderType'] = mode
                menu.append((self.REQUEST.URL,mode,selected,cssClasses,queryDict.copy(),otherAttributes))
            
            temp.append(NestedListUrl.listRenderer('Themeroller Tabs',menu, None))
            
            tab_format = '<div id="%s">%s<div>%s</div></div>'
            config_object = obj.getConfigObject()
            if config_object is not None and config_object is not self:
                mode_url = obj.drawDict[draw_mode]
                tabs = ((obj.absolute_url_path() + '/' + mode_url,'Local'), 
                    (config_object.absolute_url_path() + '/' + mode_url,'Config'))
                temp.append('<div>%s</div>' % self.submitChanges())
                temp.append(com.javascript.tabs_html('control_tabs', tabs))
            else:
                temp.append(obj.draw(draw_mode))
                temp.append('<div>%s</div>' % self.submitChanges())
            return ''.join(temp)
        return ""