コード例 #1
0
    def addPage(self, pageTitle=None, pageIndex=-1):
        """
        add a new page at pageIndex, it has two columns as default.
        if pageIndex is -1 then add at the end of the contentpanels
        return the new page index (from 0)
        """
        if pageTitle is None:
            pageTitle = _(u'Untitled page')
        if pageIndex == -1:
            pageIndex = len(self.panelsConfig)
        self.panelsConfig.insert(pageIndex, {'pageColumns': [],
                         'pageTitle': pageTitle,
                         'pageWidth':'100%',
                         'pageCellSpace':'4',
                         'pageCellPad':'4',
                         'pageAlign':'center',
                         'pageStylesheetFixed':[],
                         'pageStylesheetDynamic':[]})

        # add two default columns for the new page
        self.addColumn(pageIndex)
        self.addColumn(pageIndex)
        self._p_changed = 1
        return pageIndex
コード例 #2
0
    ),

    StringField(
        name='panelsConfig',
        edit_accessor='getPanelsConfig',
        widget=TextAreaWidget(
            visible={'edit': 'invisible', 'view': 'invisible'},
        ),
    ),

    StringField(
        name='pageLayoutMode',
        default='tile',
        vocabulary=VOC_PAGE_LAYOUT,
        widget=SelectionWidget(
            label=_(u'label_page_layout_mode', u'Page layout mode'),
            #label_msgid='label_page_layout_mode',
            description=_(u"help_page_layout_mode", u"You can choose 'tile mode' or 'tab mode'. With"
                          u"'tile mode', all pages are shown directly as rows. "
                          u"It is useful for you to make very complex composite "
                          u"page. With 'tab mode', you can switch pages using "
                          u"the top-right tab links."),
            #description_msgid="help_page_layout_mode",
        ),
    ),

    StringField(
        name='customCSS',
        widget=TextAreaWidget(
            label=_(u"label_custom_css", u'Custom CSS'),
            #label_msgid='label_custom_css',