示例#1
0
from Products.ATContentTypes.content.image import ATImage

from Products.CMFPlone import PloneMessageFactory as _p
from Products.CMFCore.permissions import View

from raptus.showcase.interfaces import IShowcaseImage
from raptus.showcase.config import PROJECTNAME
from raptus.showcase import ShowcaseMessageFactory as _

from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget
from Products.CMFCore.permissions import ModifyPortalContent

ShowcaseImageSchema = ATImage.schema.copy() + Schema((
    
    IntegerField ('x',
                  widget = IntegerWidget(label = _(u'X Position'),
                                         description = _(u'The X position in the showcase box'),
                                         )
                  ),
                  
    IntegerField ('y',
                  widget = IntegerWidget(label = _(u'Y Position'),
                                         description = _(u'The Y position in the showcase box'),
                                         )
                  ),

                  
    IntegerField ('clipWidth',
                  widget = IntegerWidget(label = _(u'clip width'),
                                         description = _(u'width before it will cut image'),
                                         )
示例#2
0
  from Products.Archetypes.public import *
  
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.content.folder import ATFolder

from Products.CMFCore.permissions import View

from raptus.showcase.interfaces import IShowcase
from raptus.showcase.config import PROJECTNAME
from raptus.showcase import ShowcaseMessageFactory as _


ShowcaseSchema = ATFolder.schema.copy() + Schema((
        
    StringField('showcaseEditor',
        widget = StringWidget(label = _('Showcase editor'),
                              macro = 'showcaseboxwidget',
                              helper_js = ('showcaseboxwidget.js', 'jquery.rightClick.js', 'jquery.leftClick.js'),
                              helper_css = ('showcaseboxwidget.css',), )
    ),
))

for field in ('text', 'image', 'allowDiscussion', 'creators','contributors','location','subject','language','rights','presentation', 'tableContents',):
    if ShowcaseSchema.has_key(field):
        ShowcaseSchema[field].widget.visible = 0

finalizeATCTSchema(ShowcaseSchema, folderish=True, moveDiscussion=True)

class Showcase (ATFolder):
    """ A Showcase
    """