Exemplo n.º 1
0
    def getMenuItems(self, context, request):
        # menuitems is a list of tal-friendly dictionaries
        menuitems = super(CustomMenu, self).getMenuItems(context, request)
        base_context = aq_base(aq_inner(context))
        if bool((getattr(base_context, 'isPrincipiaFolderish', False) or
                context.portal_type == 'Plone Site')):
            url = context.absolute_url()
            new_menu = {'extra': {'separator': None,
                                  'id': 'multiple-files',
                                  'class': 'contenttype-multiple-files'},
                        'submenu': None,
                        'description': _(u'A form to upload multiple files.'),
                        'title': _(u'Multiple Files'),
                        'action': '%s/@@mass-import' % url,
                        'selected': False,
                        'id': 'Multiple Files',
                        'icon': None}
            menuitems.insert(-1, new_menu)

        return menuitems
from collective.quickupload.browser import quickupload_settings
from collective.zipfiletransport.browser import zipfiletransportprefs
from plone.app.controlpanel.form import ControlPanelForm
from plone.fieldsets.fieldsets import FormFieldsets
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.formlib.schema import ProxyFieldProperty
from Products.CMFDefault.formlib.schema import SchemaAdapterBase
from Products.CMFPlone.interfaces import IPloneSiteRoot
from sc.base.uploader import MessageFactory as _
from zope import schema
from zope.component import adapts
from zope.interface import Interface, implements

quickset = FormFieldsets(quickupload_settings.IQuickUploadControlPanel)
quickset.id = "quickupload"
quickset.label = _(u"Quick Upload settings")

zipset = FormFieldsets(zipfiletransportprefs.IZipFileTransportPrefsForm)
zipset.id = "ziptransport"
zipset.label = _(u"ZipFileTransport Settings Form")

EXPORTER_DESC = _(u"Should exporting contents from a folder be enabled " u"for anonymous users?")


class IExporterPrefsForm(Interface):
    """ A configlet for exporting content. """

    enable_export = schema.Bool(
        title=_(u"Enable anonymous export"), description=EXPORTER_DESC, default=False, required=False
    )