comparison MoinMoin/action/edit.py @ 4201:40acd13fb3d6

Changed form access to MultiDict forms
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 03 Jul 2008 23:36:48 +0200
parents db48ab0b2bf8
children 5ad5753ae311
comparison
equal deleted inserted replaced
4200:c21991eed9c9 4201:40acd13fb3d6
31 if request.user.valid: 31 if request.user.valid:
32 editor = request.user.editor_default 32 editor = request.user.editor_default
33 if editor not in valideditors: 33 if editor not in valideditors:
34 editor = request.cfg.editor_default 34 editor = request.cfg.editor_default
35 35
36 editorparam = request.form.get('editor', [editor])[0] 36 editorparam = request.form.get('editor', editor)
37 if editorparam == "guipossible": 37 if editorparam == "guipossible":
38 lasteditor = editor 38 lasteditor = editor
39 elif editorparam == "textonly": 39 elif editorparam == "textonly":
40 editor = lasteditor = 'text' 40 editor = lasteditor = 'text'
41 else: 41 else:
47 # if it is still nothing valid, we just use the text editor 47 # if it is still nothing valid, we just use the text editor
48 if editor not in valideditors: 48 if editor not in valideditors:
49 editor = 'text' 49 editor = 'text'
50 50
51 rev = request.rev or 0 51 rev = request.rev or 0
52 savetext = request.form.get('savetext', [None])[0] 52 savetext = request.form.get('savetext')
53 comment = request.form.get('comment', [u''])[0] 53 comment = request.form.get('comment', u'')
54 category = request.form.get('category', [None])[0] 54 category = request.form.get('category')
55 rstrip = int(request.form.get('rstrip', ['0'])[0]) 55 rstrip = int(request.form.get('rstrip', '0'))
56 trivial = int(request.form.get('trivial', ['0'])[0]) 56 trivial = int(request.form.get('trivial', '0'))
57 57
58 if 'button_switch' in request.form: 58 if 'button_switch' in request.form:
59 if editor == 'text': 59 if editor == 'text':
60 editor = 'gui' 60 editor = 'gui'
61 else: # 'gui' 61 else: # 'gui'
76 76
77 # did user hit cancel button? 77 # did user hit cancel button?
78 cancelled = 'button_cancel' in request.form 78 cancelled = 'button_cancel' in request.form
79 79
80 if request.cfg.edit_ticketing: 80 if request.cfg.edit_ticketing:
81 ticket = request.form.get('ticket', [''])[0] 81 ticket = request.form.get('ticket', '')
82 if not wikiutil.checkTicket(request, ticket): 82 if not wikiutil.checkTicket(request, ticket):
83 request.theme.add_msg(_('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }, "error") 83 request.theme.add_msg(_('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }, "error")
84 pg.send_page() 84 pg.send_page()
85 return 85 return
86 86
87 from MoinMoin.error import ConvertError 87 from MoinMoin.error import ConvertError
88 try: 88 try:
89 if lasteditor == 'gui': 89 if lasteditor == 'gui':
90 # convert input from Graphical editor 90 # convert input from Graphical editor
91 format = request.form.get('format', ['wiki'])[0] 91 format = request.form.get('format', 'wiki')
92 if format == 'wiki': 92 if format == 'wiki':
93 converter_name = 'text_html_text_moin_wiki' 93 converter_name = 'text_html_text_moin_wiki'
94 else: 94 else:
95 converter_name = 'undefined' # XXX we don't have other converters yet 95 converter_name = 'undefined' # XXX we don't have other converters yet
96 convert = wikiutil.importPlugin(request.cfg, "converter", converter_name, 'convert') 96 convert = wikiutil.importPlugin(request.cfg, "converter", converter_name, 'convert')