def __init__(self,req,alerts=[],number=None,of=None,newLook=None): if newLook == None: newLook = True self.newLook = newLook extra = '' if number: extra += '_%d' % number if of: extra += '_of_%d' % of if not newLook: TableController.__init__(self,req,'alerts%s' % extra, 'Messages & Alerts',dbOrder=False,showHeaders=False,className='alertTable',emptyMessage='') self.addHeader(TH('severity', 'Severity',TH.HTML,sorted=True,sortable=True)) self.addHeader(TH('message', 'Message',TH.TEXT)) else: TableController.__init__(self,req,'alerts%s' % extra, None,dbOrder=False,className='newAlertTable',emptyMessage='') self.addHeader(TH('message', 'Messages & Alerts',TH.HTML,sorted=True,sortable=True)) for alert in alerts: self.addAlert(**alert)
def createContent(self): dialogTable = TableController(self.req,'dialog',self._title,showHeaders=False) dialogTable.addHeader(TH('text', 'text',TH.HTML,sorted=False,sortable=False)) dialogTable.addRow(text=self._text) self.dialogTable = dialogTable.getContent()