- Timestamp:
- 02/17/11 14:45:43 (15 months ago)
- Location:
- HelpIM3/branches/chatgroups/HelpIM/chatgroup/pages
- Files:
-
- 1 added
- 1 modified
-
EditSubscription.py (added)
-
Subscription.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
HelpIM3/branches/chatgroups/HelpIM/chatgroup/pages/Subscription.py
r1407 r1409 1 1 from HelpIM.web.pageBase import EditPanel 2 from HelpIM.intranet.db.databaseMetadata import HIM_Text 2 3 3 4 class Handler(EditPanel): … … 8 9 self.panelName = 'Chatgroup Subscription' 9 10 self.function = 'subscribe' 11 path = kwargs['him_request'].environment['PATH_INFO'] 12 if path[:1] == '/': 13 path = path[1:] 14 self.newsType = path 15 self.editFunction = 'Edit'+path 10 16 11 17 def getPanelDef(self, *args, **kwargs): 12 18 group_id = self.checkNotEmpty('group_id') 19 if self.site.userIsAuthorized( 20 user=self.him_request.session.session_user, 21 script=self.editFunction): 22 editLink = {'action': [{'name':self.editFunction, 'text':'Bewerk deze pagina'}, 23 [{'actionParm': [{'name': 'newsType', 'value':self.newsType }]}] 24 ]} 25 else: 26 editLink = {} 27 28 intro = {'web_panel': [ 29 [editLink, 30 {'htmlCode': [{'id':'htmlCode'}]}] 31 ]} 13 32 table = {'table_panel': [ 14 33 {'panelName': 'Beschikbare Chat Groepen', … … 61 80 ] 62 81 ]} 63 return [ table, form]82 return [intro, table, form] 64 83 65 84 def getPanelData(self, *args, **kwargs): 85 him_text = self.site.getHIMTextByTextId(self.site, self.newsType) 86 htmlCode = '' 87 if him_text is None: 88 him_text = HIM_Text() 89 if him_text.himTxt_text is None: 90 him_text.himTxt_text = '' 91 92 him_text.himTxt_text = him_text.himTxt_text.encode('utf-8') 93 self.log.debug('.getPanelData() found HIM_Text.himTxt_textId(%s) himTxt_text(%s)' % (him_text.himTxt_textId, him_text.himTxt_text)) 94 95 htmlCode = { 'htmlCode': [ him_text.himTxt_text.replace(' ', ' ') ] } 96 66 97 if self.checkNotEmpty('group_id'): 67 98 groups = [self.site.getChatgroupById(self.site, self.getParam('group_id'))] … … 88 119 89 120 self.log.debug(groupsData) 90 91 121 92 122 fieldErrors = {'fieldErrors' : [self.errors]} 93 123 panelMessage = {'panelMessage': self.panelMessage} 94 124 95 panel_data = {'panel_data' : [[ groupsData ]]}125 panel_data = {'panel_data' : [[ htmlCode, groupsData ]]} 96 126 97 127 return [panel_data, fieldErrors, panelMessage]
