comparison MoinMoin/action/AttachFile.py @ 4426:8982d8226218

pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 18 Nov 2008 21:28:49 +0100
parents 62177a952833
children 253a1e691b19
comparison
equal deleted inserted replaced
4424:5ad5753ae311 4426:8982d8226218
392 def send_hotdraw(pagename, request): 392 def send_hotdraw(pagename, request):
393 _ = request.getText 393 _ = request.getText
394 394
395 now = time.time() 395 now = time.time()
396 pubpath = request.cfg.url_prefix_static + "/applets/TWikiDrawPlugin" 396 pubpath = request.cfg.url_prefix_static + "/applets/TWikiDrawPlugin"
397 basename = request.form['drawing'] 397 basename = request.values['drawing']
398 drawpath = getAttachUrl(pagename, basename + '.draw', request, escaped=1) 398 drawpath = getAttachUrl(pagename, basename + '.draw', request, escaped=1)
399 pngpath = getAttachUrl(pagename, basename + '.png', request, escaped=1) 399 pngpath = getAttachUrl(pagename, basename + '.png', request, escaped=1)
400 pagelink = request.href(pagename, action=action_name, ts=now) 400 pagelink = request.href(pagename, action=action_name, ts=now)
401 helplink = Page(request, "HelpOnActions/AttachFile").url(request) 401 helplink = Page(request, "HelpOnActions/AttachFile").url(request)
402 savelink = request.href(pagename, action=action_name, do='savedrawing') 402 savelink = request.href(pagename, action=action_name, do='savedrawing')
403 #savelink = Page(request, pagename).url(request) # XXX include target filename param here for twisted 403 #savelink = Page(request, pagename).url(request) # XXX include target filename param here for twisted
404 # request, {'savename': request.form['drawing']+'.draw'} 404 # request, {'savename': request.values['drawing']+'.draw'}
405 #savelink = '/cgi-bin/dumpform.bat' 405 #savelink = '/cgi-bin/dumpform.bat'
406 406
407 timestamp = '&amp;ts=%s' % now 407 timestamp = '&amp;ts=%s' % now
408 408
409 request.write('<h2>' + _("Edit drawing") + '</h2>') 409 request.write('<h2>' + _("Edit drawing") + '</h2>')
478 request.write(_get_filelist(request, pagename)) 478 request.write(_get_filelist(request, pagename))
479 479
480 if not writeable: 480 if not writeable:
481 request.write('<p>%s</p>' % _('You are not allowed to attach a file to this page.')) 481 request.write('<p>%s</p>' % _('You are not allowed to attach a file to this page.'))
482 482
483 if writeable and request.form.get('drawing'): 483 if writeable and request.values.get('drawing'):
484 send_hotdraw(pagename, request) 484 send_hotdraw(pagename, request)
485 485
486 486
487 ############################################################################# 487 #############################################################################
488 ### Web interface for file upload, viewing and deletion 488 ### Web interface for file upload, viewing and deletion