X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/3c4367d8e03450e9a73e61f4247145d2b6c86a33..959d888c17d1403d2eeecc19bc4b5e2c8d1debf6:/Products/Plinn/skins/control/reply_add_control.py diff --git a/Products/Plinn/skins/control/reply_add_control.py b/Products/Plinn/skins/control/reply_add_control.py new file mode 100644 index 0000000..1bd2c69 --- /dev/null +++ b/Products/Plinn/skins/control/reply_add_control.py @@ -0,0 +1,11 @@ +##parameters=title, text, **kw +title = title.strip() +text = text.strip() + +if title and text : + try : talkback = context.talkback + except : talkback = context.portal_discussion.getDiscussionFor(context) + replyId = talkback.createReply(title=title, text=text) + return context.setStatus(replyId, 'Comment added.') +else : + return context.setStatus(False, 'You must enter a title and body.') \ No newline at end of file