def do_POST( self, request ): if not self.init_done: self.init_modules( request ) self.init_done = True moduleName = getVar( 'mod', request ) if moduleName in self.modules: self.modules[ moduleName ].perform( request )
def render_main( self, request ): if not self.init_done: self.init_modules( request ) self.init_done = True moduleName = getVar('mod', request) if moduleName not in self.modules: request.write( '<p>Please select a module</p>' ) else: module = self.modules[ moduleName ] module.write_BODY( request )
def write_BODY( self, request ): if not self.__dict__.has_key( "tab" ): try: self.tab = int( getVar( 'tab', request, 0 ) ) except: self.tab = 0 request.write( "\n<div class='title'>%s</div>" % self.title ) TabView( self.tab, self.tabStrings, self.urlWriter ).write_BODY( request ) try: request.write( "\n<div class='tab'>" ) render_tab = self.tabObjects[ self.tab ] render_tab( self.urlWriter ).write_BODY( request ) request.write( "\n</div>" ) except Exception, e: request.write( "\n<p>Error Rendering Tab</p>" ) request.write( "\n<p>%s</p>" % str( e ) )
def perform( self, request ): request.write( "Tab> perform" ) request.write( "<br/>op: " + str( getVar( 'op', request ) ) ) request.write( "<br/>args: " + str( getVar( 'args', request ) ) ) request.write( "<br/>tab: " + str( getVar( 'tab', request ) ) ) try: action = getVar( 'op', request, 0 ) if action == "tab": self.tab = int( getVar( 'args', request ) ) else: this.tab = int( getVar( 'tab', request, 0 ) ) self.tabObjects[ self.tab ]( self.urlWriter ).perform( request ) except: pass