2009-06-02 23:20:53 +02:00
|
|
|
from Products.Five.browser import BrowserView
|
|
|
|
|
|
|
|
from zope.component import queryUtility
|
|
|
|
from plone.registry.interfaces import IRegistry
|
|
|
|
|
|
|
|
from plone.app.registry.browser import controlpanel
|
|
|
|
|
|
|
|
from plone.app.discussion.interfaces import IDiscussionSettings, _
|
|
|
|
|
2009-11-19 22:40:08 +01:00
|
|
|
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
|
|
|
|
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
|
|
|
|
|
|
|
|
schema = IDiscussionSettings
|
|
|
|
label = _(u"Discussion settings")
|
2009-08-13 15:52:50 +02:00
|
|
|
description = _(u"""Some discussion related settings are not located
|
|
|
|
in the Discussion Control Panel.
|
|
|
|
|
2009-08-15 19:49:50 +02:00
|
|
|
To enable moderation for content types, go to the
|
|
|
|
Types Control Panel, and enable moderation for a
|
|
|
|
specific content type.
|
|
|
|
|
|
|
|
To enable comment moderation, go to the Types
|
|
|
|
Control Panel, choose "Comment", and set the
|
|
|
|
workflow to "Comment Review Workflow".
|
2009-08-13 15:52:50 +02:00
|
|
|
""")
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
def updateFields(self):
|
|
|
|
super(DiscussionSettingsEditForm, self).updateFields()
|
2009-11-19 22:40:08 +01:00
|
|
|
self.fields['globally_enabled'].widgetFactory = SingleCheckBoxFieldWidget
|
|
|
|
self.fields['anonymous_comments'].widgetFactory = SingleCheckBoxFieldWidget
|
|
|
|
self.fields['show_commenter_image'].widgetFactory = SingleCheckBoxFieldWidget
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
def updateWidgets(self):
|
|
|
|
super(DiscussionSettingsEditForm, self).updateWidgets()
|
2009-11-19 22:40:08 +01:00
|
|
|
self.widgets['globally_enabled'].label = u""
|
|
|
|
self.widgets['anonymous_comments'].label = u""
|
|
|
|
self.widgets['show_commenter_image'].label = u""
|
|
|
|
|
2009-06-02 23:20:53 +02:00
|
|
|
|
|
|
|
class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):
|
|
|
|
form = DiscussionSettingsEditForm
|