Beispiel #1
0
 def actionRegister(self, action, data):
     pass
     context = aq_inner(self.context)
     mailhost = getToolByName(context, 'MailHost')
     to_address = '*****@*****.**'
     mFrom = data['email']
     subject = 'Neue Kursanmeldung: %s %s' % (data['firstname'],
                                              data['lastname'])
     messageText = MESSAGE_TEMPLATE % data
     mailhost.send(messageText,
                   mto=to_address,
                   mfrom=mFrom,
                   subject=subject,
                   encode=None,
                   immediate=False,
                   charset='utf8',
                   msg_type='text/plain')
     IStatusMessage(self.request).add(
         _(u'Your reservation has been forwarded successfully.'),
         type='info')
     return self.result_template()
Beispiel #2
0
# Import ImageField from plone.app.blob
from plone.app.blob.field import ImageField as BlobAwareImageField

from adk.sitecontent import sitecontentMessageFactory as _
from adk.sitecontent.interfaces import IADKPage
from adk.sitecontent.config import PROJECTNAME

ADKPageSchema = schemata.ATContentTypeSchema.copy() + Schema((

    # -*- Your Archetypes field definitions here ... -*-

    BlobAwareImageField(
        'image',
        storage=AnnotationStorage(),
        widget=ImageWidget(
            label=_(u"Preview Image"),
            description=_(u"Upload an image that will be displayed as a preview image in listings and search results."),
        ),
        validators=('isNonEmptyFile'),
    ),


    TextField(
        'text',
        searchable=True,
        default_output_type='text/x-html-safe',
        storage=AnnotationStorage(),
        widget=RichWidget(
            label=_(u"Text"),
            description=_(u""),
            allow_file_upload=False,