src/pyams_content/shared/imagemap/paragraph.py
changeset 407 0ef5de2d5674
parent 391 6cd4434612f5
child 555 8e8a14452567
equal deleted inserted replaced
406:5527bc086216 407:0ef5de2d5674
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    19 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    20 from pyams_content.features.checker.interfaces import IContentChecker, ERROR_VALUE, MISSING_VALUE, MISSING_LANG_VALUE
    20 from pyams_content.features.checker.interfaces import IContentChecker, ERROR_VALUE, MISSING_VALUE, MISSING_LANG_VALUE
    21 from pyams_content.shared.imagemap.interfaces import IImageMapParagraph
    21 from pyams_content.shared.imagemap.interfaces import IImageMapParagraph, IMAGEMAP_PARAGRAPH_TYPE
    22 from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
    22 from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
    23 from pyams_workflow.interfaces import IWorkflow, IWorkflowState
    23 from pyams_workflow.interfaces import IWorkflow, IWorkflowState
    24 
    24 
    25 # import packages
    25 # import packages
    26 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    26 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    45 
    45 
    46     def get_target(self, state=None):
    46     def get_target(self, state=None):
    47         return get_reference_target(self.reference, state)
    47         return get_reference_target(self.reference, state)
    48 
    48 
    49 
    49 
    50 @utility_config(name='ImageMap', provides=IParagraphFactory)
    50 @utility_config(name=IMAGEMAP_PARAGRAPH_TYPE, provides=IParagraphFactory)
    51 class ImageMapParagraphFactory(BaseParagraphFactory):
    51 class ImageMapParagraphFactory(BaseParagraphFactory):
    52     """Image map paragraph factory"""
    52     """Image map paragraph factory"""
    53 
    53 
    54     name = _("Image map")
    54     name = _("Image map")
    55     content_type = ImageMapParagraph
    55     content_type = ImageMapParagraph
       
    56     secondary_menu = True
    56 
    57 
    57 
    58 
    58 @adapter_config(context=IImageMapParagraph, provides=IContentChecker)
    59 @adapter_config(context=IImageMapParagraph, provides=IContentChecker)
    59 class ImageMapParagraphContentChecker(BaseParagraphContentChecker):
    60 class ImageMapParagraphContentChecker(BaseParagraphContentChecker):
    60     """ImageMap paragraph content checker"""
    61     """ImageMap paragraph content checker"""