|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_skin.interfaces.viewlet import IMainMenusViewletManager |
|
20 from pyams_zmi.interfaces.menu import ISiteManagementMenu, IControlPanelMenu |
|
21 from pyams_zmi.layer import IAdminLayer |
|
22 |
|
23 # import packages |
|
24 from pyams_skin.viewlet.menu import Menu |
|
25 from pyams_viewlet.manager import viewletmanager_config |
|
26 from pyams_viewlet.viewlet import viewlet_config |
|
27 from zope.interface import implementer |
|
28 |
|
29 from pyams_zmi import _ |
|
30 |
|
31 |
|
32 @viewlet_config(name='manage.menu', layer=IAdminLayer, manager=IMainMenusViewletManager, |
|
33 permission='manage', weight=1) |
|
34 @viewletmanager_config(name='manage.menu', layer=IAdminLayer, provides=ISiteManagementMenu) |
|
35 @implementer(ISiteManagementMenu) |
|
36 class SiteManagementMenu(Menu): |
|
37 """Site management menu""" |
|
38 |
|
39 header = _("Site management") |
|
40 |
|
41 |
|
42 @viewlet_config(name='control-panel.menu', layer=IAdminLayer, manager=IMainMenusViewletManager, |
|
43 permission='system.view', weight=9999) |
|
44 @viewletmanager_config(name='control-panel.menu', layer=IAdminLayer, provides=IControlPanelMenu) |
|
45 @implementer(IControlPanelMenu) |
|
46 class ControlPanelMenu(Menu): |
|
47 """Control panel menu""" |
|
48 |
|
49 header = _("Control panel") |