[Zope-CMF] Feature request: deleting discussion items added to default skins

Heimo Laukkanen huima@fountainpark.org
Thu, 15 Aug 2002 18:57:37 +0300


What do others think about adding the delete discussion item - link to 
default skins that come with CMF? Eventhough the answer is to be found 
from the mailing lists, it would help beginners to work with CMF.

Should I add this request to the collector? Put this info to Zopelabs?

And here is simple how to do nice deleting link to reply items.

Add to the talkbacktree ( ZPT ) first in the table definition's 
tal:define following:

mtool here/portal_membership;
member mtool/getAuthenticatedMember;

And to the spot where you want the link for deleting:

<a href="#" tal:condition="python: member.has_permission('Manage 
portal', here)" tal:attributes="href python: url + '/discitem_delete'"> 
[ delete reply ]</a>

And create a Python-script discitem_delete:

#
# discitem_delete
#
parent = context.inReplyTo()
talkback = context.portal_discussion.getDiscussionFor(parent)
talkback.deleteReply( context.getId() )

context.REQUEST['RESPONSE'].redirect( parent.absolute_url() + 
'?portal_status_message=Reply+deleted' )


-- 
Heimo Laukkanen
Oy Fountain Park Ltd
Hämeentie 153 B, 00560 Helsinki, Finland
tel. +358 9 777 68 161, gsm +358 40 759 1110, fax +358 9 777 68 100
http://www.fountainpark.org