1 | # -*- coding: utf-8 -*- |
---|
2 | from zope import schema |
---|
3 | from zope.interface import Interface |
---|
4 | |
---|
5 | from plone.theme.interfaces import IDefaultPloneLayer |
---|
6 | |
---|
7 | from quintagroup.dropdownmenu import _ |
---|
8 | |
---|
9 | |
---|
10 | class IDropDownMenuLayer(IDefaultPloneLayer): |
---|
11 | """Request marker installed via browserlayer.xml. |
---|
12 | """ |
---|
13 | |
---|
14 | |
---|
15 | class IDropDownMenuSettings(Interface): |
---|
16 | """Global dropdown menu settings. This describes records stored in the |
---|
17 | configuration registry and obtainable via plone.registry. |
---|
18 | """ |
---|
19 | |
---|
20 | show_content_tabs = schema.Bool( |
---|
21 | title=_(u"Show content tabs"), |
---|
22 | description=_(u"Use this setting to enable or disable content structure " |
---|
23 | u"based (autogenerated) portal tabs."), |
---|
24 | default=True) |
---|
25 | |
---|
26 | show_nonfolderish_tabs = schema.Bool( |
---|
27 | title=_(u"Show non-folderish content tabs"), |
---|
28 | description=_(u"Use this setting to enable or disable non-folderish " |
---|
29 | u"content structure based (autogenerated) portal tabs. " |
---|
30 | u"This setting doesn't make sense in case Show content " |
---|
31 | u"tabs is switched off."), |
---|
32 | default=True) |
---|
33 | |
---|
34 | content_before_actions_tabs = schema.Bool( |
---|
35 | title=_(u"Show content tabs before portal_actions tabs"), |
---|
36 | description=_(u"By default portal_actons based tabs are placed before " |
---|
37 | u"those autogenerated from content structure. Check this " |
---|
38 | u"option to revert the behaviour."), |
---|
39 | default=False) |
---|
40 | |
---|
41 | content_tabs_level = schema.Int( |
---|
42 | title=_(u"Content tabs level"), |
---|
43 | description=_(u"How many folders should be included before the " |
---|
44 | u"nested menu stops. 0 means no limit. 1 only includes " |
---|
45 | u"the root folder."), |
---|
46 | default=0) |
---|
47 | |
---|
48 | show_actions_tabs = schema.Bool( |
---|
49 | title=_(u"Show actions tabs"), |
---|
50 | description=_(u"Use this setting to enable or disable portal_actions " |
---|
51 | u"based portal tabs."), |
---|
52 | default=True) |
---|
53 | |
---|
54 | actions_tabs_level = schema.Int( |
---|
55 | title=_(u"Actions tabs level"), |
---|
56 | description=_(u"How many folders should be included before the " |
---|
57 | u"nested menu stops. 0 means no limit. 1 only includes " |
---|
58 | u"the root folder."), |
---|
59 | default=0, |
---|
60 | required=False) |
---|
61 | |
---|
62 | actions_category = schema.TextLine( |
---|
63 | title=_(u"Portal actions category"), |
---|
64 | description=_(u"Root portal actions tool's category name to extract " |
---|
65 | u"tabs from."), |
---|
66 | default=u"portal_tabs") |
---|
67 | |
---|
68 | nested_category_prefix = schema.TextLine( |
---|
69 | title=_(u"Nested category prefix"), |
---|
70 | description=_(u"Because portal_actions category object couldn't serve as" |
---|
71 | u" action itself we need to create appropriate action " |
---|
72 | u"for it. Prefix and sufix strings are used to make up " |
---|
73 | u"id for category while linking action to action category." |
---|
74 | u"E.g.: action id is 'index_html', prefix is 'pre_', sufix" |
---|
75 | u" is equal to '_sub' then category object with id equal " |
---|
76 | u"to 'pre_index_html_sub' will be looked up on the same " |
---|
77 | u"level to get nested menu for 'index_html' action."), |
---|
78 | default=u"", |
---|
79 | required=False) |
---|
80 | |
---|
81 | nested_category_sufix = schema.TextLine( |
---|
82 | title=_(u"Nested category sufix"), |
---|
83 | description=_(u"Sufix part of the category id to be looked up during " |
---|
84 | u"linking with action."), |
---|
85 | default=u"_sub") |
---|