コード例 #1
0
ファイル: htmlblock.py プロジェクト: seantis/ftw.book
            name='showTitle',
            schemata='default',
            default=False,

            widget=atapi.BooleanWidget(
                label=_sl(u'simplelayout_label_showtitle',
                          default=u'Show Title'),
                description=_sl(u'simplelayout_help_showtitle',
                                default=u'Show title'))),

        ))

htmlblock_schema += simplelayout_schemas.textSchema.copy()

htmlblock_schema['text'].widget = atapi.TextAreaWidget(
    label=_at(u'label_body_text', default=u'Body Text'),
    description='',
    rows=32,
    cols=70)

htmlblock_schema['title'].required = False
htmlblock_schema['title'].searchable = 0
htmlblock_schema['excludeFromNav'].default = True
htmlblock_schema['description'].widget.visible = {'edit': 0, 'view': 0}
simplelayout_schemas.finalize_simplelayout_schema(htmlblock_schema)


class HTMLBlock(ATDocumentBase):
    """A simplelayout block providing an HTML text field.
    """
コード例 #2
0
from raptus.article.core.interfaces import IArticle
from raptus.article.core.config import PROJECTNAME
from raptus.article.core import RaptusArticleMessageFactory as _

ArticleSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.TextField(
        'text',
        primary=True,
        required=False,
        searchable=True,
        storage=atapi.AnnotationStorage(),
        validators=('isTidyHtmlWithCleanup', ),
        default_output_type='text/x-html-safe',
        widget=atapi.RichWidget(
            description='',
            label=_at(u'label_body_text', default=u'Body Text'),
            rows=25,
            allow_file_upload=zconf.ATDocument.allow_document_upload),
    ),
    atapi.BooleanField(
        'hideTitle',
        required=False,
        languageIndependent=True,
        default=False,
        storage=atapi.AnnotationStorage(),
        schemata='settings',
        accessor='HideTitle',
        widget=atapi.BooleanWidget(
            description='',
            label=_(u'label_hide_title', default=u'Hide title'),
            visible={