From 5cac8b7a1b9d65546afd02cd49aa905d3ff796eb Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 22 Jan 2011 12:00:15 +0000 Subject: [PATCH] Hide the moderation_enabled widget in the discussion control panel. We need plone.app.controlpanel > 2.1b1 for this, which is not shipped with Plone 3.x or 4.0.x. svn path=/plone.app.discussion/branches/1.x/; revision=46989 --- CHANGES.txt | 2 +- plone/app/discussion/browser/controlpanel.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3a7ce71..3d01bc4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,7 @@ Changelog ========= -1.0RC1 (unreleased) +1.0RC1 (2011-01-22) ------------------- - Always show existing comments, even if commenting is disabled. diff --git a/plone/app/discussion/browser/controlpanel.py b/plone/app/discussion/browser/controlpanel.py index cb790f8..41c47a4 100644 --- a/plone/app/discussion/browser/controlpanel.py +++ b/plone/app/discussion/browser/controlpanel.py @@ -19,7 +19,7 @@ from zope.app.component.hooks import getSite from zope.component import getMultiAdapter, queryUtility -from z3c.form import button +from z3c.form import button, interfaces from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget from plone.app.discussion.interfaces import IDiscussionSettings, _ @@ -66,6 +66,14 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm): self.widgets['user_notification_enabled'].label = \ _(u"User Email Notification") + # Hide the moderation_enabled widget. We need plone.app.controlpanel + # > 2.1b1 in order to make sure that the proper events are fired when + # the workflow for discussion items is changed in the types control + # panel. Though, Plone 3 and 4.0 ship with an older version of + # p.a.controlpanel that do not fire this event properly. + # http://dev.plone.org/plone/changeset/46270/plone.app.controlpanel/trunk + self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE + @button.buttonAndHandler(_('Save'), name='save') def handleSave(self, action): data, errors = self.extractData()