[Checkins] SVN: z3ext.controlpanel/trunk/ Added helper wizard form class

Nikolay Kim fafhrd at datacom.kz
Wed Apr 22 15:01:56 EDT 2009


Log message for revision 99403:
  Added helper wizard form class

Changed:
  U   z3ext.controlpanel/trunk/CHANGES.txt
  A   z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py

-=-
Modified: z3ext.controlpanel/trunk/CHANGES.txt
===================================================================
--- z3ext.controlpanel/trunk/CHANGES.txt	2009-04-22 18:33:16 UTC (rev 99402)
+++ z3ext.controlpanel/trunk/CHANGES.txt	2009-04-22 19:01:56 UTC (rev 99403)
@@ -7,6 +7,8 @@
 
 - Added 'Content types' configlet category
 
+- Added helper wizard form class 
+
 - Do not use z3c.autoinclude
 
 - Do not inherit ContentContainerConfiglet from ContentContainer

Added: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py
===================================================================
--- z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py	                        (rev 0)
+++ z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py	2009-04-22 19:01:56 UTC (rev 99403)
@@ -0,0 +1,68 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" 
+
+$Id$
+"""
+from zope import interface
+from zope.component import getUtility
+from z3ext.layoutform import Fields, PageletEditForm
+from z3ext.wizard import WizardWithTabs, WizardStepForm
+from z3ext.wizard.step import WizardStep
+from z3ext.wizard.interfaces import ISaveable
+from z3ext.principal.registration.interfaces import \
+    IPortalRegistration, IInvitationConfiglet
+
+from interfaces import _, IConfigletEditWizard
+
+
+class ConfigletEditWizard(WizardWithTabs):
+    interface.implements(IConfigletEditWizard)
+
+    prefix = 'configlet.'
+    id = 'configlet-edit-wizard'
+
+    @property
+    def title(self):
+        return self.context.__title__
+
+    @property
+    def description(self):
+        return self.context.__description__
+
+
+class ConfigletEditStep(WizardStepForm, PageletEditForm):
+
+    name = 'configlet'
+    title = _('Configlet')
+    label = _('Modify configlet')
+
+    @property
+    def fields(self):
+        return Fields(self.getContent().__schema__)
+
+
+class InvitationsEditStep(WizardStep):
+
+    name = 'invitations'
+    label = title = _('Invitations')
+    description = u''
+
+    def update(self):
+        super(InvitationsEditStep, self).update()
+
+        self.configlet = getUtility(IInvitationConfiglet)
+
+    def isAvailable(self):
+        return getUtility(IPortalRegistration).invitation


Property changes on: z3ext.controlpanel/trunk/src/z3ext/controlpanel/browser/wizard.py
___________________________________________________________________
Added: svn:keywords
   + Id



More information about the Checkins mailing list