diff -r a5e56749ca3d -r 3d259e1718ef src/pyams_content/features/menu/interfaces/__init__.py --- a/src/pyams_content/features/menu/interfaces/__init__.py Fri Oct 12 14:33:03 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -# -# Copyright (c) 2008-2018 Thierry Florac -# 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. -# - -__docformat__ = 'restructuredtext' - -from zope.container.constraints import containers, contains -from zope.interface import Attribute, Interface -from zope.schema import Bool, Choice - -from pyams_content.component.association.interfaces import IAssociationContainer, IAssociationContainerTarget -from pyams_content.reference.pictograms.interfaces import SELECTED_PICTOGRAM_VOCABULARY -from pyams_i18n.schema import I18nTextLineField -from pyams_sequence.interfaces import IInternalReference -from pyams_sequence.schema import InternalReferenceField - -from pyams_content import _ - - -class IMenuLink(Interface): - """Menu link marker interface""" - - -class IMenuInternalLink(IMenuLink): - """Menu internal link marker interface""" - - -class IMenuExternalLink(IMenuLink): - """Menu external link marker interface""" - - -class IMenuLinksContainer(IAssociationContainer): - """Menu links container interface""" - - contains(IMenuLink) - - -class IMenuLinksContainerTarget(IAssociationContainerTarget): - """Menu links container marker interface""" - - -class IMenu(IMenuLinksContainer, IInternalReference): - """Menu container interface""" - - containers('.IMenusContainer') - - visible = Bool(title=_("Visible?"), - description=_("Is this item visible in front-office?"), - required=True, - default=True) - - title = I18nTextLineField(title=_("Menu title"), - description=_("Displayed menu label"), - required=True) - - reference = InternalReferenceField(title=_("Internal reference"), - description=_("Direct reference to menu target"), - required=False) - - pictogram_name = Choice(title=_("Pictogram"), - description=_("Name of the pictogram associated with this menu"), - required=False, - vocabulary=SELECTED_PICTOGRAM_VOCABULARY) - - pictogram = Attribute("Pictogram object reference") - - -class IMenusContainer(IAssociationContainer): - """Menus container interface""" - - contains(IMenu) - - -class IMenusContainerTarget(IAssociationContainerTarget): - """Menus container target marker interface"""