From a6ef57f15086d56cc1abfb405e07b7d1b5ea0259 Mon Sep 17 00:00:00 2001 From: Izak Burger Date: Sun, 23 Oct 2011 17:16:01 +0200 Subject: [PATCH] Add a control panel and role based notification setting --- .../browser/configure.zcml | 7 +++++++ src/slc/stickystatusmessages/browser/views.py | 13 ++++++++++++ src/slc/stickystatusmessages/configure.zcml | 1 + src/slc/stickystatusmessages/interfaces.py | 12 +++++++++++ .../profiles/default/controlpanel.xml | 21 +++++++++++++++++++ .../profiles/default/registry.xml | 4 ++++ 6 files changed, 58 insertions(+) create mode 100644 src/slc/stickystatusmessages/profiles/default/controlpanel.xml create mode 100644 src/slc/stickystatusmessages/profiles/default/registry.xml diff --git a/src/slc/stickystatusmessages/browser/configure.zcml b/src/slc/stickystatusmessages/browser/configure.zcml index d26cc95..b61e18c 100644 --- a/src/slc/stickystatusmessages/browser/configure.zcml +++ b/src/slc/stickystatusmessages/browser/configure.zcml @@ -34,4 +34,11 @@ allowed_interface=".interfaces.IAJAXView" /> + + diff --git a/src/slc/stickystatusmessages/browser/views.py b/src/slc/stickystatusmessages/browser/views.py index 8ba1930..ddc5fae 100644 --- a/src/slc/stickystatusmessages/browser/views.py +++ b/src/slc/stickystatusmessages/browser/views.py @@ -5,9 +5,13 @@ from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.CMFCore.utils import getToolByName from plone.app.layout.viewlets.common import ViewletBase +from plone.app.registry.browser.controlpanel import RegistryEditForm +from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper from slc.stickystatusmessages.config import SSMKEY from interfaces import IStickyStatusMessagesViewlet from interfaces import IAJAXView +from slc.stickystatusmessages.interfaces import IStickyStatusMessagesSettings +from slc.stickystatusmessages import StickyStatusMessageFactory as _ class StickyStatusMessagesViewlet(ViewletBase): """ """ @@ -59,3 +63,12 @@ def delete_message(self, message_id): del ssm[message_id] annotations[SSMKEY] = ssm + +class StickyStatusMessagesSettings(RegistryEditForm): + schema = IStickyStatusMessagesSettings + label = _(u"Sticky Status Message Settings") + description = _(u"Use the settings below to configure " + u"slc.stickystatusmessages for this site") + +class StickyStatusMessagesControlPanel(ControlPanelFormWrapper): + form = StickyStatusMessagesSettings diff --git a/src/slc/stickystatusmessages/configure.zcml b/src/slc/stickystatusmessages/configure.zcml index 27f80a1..7037552 100644 --- a/src/slc/stickystatusmessages/configure.zcml +++ b/src/slc/stickystatusmessages/configure.zcml @@ -5,6 +5,7 @@ xmlns:five="http://namespaces.zope.org/five" i18n_domain="slc.stickystatusmessages"> + + + + + Manage portal + + + diff --git a/src/slc/stickystatusmessages/profiles/default/registry.xml b/src/slc/stickystatusmessages/profiles/default/registry.xml new file mode 100644 index 0000000..9d3aebc --- /dev/null +++ b/src/slc/stickystatusmessages/profiles/default/registry.xml @@ -0,0 +1,4 @@ + + + +