17 from zope.lifecycleevent.interfaces import IObjectAddedEvent |
17 from zope.lifecycleevent.interfaces import IObjectAddedEvent |
18 from zope.schema.fieldproperty import FieldProperty |
18 from zope.schema.fieldproperty import FieldProperty |
19 |
19 |
20 from pyams_content.component.association.interfaces import ASSOCIATION_CONTAINER_KEY |
20 from pyams_content.component.association.interfaces import ASSOCIATION_CONTAINER_KEY |
21 from pyams_content.component.illustration import IBasicIllustrationTarget |
21 from pyams_content.component.illustration import IBasicIllustrationTarget |
22 from pyams_content.features.menu import Menu |
22 from pyams_content.features.menu.interfaces import IMenu, IMenuLinksContainer, IMenuLinksContainerTarget |
23 from pyams_content.features.menu.interfaces import IMenuLinksContainer, IMenuLinksContainerTarget |
|
24 from pyams_content.features.menu.portlet.navigation.interfaces.simple import ISimpleNavigationMenu, \ |
23 from pyams_content.features.menu.portlet.navigation.interfaces.simple import ISimpleNavigationMenu, \ |
25 ISimpleNavigationPortletSettings |
24 ISimpleNavigationPortletSettings |
26 from pyams_portal.portlet import Portlet, PortletSettings, portlet_config |
25 from pyams_portal.portlet import Portlet, PortletSettings, portlet_config |
27 from pyams_utils.adapter import adapter_config, get_annotation_adapter |
26 from pyams_utils.adapter import adapter_config, get_annotation_adapter |
28 from pyams_utils.factory import factory_config |
27 from pyams_utils.factory import factory_config |
42 |
41 |
43 title = FieldProperty(ISimpleNavigationPortletSettings['title']) |
42 title = FieldProperty(ISimpleNavigationPortletSettings['title']) |
44 |
43 |
45 @property |
44 @property |
46 def links(self): |
45 def links(self): |
47 return get_annotation_adapter(self, SIMPLE_NAVIGATION_LINKS_KEY, Menu, |
46 return get_annotation_adapter(self, SIMPLE_NAVIGATION_LINKS_KEY, IMenu, |
48 markers=ISimpleNavigationMenu, name='++ass++links') |
47 markers=ISimpleNavigationMenu, name='++ass++links') |
49 |
48 |
50 |
49 |
51 @adapter_config(name='links', context=ISimpleNavigationPortletSettings, provides=IMenuLinksContainer) |
50 @adapter_config(name='links', context=ISimpleNavigationPortletSettings, provides=IMenuLinksContainer) |
52 def simple_navigation_links_adapter(context): |
51 def simple_navigation_links_adapter(context): |