src/pyams_content/component/paragraph/html.py
changeset 407 0ef5de2d5674
parent 355 5dce53509832
child 525 72e35444c6b2
equal deleted inserted replaced
406:5527bc086216 407:0ef5de2d5674
    20 from pyams_content.component.association.interfaces import IAssociationContainer
    20 from pyams_content.component.association.interfaces import IAssociationContainer
    21 from pyams_content.component.extfile.interfaces import IExtFileContainerTarget, IBaseExtFile
    21 from pyams_content.component.extfile.interfaces import IExtFileContainerTarget, IBaseExtFile
    22 from pyams_content.component.illustration.interfaces import IIllustrationTarget
    22 from pyams_content.component.illustration.interfaces import IIllustrationTarget
    23 from pyams_content.component.links.interfaces import ILinkContainerTarget, IInternalLink, IExternalLink, IMailtoLink
    23 from pyams_content.component.links.interfaces import ILinkContainerTarget, IInternalLink, IExternalLink, IMailtoLink
    24 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    24 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    25 from pyams_content.component.paragraph.interfaces.html import IRawParagraph, IHTMLParagraph
    25 from pyams_content.component.paragraph.interfaces.html import RAW_PARAGRAPH_TYPE, IRawParagraph, HTML_PARAGRAPH_TYPE, \
       
    26     IHTMLParagraph
    26 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    27 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    27 from pyams_i18n.interfaces import II18n, II18nManager, INegotiator
    28 from pyams_i18n.interfaces import II18n, II18nManager, INegotiator
    28 from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent
    29 from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent
    29 
    30 
    30 # import packages
    31 # import packages
    57     icon_hint = _("Raw HTML ")
    58     icon_hint = _("Raw HTML ")
    58 
    59 
    59     body = FieldProperty(IRawParagraph['body'])
    60     body = FieldProperty(IRawParagraph['body'])
    60 
    61 
    61 
    62 
    62 @utility_config(name='raw', provides=IParagraphFactory)
    63 @utility_config(name=RAW_PARAGRAPH_TYPE, provides=IParagraphFactory)
    63 class RawParagraphFactory(BaseParagraphFactory):
    64 class RawParagraphFactory(BaseParagraphFactory):
    64     """Raw paragraph factory"""
    65     """Raw paragraph factory"""
    65 
    66 
    66     name = _("Raw HTML paragraph")
    67     name = _("Raw HTML paragraph")
    67     content_type = RawParagraph
    68     content_type = RawParagraph
    68     custom_menu = True
       
    69 
    69 
    70 
    70 
    71 @adapter_config(context=IRawParagraph, provides=IContentChecker)
    71 @adapter_config(context=IRawParagraph, provides=IContentChecker)
    72 class RawParagraphContentChecker(BaseParagraphContentChecker):
    72 class RawParagraphContentChecker(BaseParagraphContentChecker):
    73     """Raw HTML paragraph content checker"""
    73     """Raw HTML paragraph content checker"""
   105     icon_hint = _("Rich text")
   105     icon_hint = _("Rich text")
   106 
   106 
   107     body = FieldProperty(IHTMLParagraph['body'])
   107     body = FieldProperty(IHTMLParagraph['body'])
   108 
   108 
   109 
   109 
   110 @utility_config(name='HTML', provides=IParagraphFactory)
   110 @utility_config(name=HTML_PARAGRAPH_TYPE, provides=IParagraphFactory)
   111 class HTMLParagraphFactory(BaseParagraphFactory):
   111 class HTMLParagraphFactory(BaseParagraphFactory):
   112     """HTML paragraph factory"""
   112     """HTML paragraph factory"""
   113 
   113 
   114     name = _("Rich text paragraph")
   114     name = _("Rich text paragraph")
   115     content_type = HTMLParagraph
   115     content_type = HTMLParagraph