[Zope-CMF] Feature request: deleting discussion items added to
default skins
Tres Seaver
tseaver@zope.com
15 Aug 2002 16:43:33 -0400
On Thu, 2002-08-15 at 11:57, Heimo Laukkanen wrote:
> 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?
That would be the best way to keep it from getting lost.
> 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' )
Looks fine.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com