forked from espenmn/medialog.controlpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
81 lines (54 loc) · 2 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Project Description
===================
This product is a pluggable control panel.
The idea behind it is the following.
- You want a control panel for your settings.
- You don't want to make new control panels all the time.
- You want all your settings to be in the same control panel
- You want tabs in your control panel.
How to use it
--------------
- install medialog.controlpanel (or add it as a dependecy in your product)
- then do the following in your own product
In a py-file (interfaces.py maybe):
------------------------------------
from z3c.form import interfaces
from zope import schema
#from zope.interface import Interface
from zope.interface import alsoProvides
from plone.directives import form
from medialog.controlpanel.interfaces import IMedialogControlpanelSettingsProvider
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('your.product')
class IMyProductSettings(form.Schema):
"""Adds settings to medialog.controlpanel
"""
form.fieldset(
'myproductname',
label=_(u'name of My Settings'),
fields=[
'my_field',
],
)
my_field = schema.TextLine(
title=_(u"label_my_field", default=u"My Field"),
description=_(u"help_my_field",
default=u"My description")
)
alsoProvides(IMyProductSettings, IMedialogControlpanelSettingsProvider)
---------------------------------------------------------------------------
In your products profile:
Add a registry.xml field with the following content:
---------------------------------------------------------------------------
<?xml version="1.0"?>
<registry>
<records interface="my.product.interfaces.IMyProductSettings">
<value key="my_field"></value>
</records>
</registry>
Of course, change MyProduct / my_field to your own names.
Author:
*******
Espen Moe-Nilssen [espenmn]
Some of the code is stolen (shamelessly) from Bluedynamics and Nathan van Gheem.
PS: zedr also wanted to be mentioned.