class TinyMCEControlPanelForm(ControlPanelForm):
    """TinyMCE Control Panel Form"""
    implements(ITinyMCEControlPanelForm)

    tinymcelayout = FormFieldsets(ITinyMCELayout)
    tinymcelayout.id = 'tinymcelayout'
    tinymcelayout.label = _(u'Layout')

    tinymcetoolbar = FormFieldsets(ITinyMCEToolbar)
    tinymcetoolbar.id = 'tinymcetoolbar'
    tinymcetoolbar.label = _(u'Toolbar')

    tinymcelibraries = FormFieldsets(ITinyMCELibraries)
    tinymcelibraries.id = 'tinymcelibraries'
    tinymcelibraries.label = _(u'Libraries')

    tinymceresourcetypes = FormFieldsets(ITinyMCEResourceTypes)
    tinymceresourcetypes.id = 'tinymceresourcetypes'
    tinymceresourcetypes.label = _(u'Resource Types')

    form_fields = FormFieldsets(tinymcelayout, tinymcetoolbar,
                                tinymceresourcetypes, tinymcelibraries)

    label = _(u"TinyMCE Settings")
    description = _(u"Settings for the TinyMCE Wysiwyg editor.")
    form_name = _("TinyMCE Settings")
Example #2
0
class TinyMCEControlPanelForm(ControlPanelForm):
    """TinyMCE Control Panel Form"""
    implements(ITinyMCEControlPanelForm)

    tinymcelayout = FormFieldsets(ITinyMCELayout)
    tinymcelayout.id = 'tinymcelayout'
    tinymcelayout.label = _(u'Layout')

    tinymcetoolbar = FormFieldsets(ITinyMCEToolbar)
    tinymcetoolbar.id = 'tinymcetoolbar'
    tinymcetoolbar.label = _(u'Toolbar')

    tinymcelibraries = FormFieldsets(ITinyMCELibraries)
    tinymcelibraries.id = 'tinymcelibraries'
    tinymcelibraries.label = _(u'Libraries')

    tinymceresourcetypes = FormFieldsets(ITinyMCEResourceTypes)
    tinymceresourcetypes.id = 'tinymceresourcetypes'
    tinymceresourcetypes.label = _(u'Resource Types')

    form_fields = FormFieldsets(
                        tinymcelayout,
                        tinymcetoolbar,
                        tinymceresourcetypes,
                        tinymcelibraries
                        )

    label = _(u"TinyMCE Settings")
    description = _(u"Settings for the TinyMCE Wysiwyg editor.")
    form_name = _("TinyMCE Settings")

    @form.action(__(u'label_save', default=u'Save'), name=u'save')
    def handle_edit_action(self, action, data):
        CheckAuthenticator(self.request)
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            self.status = __("Changes saved.")
            notify(ConfigurationChangedEvent(self, data))
            self._on_save(data)
        else:
            self.status = __("No changes made.")

    @form.action(__(u'label_cancel', default=u'Cancel'),
                validator=null_validator,
                name=u'cancel')
    def handle_cancel_action(self, action, data):
        IStatusMessage(self.request).addStatusMessage(__("Changes canceled."),
                                                        type="info")
        portal = getToolByName(self.context, name='portal_url')\
            .getPortalObject()
        url = getMultiAdapter((portal, self.request),
                                name='absolute_url')()
        self.request.response.redirect(url + '/plone_control_panel')
        return ''
Example #3
0
class PrimoControlPanelForm(ControlPanelForm):
    """Primo Control Panel Form"""
    implements(IPrimoControlPanelForm)

    primolayout = FormFieldsets(IPrimoLayout)
    primolayout.id = 'primolayout'
    primolayout.label = _(u'Connexion')

    form_fields = FormFieldsets(primolayout)  # Primolibraries

    label = _(u"Primo Settings")
    description = _(u"Settings for the Primo connector.")
    form_name = _("Primo Settings")
Example #4
0
class MarkupControlPanel(ControlPanelForm):

    if HAS_WICKED:
        form_fields = FormFieldsets(textset, wikiset)
        form_fields['wiki_enabled_types'].custom_widget = MultiCheckBoxVocabularyWidget
    else:
        form_fields = FormFieldsets(textset)
    form_fields['allowed_types'].custom_widget = AllowedTypesWidget

    label = _("Markup settings")
    description = _("Lets you control what markup is available when editing "
                    "content.")
    form_name = _("Markup settings")
class TinyMCEControlPanelFormExtended(TinyMCEControlPanelForm):
    """We subclass the TinyMCE Control Panel Form to enable the library
    fieldset"""

    tinymcelibraries = FormFieldsets(ITinyMCELibraries,
                                     ITinyMCELibrariesExtended)
    tinymcelibraries.id = 'tinymcelibraries'
    tinymcelibraries.label = _(u'Libraries')

    form_fields = FormFieldsets(TinyMCEControlPanelForm.tinymcelayout,
                                TinyMCEControlPanelForm.tinymcetoolbar,
                                TinyMCEControlPanelForm.tinymceresourcetypes,
                                tinymcelibraries)
Example #6
0
class TilesPageSettingsForm(FieldsetsEditForm):
    """
    The page that holds all the tiles settings
    """
    tiles = FormFieldsets(IPageTilesSettings)
    tiles.id = 'tiles'
    tiles.label = _(u'Tiles')

    settings = FormFieldsets(ITilesSettings)
    settings.id = 'settings'
    settings.label = _(u'Settings')

    form_fields = FormFieldsets(tiles, settings)
    #our revised TilesWidget that only displays tiles really
    form_fields['tiles'].custom_widget = TilesWidget
    label = _(u"Edit Tiles")
Example #7
0
class CookiePolicyControlPanel(ControlPanelForm):
    """ """
    form_fields = FormFieldsets(baseset)

    label = _('Global statusmessage overlay settings')
    description = _('Configure settings for Global Statusmessage overlay.')
    form_name = _('Global statusmessage overlay')
class CKEditorControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(basicset, skinset, browserset, advancedset)

    label = _("CKEditor settings")
    description = _("Control CKEditor settings for Plone.")
    form_name = _("CKEditor settings")
Example #9
0
class JalonConfigurationControlPanel(ControlPanelForm):

    label = _("Jalon Configuration")
    description = _("""Configuration de Jalon""")
    form_name = _("Jalon Configuration")
    form_fields = FormFieldsets(configAnalyticsset, configLDAPset,
                                configDidacticielset, configMailErreurset,
                                configLienset, configUnivset)
class PropertiesControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(logoset, emailset, sloganset, parametersset)
    form_fields['site_slogan'].custom_widget = slogan_widget

    label = _("Site Properties")
    description = _("Configuration of site specific settings")
    form_name = _("Site Properties")
Example #11
0
class JalonConfigControlPanel(ControlPanelForm):

    label = _("Jalon Content Config")
    description = _("""Configuration des contenus de Jalon""")
    form_name = _("Jalon Content Config")
    form_fields = FormFieldsets(configfichierset, configsonorisationset,
                                configgwimsset, configexternesset,
                                configglossaireset, configmajset)
Example #12
0
class ConnectControlPanelForm(ControlPanelForm):
    """Connect Control Panel Form"""
    implements(IConnectControlPanelForm)

    connectlayout = FormFieldsets(IConnectLayout)
    connectlayout.id = 'connectlayout'
    connectlayout.label = _(u'Connexion')

    connectmodele = FormFieldsets(IConnectModele)
    connectmodele.id = 'connectmodele'
    connectmodele.label = _(u'Modèle')

    form_fields = FormFieldsets(connectlayout, connectmodele) # Connectlibraries

    label = _(u"Connect Settings")
    description = _(u"Settings for the Connect connector.")
    form_name = _("Connect Settings")
Example #13
0
class SliderPageSettingsForm(FieldsetsEditForm):
    """
    The page that holds all the slider settings
    """
    settings = FormFieldsets(ISliderSettings)
    settings.id = 'settings'
    settings.label = _(u'Settings')

    slides = FormFieldsets(IPageSliderSettings)
    slides.id = 'slides'
    slides.label = _(u'Slides')

    form_fields = FormFieldsets(slides, settings)

    #our revised SlidesWidget that only displays slides really
    form_fields['slides'].custom_widget = SlidesWidget
    label = _(u"Slider Settings")
    description = _(u'Configure this slider.')
class SearchControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(searchset)
    form_fields['types_not_searched'].custom_widget = MCBThreeColumnWidget
    form_fields['types_not_searched'].custom_widget.cssClass = 'label'

    label = _("Search settings")
    description = _("Search settings for this site.")
    form_name = _("Search settings")
Example #15
0
class ProvidersControlPanel(ControlPanelForm):
    """ """
    form_fields = FormFieldsets(baseset, twitterset, fbset, gpset)

    form_fields['enabled_portal_types'].custom_widget = MultiSelectWidget

    label = _('Social: Like Actions settings')
    description = _('Configure settings for social like actions.')
    form_name = _('Social: Like Actions')
Example #16
0
class RedmineControlPanel(ControlPanelForm):
    """ """
    form_fields = FormFieldsets(baseset)

    label = _('Redmine settings')
    description = _("Configure settings for redmine. This is used in a "
                    "ploneformgen form for the purpose of creating issues in "
                    "projects.")
    form_name = _('Redmine Settings')
Example #17
0
class WimsControlPanelForm(ControlPanelForm):
    """Wims Control Panel Form"""
    implements(IWimsControlPanelForm)

    wimslayout = FormFieldsets(IWimsLayout)
    wimslayout.id = 'wimslayout'
    wimslayout.label = _(u'Connexion')

    wimsclasse = FormFieldsets(IWimsClasse)
    wimsclasse.id = 'wimsclasse'
    wimsclasse.label = _(u'Classe')

    wimsmodele = FormFieldsets(IWimsModele)
    wimsmodele.id = 'wimsmodele'
    wimsmodele.label = _(u'Modèle')

    form_fields = FormFieldsets(wimslayout, wimsclasse, wimsmodele)  # Wimslibraries

    label = _(u"Wims Settings")
    description = _(u"Settings for the Wims connector.")
    form_name = _("Wims Settings")
class ECABControlPanel(ControlPanelForm):
    """
    """

    form_fields = FormFieldsets(main_set, )

    label = _(u"heading_ecab_prefs", default=u"Assignment Box Settings")

    description = _(u"description_ecspooler_setup",
                    default=u"Settings that affect the "
                    "behavior of all assignment boxes on this site.")

    form_name = _("ECAB settings")
Example #19
0
class PathkeyControlPanelForm(ControlPanelForm):
    """ Pathkey control panel """
    implements(IPathkeyControlPanelForm)

    pathkey_finnish = FormFieldsets(IPathkeyFinnishForm)
    pathkey_finnish.id = 'pathkey_finnish'
    pathkey_finnish.label = _(u"Additional Finnish content")

    pathkey_english = FormFieldsets(IPathkeyEnglishForm)
    pathkey_english.id = 'pathkey_english'
    pathkey_english.label = _(u"Additional English content")

    pathkey_listing = FormFieldsets(IPathkeyListing)
    pathkey_listing.id = 'pathkey_listing'
    pathkey_listing.label = _(u"List all pathkeys")

    form_fields = FormFieldsets(pathkey_finnish, pathkey_english,
                                pathkey_listing)

    form_name = _(u"Pathkey settings")
    label = _(u"Pathkey settings")
    description = _(
        u"Here you can customize the contents of the form requesting pathkey.")
Example #20
0
class FilterControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(filtertagset, filterattributes, filtereditor)
    form_fields['stripped_combinations'].custom_widget = combination_widget

    label = _("HTML Filter settings")
    description = _("Plone filters HTML tags that are considered security "
                    "risks. Be aware of the implications before making "
                    "changes below. By default only tags defined in XHTML "
                    "are permitted. In particular, to allow 'embed' as a tag "
                    "you must both remove it from 'Nasty tags' and add it to "
                    "'Custom tags'. Although the form will update "
                    "immediately to show any changes you make, your changes "
                    "are not saved until you press the 'Save' button.")
    form_name = _("HTML Filter settings")
Example #21
0
class XMControlPanel(ControlPanelForm):
    form_fields = FormFieldsets()
    label = _("eXtremeManagement maintenance")
    description = _(
        "Perform various maintenance tasks. "
        "If you know the totals are wrong, you can recalculate them here. "
        "This should normally not be needed, so do not touch this unless "
        "you know what you are doing.  Then again, it does not hurt, except "
        "that it takes a long time.")

    @form.action(
        _('label_recalculate_actual_hours',
          default='Recalculate actual hours'),
        name='recalculate_actual_hours',
        validator=null_validator)
    def recalculate_actual(self, action, data):
        """Recalculate the actual hours.

        Can be used in case the totals are wrong for some reason.
        """
        context = aq_inner(self.context)
        cat = getToolByName(context, 'portal_catalog')
        for portal_type in ('Booking', 'Task', 'PoiTask',
                            'Story', 'Iteration'):
            brains = cat(portal_type=portal_type)
            for brain in brains:
                obj = brain.getObject()
                anno = IActualHours(obj)
                anno.recalc()

    @form.action(
        _('label_recalculate_estimated_time',
          default='Recalculate estimated time'),
        name='recalculate_estimated_time',
        validator=null_validator)
    def recalculate_estimate(self, action, data):
        """Recalculate the estimates.

        Can be used in case the totals are wrong for some reason.
        """
        context = aq_inner(self.context)
        cat = getToolByName(context, 'portal_catalog')
        for portal_type in ('Task', 'PoiTask', 'Story', 'Iteration'):
            brains = cat(portal_type=portal_type)
            for brain in brains:
                obj = brain.getObject()
                anno = IEstimate(obj)
                anno.recalc()
Example #22
0
class AssetsControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(assetsschema, assetsoverview)

    label = _('label_assets_settings', default='Assets settings')
    description = _('help_assets_settings',
                    default='Settings to enable and configure web assets.')
    form_name = _('label_assets_settings', default='Assets settings')

    actions = ControlPanelForm.actions.copy()

    @action(_(u'label_generate', default=u'Generate Assets'), name=u'generate')
    def handle_generate_action(self, action, data):
        generateview = zope.component.queryMultiAdapter(
            (self.context, self.request), name="generate-assets")
        generateview()
class SEOConfiglet(ControlPanelForm):

    form_fields = FormFieldsets(baseset, advancedset)
    type_seo_enabled = MultiCheckBoxThreeColumnWidget

    form_fields['default_custom_metatags'].custom_widget = Text2ListWidget
    form_fields['metatags_order'].custom_widget = Text2ListWidget
    form_fields['types_seo_enabled'].custom_widget = type_seo_enabled
    form_fields['types_seo_enabled'].custom_widget.cssClass = 'label'
    form_fields['fields'].custom_widget = Text2ListWidget
    form_fields['stop_words'].custom_widget = Text2ListWidget

    label = _("Search Engine Optimizer configuration")
    description = _("seo_configlet_description", default="You can select what "
                    "content types are qSEOptimizer-enabled, and control if "
                    "Dublin Core metatags are exposed in the header of content"
                    " pages.")
    form_name = _("")
Example #24
0
class PigeonholeCP(ControlPanelForm):

    form_fields = FormFieldsets(fs_phtypes, fs_phfield1, fs_phfield2,
                                fs_phfield3, fs_phfield4)

    # title of the page
    label = "Pigeonhole settings"
    # explanatory text
    description = u"""Pigeonhole is an add-on to Plone that allows you to modify content types
                    to include up to four custom axes of metadata.  In these settings, you decide
                    how many of these fields are active, what they are called, and what their 
                    keywords options should be, as well as to which content types they should apply."""
    # fieldset legend
    form_name = "Pigeonhole settings"
    form_fields[
        'ph_aware_types'].custom_widget = MultiCheckBoxThreeColumnWidget
    for i in range(1, 5):
        form_fields['ph_field_description_%s' %
                    i].custom_widget = TinyTextAreaWidget
Example #25
0
class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
    """

    template = ViewPageTemplateFile('templates/controlpanel.pt')

    form_fields = FormFieldsets(selection, options, policies, extras)

    label = _("Multilingual Settings")
    description = _("All the configuration of P.A.M. If you want to set "
                    "the default language to all the content without language "
                    "and move all the content on the root folder to the "
                    "default language folder, go to Extra Options section ")
    form_name = _("Multilingual Settings")

    @form.action(_(u'label_save', default=u'Save'), name=u'save')
    def handle_save_action(self, action, data):
        CheckAuthenticator(self.request)
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            self.status = _Plone("Changes saved.")
            self._on_save(data)
        else:
            self.status = _Plone("No changes made.")
        setupTool = SetupMultilingualSite()
        output = setupTool.setupSite(self.context)
        self.status += output

    @form.action(_Plone(u'label_cancel', default=u'Cancel'),
                 validator=null_validator,
                 name=u'cancel')
    def handle_cancel_action(self, action, data):
        IStatusMessage(self.request).addStatusMessage(
            _Plone("Changes canceled."), type="info")
        url = getMultiAdapter((self.context, self.request),
                              name='absolute_url')()
        self.request.response.redirect(url + '/plone_control_panel')
        return ''

    isLPinstalled = isLPinstalled
class ContentRatingsControlPanel(ControlPanelForm):

    form_name = _(u"Category Assignments")

    actions = ControlPanelForm.actions.copy()

    label = _(u"Rating settings")
    description = _(u"Settings related to content ratings.")

    typespolicies['assignment'].custom_widget = AssignmentWidget

    categories['local_categories'].custom_widget = hr_categories_widget
    categories['acquired_categories'].custom_widget = display_categories_widget
    form_fields = FormFieldsets(typespolicies, categories)

    @form.action(_(u'Change Portal Type'), name=u'change_type')
    def change_type(self, action, data):
        """Does nothing except reload the form"""
        type_id = self.request.form['form.assignment.portal_type']
        self.request.form.clear()
        self.request.form['type_id'] = type_id
        return self()
    def __init__(self, context):
        super(MultiLanguagePoliciesAdapter, self).__init__(context)
        self.registry = getUtility(IRegistry)
        self.settings = self.registry.forInterface(IMultiLanguagePolicies)

    def get_selector_lookup_translations_policy(self):
        return self.settings.selector_lookup_translations_policy

    def set_selector_lookup_translations_policy(self, value):
        self.settings.selector_lookup_translations_policy = value

    selector_lookup_translations_policy = property(
        get_selector_lookup_translations_policy,
        set_selector_lookup_translations_policy)

selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u'Site languages')

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u'Negotiation scheme')

extras = FormFieldsets(IMultiLanguageExtraOptionsSchema)
extras.label = _(u'Extra options')

policies = FormFieldsets(IMultiLanguagePolicies)
policies.label = _(u'Policies')

clean_site_setup = FormFieldsets(IInitialCleanSiteSetupAdapter)
clean_site_setup.label = _(u'Clean site setup')
clean_site_setup.description = _(
    u"If you are installing PAM for the first time in a Plone site, either if "
    def set_move_content_to_language_folder(self, value):
        if value:
            SetupMultilingualSite(self.context).move_default_language_content()

    google_translation_key = property(get_google_translation_key, set_google_translation_key)

    filter_content = property(get_filter_content, set_filter_content)

    redirect_babel_view = property(get_redirect_babel_view, set_redirect_babel_view)

    set_default_language = property(get_set_default_language, set_set_default_language)

    move_content_to_language_folder = property(get_move_content_to_language_folder, set_move_content_to_language_folder)


selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u"Site Languages")

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u"Negotiation Scheme")

extras = FormFieldsets(IMultiLanguageExtraOptionsSetupSchema)
extras.label = _(u"Extra options")


class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
    """

    template = ViewPageTemplateFile("controlpanel.pt")
    def set_entities_greek(self, value):
        self.context._updateProperty('entities_greek', value)

    entities_greek = property(get_entities_greek, set_entities_greek)

    def get_entities_latin(self):
        return self.context.entities_latin

    def set_entities_latin(self, value):
        self.context._updateProperty('entities_latin', value)

    entities_latin = property(get_entities_latin, set_entities_latin)


basicset = FormFieldsets(ICKEditorBaseSchema)
basicset.id = 'cke_base'
basicset.label = _(u'Basic settings')

skinset = FormFieldsets(ICKEditorSkinSchema)
skinset.id = 'cke_skin'
skinset.label = _(u'Editor Skin')

browserset = FormFieldsets(ICKEditorBrowserSchema)
browserset.id = 'cke_browser'
browserset.label = _(u'Resources Browser')

advancedset = FormFieldsets(ICKEditorAdvancedSchema)
advancedset.id = 'cke_advanced'
advancedset.label = _(u'Advanced Configuration')
class BaseControlPanelAdapter(SchemaAdapterBase):
    """ Base control panel adapter """

    def __init__(self, context):
        super(BaseControlPanelAdapter, self).__init__(context)
        portal_properties = getToolByName(context, 'portal_properties')
        self.context = portal_properties.tlspu_cookiepolicy_properties


class CookiePolicyControlPanelAdapter(BaseControlPanelAdapter):
    """ Cookie Policy control panel adapter """
    adapts(IPloneSiteRoot)
    implements(ICookiePolicySchema)

    TCP_enabled = ProxyFieldProperty(ICookiePolicySchema['TCP_enabled'])
    TCP_title = ProxyFieldProperty(ICookiePolicySchema['TCP_title'])
    TCP_message = ProxyFieldProperty(ICookiePolicySchema['TCP_message'])

baseset = FormFieldsets(ICookiePolicySchema)
baseset.id = 'cookiepolicy'
baseset.label = _(u'Cookie Policy')


class CookiePolicyControlPanel(ControlPanelForm):
    """ """
    form_fields = FormFieldsets(baseset)

    label = _('Cookie Policy settings')
    description = _('Configure settings for Cookie Policy.')
    form_name = _('Cookie Policy')
Example #31
0
            stripped = []
            strippeddict = {}
            for ta in value:
                strippeddict[ta.tags] = ta.attributes
                tags = ta.tags.replace(',', ' ').split()
                attributes = ta.attributes.replace(',', ' ').split()
                stripped.append((tags,attributes))

            self._settransform(stripped_combinations = strippeddict)
            # Set kupu attribute for backwards compatibility
            if self.kupu_tool is not None:
                self.kupu_tool.set_stripped_combinations(stripped)
        return property(get, set)


filtertagset = FormFieldsets(IFilterTagsSchema)
filtertagset.id = 'filtertags'
filtertagset.label = _(u'label_filtertags', default=u'Tags')

filterattributes = FormFieldsets(IFilterAttributesSchema)
filterattributes.id = 'filterattributes'
filterattributes.label = _(u'label_filterattributes', default=u'Attributes')

filtereditor = FormFieldsets(IFilterEditorSchema)
filtereditor.id = 'filtereditor'
filtereditor.label = _(u'filterstyles', default=u'Styles')

tagattr_widget = CustomWidgetFactory(ObjectWidget, TagAttrPair)
combination_widget = CustomWidgetFactory(ListSequenceWidget,
                                         subwidget=tagattr_widget)
Example #32
0
                                             default=u"The subject of your email."),
                               required=True)
    body = schema.SourceText(title=_(u"label_message",
                                     default=u"Body"),
                             description=_(u"help_message",
                                           default=u"The body of your email."),
                             required=True)


class IMailServicesFormSchema(IMailServicesGroupsUsersSchema,
                              IMailServicesAdditionalsSchema,
                              IMailServicesMailSchema):
    """ Define the fields of the form
    """

ms_groupsusersset = FormFieldsets(IMailServicesGroupsUsersSchema)
ms_groupsusersset.id = 'groupsusers'
ms_groupsusersset.label = _(u"Groups & Users")

ms_additionalsset = FormFieldsets(IMailServicesAdditionalsSchema)
ms_additionalsset.id = 'additionals'
ms_additionalsset.label = _(u"Additionals mails")

ms_mailset = FormFieldsets(IMailServicesMailSchema)
ms_mailset.id = 'mail'
ms_mailset.label = _(u"Write the mail")


class MailServicesForm(MailServicesView, FieldsetsInputForm):
    """
    """
            vocab_factory = getUtility(IVocabularyFactory,
                          name="plone.contentratings.portal_types")
            portal_type = list(vocab_factory(self.context.context.context))[0].token

        assignment = CategoryAssignment()
        assignment.portal_type = portal_type
        assignment.assigned_categories = set(selected_categories(portal_type))

        return assignment

def selected_categories(portal_type):
    assignments = getUtility(IRatingCategoryAssignment)
    return (t for t in assignments.categories_for_type(portal_type))


typespolicies = FormFieldsets(IEditCategoryAssignment)
typespolicies.id = 'types_categories'
typespolicies.label = _(u'Rating Assignments')
typespolicies.description = _(u'Choose a portal type from the list and select '
u'one or more rating categories to appear on that type. ')
typespolicies.required = False

categories = FormFieldsets(ICategoryContainer)
categories.id = 'manage_categories'
categories.label = _(u'Manage Categories')
categories.description = _(u'Add, modify, or remove rating categories.  You '
u'may specify a title, description, conditions for viewing and setting '
u'ratings, a view to display the rating, and a relative order number.  '
u'Categories which are defined at a lower level (e.g., globally) may not be '
u'edited. You need to save your changes after adding or removing categories')
Example #34
0
        self.context._updateProperty('search_enable_sort_on', value)

    search_enable_sort_on = property(get_search_enable_sort_on,
                                        set_search_enable_sort_on)

    def get_search_review_state_for_anon(self):
        return self.context.search_review_state_for_anon

    def set_search_review_state_for_anon(self, value):
        self.context._updateProperty('search_review_state_for_anon', value)

    search_review_state_for_anon = property(get_search_review_state_for_anon,
                                            set_search_review_state_for_anon)


searchset = FormFieldsets(IBaseSearchSchema)
searchset.id = 'search'
searchset.label = _("Search settings")

advancedset = FormFieldsets(IAdvancedSearchSchema)
advancedset.id = 'advanced'
advancedset.label = _("Advanced search form settings")
advancedset.description = _("Configure when and how to show search options in the advanced search form.")

class SearchControlPanel(ControlPanelForm):

    form_fields = FormFieldsets(searchset, advancedset)
    form_fields['types_not_searched'].custom_widget = MCBThreeColumnWidget
    form_fields['types_not_searched'].custom_widget.cssClass='label'

    for fieldname in ['search_enable_description_search',
    def set_password(self, value):
        self.context._updateProperty('password', value)

    password = property(get_password, set_password)

    def get_backends(self):
        return self.context.backends

    def set_backends(self, value):
        self.context._updateProperty('backends', value)

    backends = property(get_backends, set_backends)
    

spooler_set = FormFieldsets(IECAABControlPanelSpoolerSchema)
spooler_set.id = 'ecaab_settings_spooler'
spooler_set.label = _(u"legend_ecspooler_details", default=u"Spooler connection settings")

backends_set = FormFieldsets(IECAABControlPanelBackendsSchema)
backends_set.id = 'ecaab_settings_backends'
backends_set.label = _(u"legend_backend_details", default=u"Available backends")
 
 
class ECAABControlPanel(ControlPanelForm):
    """
    """
    
    form_fields = FormFieldsets(spooler_set, backends_set)

    label = _(u"heading_ecspooler_setup", 
# -*- coding:utf-8 -*-
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
    )
   
    def __init__(self, context):
        super(BaseControlPanelAdapter, self).__init__(context)
        portal_properties = getToolByName(context, 'portal_properties')
        self.context = portal_properties.sc_mailchimp_newsletters_properties

class MChimpControlPanelAdapter(BaseControlPanelAdapter):
    """ control panel adapter """
    adapts(IPloneSiteRoot)
    implements(IProvidersSchema)
    
    apikey = ProxyFieldProperty(IProvidersSchema['apikey'])
    ssl_enabled = ProxyFieldProperty(IProvidersSchema['ssl_enabled'])
    debugmode = ProxyFieldProperty(IProvidersSchema['debugmode'])

baseset = FormFieldsets(IProvidersSchema)
baseset.id = 'baseset'
baseset.label = _(u'MailChimp Configuration')


class ProvidersControlPanel(ControlPanelForm):
    """ """
    base_template = ControlPanelForm.template
    template = ZopeTwoPageTemplateFile('templates/cpanel.pt')

    form_fields = FormFieldsets(baseset)
    
    label = _('MailChimp settings')
    description = _('Configure settings for sc.mailchimp.newsletter.')
    form_name = _('MailChimp Configuration')
Example #38
0
    """ Linkedin configurations """

    linkedin_enabled = Bool(
        title=_(u"Enable Linkedin button"),
        default=True,
        required=False,
        )

class LinkedinControlPanelAdapter(BaseControlPanelAdapter):
    """ Linkedin control panel adapter """
    adapts(IPloneSiteRoot)
    implements(ILinkedinSchema)

    linkedin_enabled = ProxyFieldProperty(ILinkedinSchema['linkedin_enabled'])

linkedinset = FormFieldsets(ILinkedinSchema)
linkedinset.id = 'linkedinset'
linkedinset.label = _(u'Linkedin settings')

class IPinterestSchema(Interface):
    """ Pinterest configurations """

    pinterest_enabled = Bool(
        title=_(u"Enable Pinterest button"),
        default=True,
        required=False,
        )

class PinterestControlPanelAdapter(BaseControlPanelAdapter):
    """ Pinterest control panel adapter """
    adapts(IPloneSiteRoot)
Example #39
0
    def get_cse_label(self):
        return self.settings.cse_label

    def set_cse_label(self, value):
        self.settings.cse_label = value
    cse_label = property(get_cse_label, set_cse_label)

    @property
    def settings(self):
        site = getSite()
        ann = IAnnotations(site)
        return ann.setdefault(SETTING_KEY, Settings())


urlset = FormFieldsets(IURLSchema)
urlset.id = 'urls'
urlset.label = _(u'URLs')
urlset.description = _(u"This list holds all URLs that are associated with "
                     "a Provider. You cannot add URLs to this list here - "
                     "instead go directly to the desired Provider. There you "
                     "will find an option to add the Provider's URL")

manual_urlset = FormFieldsets(IManualURLsSchema)
manual_urlset.id = 'manual_urls'
manual_urlset.label = _(u'Manual URLs')
manual_urlset.description = _(u'URLs entered here that are already linked with'
                              ' a Provider will be ignored.')

cseset = FormFieldsets(ICSESchema)
cseset.id = 'cse'
    # def set_show_original_on_translation(self, value):
    #     prop = getToolByName(self.context, 'portal_properties').linguaplone_properties
    #     prop.hide_right_column_on_translate_form = value

    # def get_show_original_on_translation(self):
    #     prop = getToolByName(self.context, 'portal_properties').linguaplone_properties
    #     return prop.hide_right_column_on_translate_form

    available_languages = property(get_available_languages, set_available_languages)

    # show_original_on_translation = property(get_show_original_on_translation,
    #                                         set_show_original_on_translation)


selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u"Site Languages")

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u"Negotiation Scheme")


class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
    """

    form_fields = FormFieldsets(selection, options)

    label = _("Multilingual Settings")
    description = _("All the configuration of P.A.M.")
    form_name = _("Multilingual Settings")
    def _toFieldValue(self, input):
        if input == self._missing:
            return self.context._type()
        else:
            return self.context._type(filter(None, self.splitter.split(input)))

    def _toFormValue(self, value):
        if value == self.context.missing_value or \
                value == self.context._type():
            return self._missing
        else:
            return u'\r\n'.join(list(value))


# Fieldset configurations
baseset = FormFieldsets(ISEOConfigletBaseSchema)
baseset.id = 'seobase'
baseset.label = _(u'label_seobase', default=u'Base')

advancedset = FormFieldsets(ISEOConfigletAdvancedSchema)
advancedset.id = 'seoadvanced'
advancedset.label = _(u'label_seoadvanced', default=u'Advanced')


class SEOConfiglet(ControlPanelForm):

    form_fields = FormFieldsets(baseset, advancedset)
    type_seo_enabled = MultiCheckBoxThreeColumnWidget

    form_fields['default_custom_metatags'].custom_widget = Text2ListWidget
    form_fields['metatags_order'].custom_widget = Text2ListWidget
        self.context.supported_langs = languages

    def set_show_original_on_translation(self, value):
        prop = getToolByName(self.context, "portal_properties").linguaplone_properties
        prop.hide_right_column_on_translate_form = value

    def get_show_original_on_translation(self):
        prop = getToolByName(self.context, "portal_properties").linguaplone_properties
        return prop.hide_right_column_on_translate_form

    available_languages = property(get_available_languages, set_available_languages)

    show_original_on_translation = property(get_show_original_on_translation, set_show_original_on_translation)


selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u"Options multilingual")

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u"Negotiation Scheme")

languages = FormFieldsets(IMultilinguaRootFolderForm)
languages.label = _(u"Default language URLs")


langattr_widget = CustomWidgetFactory(ObjectWidget, LangAttrPair)
combination_widget = CustomWidgetFactory(ListSequenceWidget, subwidget=langattr_widget)


class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
Example #43
0
    @property
    def settings(self):
        site = getSite()
        if not IPloneSiteRoot.providedBy(site):
            # here be dirty hack
            dummy = Settings()
            dummy.stored_list = self.stored_list
            dummy.linked_list = self.linked_list
            dummy.additionals_list = self.additionals_list
            return dummy
        ann = IAnnotations(site)
        return ann.setdefault(SETTING_KEY, Settings())


stored_set = FormFieldsets(IStoredCSESchema)
stored_set.id = 'stored'
stored_set.label = _(u'Stored CSE')

linked_set = FormFieldsets(ILinkedCSESchema)
linked_set.id = 'linked'
linked_set.label = _(u'Linked CSE')

additional_set = FormFieldsets(IAdditionalParametersSchema)
additional_set.id = 'additional'
additional_set.label = 'Additional parameters'

stored_settings_widget = CustomWidgetFactory(ObjectWidget, StoredCSETuple)
stored_widget = CustomWidgetFactory(ListSequenceWidget,
                                           subwidget=stored_settings_widget)
Example #44
0
        return self.ph_props.ph_field_visible_4
    ph_field_visible_4 = property(get_ph_field_visible_4, set_ph_field_visible_4)

    def set_ph_field_description_4(self, value):
        self.ph_props.manage_changeProperties(ph_field_description_4=value)
    def get_ph_field_description_4(self):
        return self.ph_props.ph_field_description_4
    ph_field_description_4 = property(get_ph_field_description_4, set_ph_field_description_4)

class TinyTextAreaWidget(TextAreaWidget):
    """We don't need much for our descriptions"""

    height=5
    width=30

fs_phtypes = FormFieldsets(IPHTypes)
fs_phtypes.id = 'phtypes'
fs_phtypes.label = u'Basic Settings'

fs_phfield1 = FormFieldsets(IPHFieldOne)
fs_phfield1.id = 'phfield1'
fs_phfield1.label = u'Field 1'

fs_phfield2 = FormFieldsets(IPHFieldTwo)
fs_phfield2.id = 'phfield2'
fs_phfield2.label = u'Field 2'

fs_phfield3 = FormFieldsets(IPHFieldThree)
fs_phfield3.id = 'phfield3'
fs_phfield3.label = u'Field 3'
                                      set_google_translation_key)

    filter_content = property(get_filter_content, set_filter_content)

    redirect_babel_view = property(get_redirect_babel_view,
                                   set_redirect_babel_view)

    set_default_language = property(get_set_default_language,
                                    set_set_default_language)

    move_content_to_language_folder = property(
        get_move_content_to_language_folder,
        set_move_content_to_language_folder)


selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u'Site Languages')

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u'Negotiation Scheme')

extras = FormFieldsets(IMultiLanguageExtraOptionsSetupSchema)
extras.label = _(u'Extra options')


class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
    """

    form_fields = FormFieldsets(selection, options, extras)
    def _toFieldValue(self, input):
        if input == self._missing:
            return self.context._type()
        else:
            return self.context._type(filter(None, self.splitter.split(input)))

    def _toFormValue(self, value):
        if value == self.context.missing_value or value == self.context._type():
            return self._missing
        else:
            return u"\r\n".join(list(value))


# Fieldset configurations
baseset = FormFieldsets(ISEOConfigletBaseSchema)
baseset.id = "seobase"
baseset.label = _(u"label_seobase", default=u"Base")

advancedset = FormFieldsets(ISEOConfigletAdvancedSchema)
advancedset.id = "seoadvanced"
advancedset.label = _(u"label_seoadvanced", default=u"Advanced")


class SEOConfiglet(ControlPanelForm):

    form_fields = FormFieldsets(baseset, advancedset)
    type_seo_enabled = MultiCheckBoxThreeColumnWidget

    form_fields["default_custom_metatags"].custom_widget = Text2ListWidget
    form_fields["metatags_order"].custom_widget = Text2ListWidget
    def set_entities_greek(self, value):
        self.context._updateProperty('entities_greek', value)

    entities_greek = property(get_entities_greek, set_entities_greek)

    def get_entities_latin(self):
        return self.context.entities_latin

    def set_entities_latin(self, value):
        self.context._updateProperty('entities_latin', value)

    entities_latin = property(get_entities_latin, set_entities_latin)


basicset = FormFieldsets(ICKEditorBaseSchema)
basicset.id = 'cke_base'
basicset.label = _(u'Basic settings')

skinset = FormFieldsets(ICKEditorSkinSchema)
skinset.id = 'cke_skin'
skinset.label = _(u'Editor Skin')

browserset = FormFieldsets(ICKEditorBrowserSchema)
browserset.id = 'cke_browser'
browserset.label = _(u'Resources Browser')

advancedset = FormFieldsets(ICKEditorAdvancedSchema)
advancedset.id = 'cke_advanced'
advancedset.label = _(u'Advanced Configuration')
Example #48
0
    idtitulacioMaster = ProxyFieldProperty(IgenWebControlPanel['idtitulacioMaster'])    
    masterdoctorado = ProxyFieldProperty(IgenWebControlPanel['masterdoctorado'])
    ambitdoctorat_ca = ProxyFieldProperty(IgenWebControlPanel['ambitdoctorat_ca'])
    ambitdoctorat_es = ProxyFieldProperty(IgenWebControlPanel['ambitdoctorat_es'])
    ambitdoctorat_en = ProxyFieldProperty(IgenWebControlPanel['ambitdoctorat_en'])
    
#    @apply
#    def columna1():
#        def get(self):
#            return getGWConfig().columna1
#        def set(self, value):
#            getGWConfig().columna1 = value
#        return property(get, set)
#
            
general = FormFieldsets(ISkinsSchema['theme'], IgenWebControlPanelSchemaGeneral)
general.id = 'genWebControlPanelgeneral'
general.label = _(u'label_gwcp_general', default=u'General')
general['theme'].custom_widget = DropdownChoiceWidget

especifics = FormFieldsets(IgenWebControlPanelSchemaEspecifics)
especifics.id = 'genWebControlPanelespecifics'
especifics.label = _(u'label_gwcp_especifics', default=u'Especific')

informacio = FormFieldsets(IgenWebControlPanelSchemaInformacio)
informacio.id = 'genWebControlPanelinformacio'
informacio.label = _(u'label_gwcp_informacio', default=u'Informacio')

sabors = FormFieldsets(IgenWebControlPanelSchemaSabors)
sabors.id = 'genWebControlPanelsabors'
sabors.label = _(u'label_gwcp_sabors', default=u'Sabors')
    def set_gpsor_discount_title(self, value):
        self.gpsor_props.gpsor_discount_title = value

    def get_gpsor_discount_title(self):
        return self.gpsor_props.gpsor_discount_title
    gpsor_discount_title = property(get_gpsor_discount_title, set_gpsor_discount_title)

    def set_gpsor_discount_total(self, value):
        self.gpsor_props.gpsor_discount_total = value

    def get_gpsor_discount_total(self):
        return self.gpsor_props.gpsor_discount_total
    gpsor_discount_total = property(get_gpsor_discount_total, set_gpsor_discount_total)


fs_gpsortypes = FormFieldsets(IGetPaidSalesforceOrderRecorderTypes)
fs_gpsortypes.id = 'gpsortypes'
fs_gpsortypes.label = u'Types Settings'

class PHMultiCheckBoxWidget(MultiCheckBoxWidget):

    def __init__(self, field, request):
        """Initialize the widget."""
        super(MultiCheckBoxWidget, self).__init__(field,
            field.value_type.vocabulary, request)

class GetPaidSalesforceOrderRecorderCP(ControlPanelForm):

    form_fields = FormFieldsets(fs_gpsortypes)

    # title of the page
Example #50
0
        wiki_enabled_types = property(get_wiki_enabled_types,
                                      set_wiki_enabled_types)

        @property
        def wicked_settings(self):
            ann = IAnnotations(self.context)
            return ann.setdefault(WICKED_SETTING_KEY, WickedSettings())

        def unregister_wicked_types(self):
            """Unregisters all previous registration objects
            """
            for name in wicked_type_regs.keys():
                wicked_type_regs[name](self.context).handle(unregister=True)

textset = FormFieldsets(ITextMarkupSchema)
textset.id = 'textmarkup'
textset.label = _(u'Text markup')

if HAS_WICKED:
    wikiset = FormFieldsets(IWikiMarkupSchema)
    wikiset.id = 'wiki'
    wikiset.label = _(u'Wiki behavior')

class MarkupControlPanel(ControlPanelForm):

    if HAS_WICKED:
        form_fields = FormFieldsets(textset, wikiset)
        form_fields['wiki_enabled_types'].custom_widget = MultiCheckBoxVocabularyWidget
    else:
        form_fields = FormFieldsets(textset)
    

class RichFileStreamingControlPanelAdapter(SchemaAdapterBase):

    adapts(IPloneSiteRoot)
    implements(IRichFileStreamingSchema)

    rf_streaming_collapsed = ProxyFieldProperty(IRichFileStreamingSchema['rf_streaming_collapsed'])
    rfs_autoplay = ProxyFieldProperty(IRichFileStreamingSchema['rfs_autoplay'])
    rfs_host = ProxyFieldProperty(IRichFileStreamingSchema['rfs_host'])
    rfs_port = ProxyFieldProperty(IRichFileStreamingSchema['rfs_port'])
    rfs_callback_netloc = ProxyFieldProperty(IRichFileStreamingSchema['rfs_callback_netloc'])
    rfs_user = ProxyFieldProperty(IRichFileStreamingSchema['rfs_user'])
    rfs_pass = ProxyFieldProperty(IRichFileStreamingSchema['rfs_pass'])

rfs_mainset = FormFieldsets(IRFStreamingMainSchema)
rfs_mainset.id = 'main'
rfs_mainset.label = _(u'label_rfs_main', default=u'Main')

rfs_convertdaemonset = FormFieldsets(IRFStreamingConvertDaemonSchema)
rfs_convertdaemonset.id = 'convertdaemon'
rfs_convertdaemonset.label = _(u'label_rfs_convertdaemon', default=u'ConvertDaemon')


class RichFileStreamingControlPanel(RFControlPanel):
    """
    """
    template = ZopeTwoPageTemplateFile('controlpanel.pt')
    form_fields = FormFieldsets(rfs_mainset, rfs_convertdaemonset)
    label = _("RichFileStreaming settings")
    description = _("RichFileStreaming settings for this site.")
    def set_tagger_type(self, value):
        pass

    tagger_type = property(get_tagger_type, set_tagger_type)

    def set_brown_categories(self, value):
        pass

    def get_brown_categories(self):
        npextractor = getUtility(ITermExtractor)
        return npextractor.tagger_metadata.get("categories")

    brown_categories = property(get_brown_categories, set_brown_categories)


classifierset = FormFieldsets(IClassifierSettingsSchema)
classifierset.id = "classifier"
classifierset.label = u"Classifier settings"
termextractorset = FormFieldsets(ITermExtractorSchema)
termextractorset.id = "termextractor"
termextractorset.label = u"Term Extraction settings"


class ClassifierSettings(ControlPanelForm):
    """
    """

    form_fields = FormFieldsets(classifierset, termextractorset)

    label = _("Classifier settings")
    description = _("Settings for the content classifier.")
Example #53
0
    def _toFieldValue(self, input):
        if input == self._missing:
            return self.context._type()
        else:
            return self.context._type(filter(None, self.splitter.split(input)))

    def _toFormValue(self, value):
        if value == self.context.missing_value or value == self.context._type():
            return self._missing
        else:
            return u'\r\n'.join(list(value))


# Fieldset configurations
baseset = FormFieldsets(ISEOConfigletBaseSchema)
baseset.id = 'seobase'
baseset.label = _(u'label_seobase', default=u'Base')

advancedset = FormFieldsets(ISEOConfigletAdvancedSchema)
advancedset.id = 'seoadvanced'
advancedset.label = _(u'label_seoadvanced', default=u'Advanced')

class SEOConfiglet(ControlPanelForm):

    form_fields = FormFieldsets(baseset, advancedset)

    form_fields['default_custom_metatags'].custom_widget = Text2ListWidget
    form_fields['metatags_order'].custom_widget = Text2ListWidget
    form_fields['types_seo_enabled'].custom_widget = MultiCheckBoxThreeColumnWidget
    form_fields['types_seo_enabled'].custom_widget.cssClass='label'
Example #54
0
    adapts(IPloneSiteRoot)
    implements(IFbSchema)

    fb_enabled = ProxyFieldProperty(IFbSchema['fb_enabled'])
    fbaction = ProxyFieldProperty(IFbSchema['fbaction'])
    fbadmins = ProxyFieldProperty(IFbSchema['fbadmins'])


class GpControlPanelAdapter(BaseControlPanelAdapter):
    """ Google+ control panel adapter """
    adapts(IPloneSiteRoot)
    implements(IGpSchema)

    gp_enabled = ProxyFieldProperty(IGpSchema['gp_enabled'])

baseset = FormFieldsets(IProvidersSchema)
baseset.id = 'baseset'
baseset.label = _(u'Base Plugin Configuration')

twitterset = FormFieldsets(ITwitterSchema)
twitterset.id = 'twitterset'
twitterset.label = _(u'Twitter settings')

fbset = FormFieldsets(IFbSchema)
fbset.id = 'fbset'
fbset.label = _(u'Facebook settings')

gpset = FormFieldsets(IGpSchema)
gpset.id = 'gpset'
gpset.label = _(u'Google+ settings')
Example #55
0
    url_maj = property(get_url_maj, set_url_maj)

    def getAllActiver(self):
        return {
            "fichiers": self.get_activer_fichiers(),
            "externes": self.get_activer_externes(),
            "glossaire": self.get_activer_glossaire(),
            "webconference": self.get_activer_webconference(),
            "sonorisation": self.get_activer_sonorisation(),
            "wims": self.get_activer_wims(),
            "cataloguebu": self.get_activer_cataloguebu(),
            "maj": self.get_activer_maj(),
        }


configfichierset = FormFieldsets(IJalonConfigFichiersControlPanel)
configfichierset.id = 'configfichier'
configfichierset.label = _(u"Fichiers")

configsonorisationset = FormFieldsets(IJalonConfigSonorisationControlPanel)
configsonorisationset.id = 'configsonorisation'
configsonorisationset.label = _(u"Présentation sonorisée & Webconférence")

configgwimsset = FormFieldsets(IJalonConfigWimsControlPanel)
configgwimsset.id = 'configwims'
configgwimsset.label = _(u"Exercices WIMS")

configexternesset = FormFieldsets(IJalonConfigExterneControlPanel)
configexternesset.id = 'configexternes'
configexternesset.label = _(u"Ressources externes & Catalogue BU")
Example #56
0
        wiki_enabled_types = property(get_wiki_enabled_types, set_wiki_enabled_types)

        @property
        def wicked_settings(self):
            ann = IAnnotations(self.context)
            return ann.setdefault(WICKED_SETTING_KEY, WickedSettings())

        def unregister_wicked_types(self):
            """Unregisters all previous registration objects
            """
            for name in wicked_type_regs.keys():
                wicked_type_regs[name](self.context).handle(unregister=True)


textset = FormFieldsets(ITextMarkupSchema)
textset.id = "textmarkup"
textset.label = _(u"Text markup")

if HAS_WICKED:
    wikiset = FormFieldsets(IWikiMarkupSchema)
    wikiset.id = "wiki"
    wikiset.label = _(u"Wiki behavior")


class MarkupControlPanel(ControlPanelForm):

    if HAS_WICKED:
        form_fields = FormFieldsets(textset, wikiset)
        form_fields["wiki_enabled_types"].custom_widget = MultiCheckBoxVocabularyWidget
    else:
    def set_major_attr(self, value):
        self.context._updateProperty('major_attr', value)

    major_attr = property(get_major_attr, set_major_attr)

    def get_personal_title_attr(self):
        return self.context.personal_title_attr

    def set_personal_title_attr(self, value):
        self.context._updateProperty('personal_title_attr', value)

    personal_title_attr = property(get_personal_title_attr, set_personal_title_attr)


main_set = FormFieldsets(IECABControlPanelSchema)
main_set.id = 'ecab_settings_spooler'
main_set.label = _(u"legend_ecab_attr_mapping", default=u"Student attributes mapping")
main_set.description =  _(u"help_ecab_attr_mapping", 
                          default=u"Here you can specify user attributes which "
                                   "should be used to retrieve additional student "
                                   "information.  The available user attributes are "
                                   "listed in portal_memberdata in the "
                                   "Zope Management Interface (ZMI).")
 
class ECABControlPanel(ControlPanelForm):
    """
    """
    
    form_fields = FormFieldsets(main_set, )
        default=False,
        required=False
    )
                          
class BaseControlPanelAdapter(SchemaAdapterBase):
    """ Base control panel adapter """
   
    def __init__(self, context):
        super(BaseControlPanelAdapter, self).__init__(context)
        portal_properties = getToolByName(context, 'portal_properties')
        self.context = portal_properties.ploneslideshow_properties

class SlideShowControlPanelAdapter(BaseControlPanelAdapter):
    """ control panel adapter """
    adapts(IPloneSiteRoot)
    implements(IProvidersSchema)
    
    withcollection = ProxyFieldProperty(IProvidersSchema['withcollection'])

baseset = FormFieldsets(IProvidersSchema)
baseset.id = 'baseset'
baseset.label = _(u'SlideShow Configuration')

class ProvidersControlPanel(ControlPanelForm):
    """ """
    form_fields = FormFieldsets(baseset)
    
    label = _('SlideShow Settings')
    description = _('Configure settings for Products.PloneSlideShow.')
    form_name = _('SlideShow Configuration')
    def __init__(self, context):
        super(MultiLanguagePoliciesAdapter, self).__init__(context)
        self.registry = getUtility(IRegistry)
        self.settings = self.registry.forInterface(IMultiLanguagePolicies)

    def get_selector_lookup_translations_policy(self):
        return self.settings.selector_lookup_translations_policy

    def set_selector_lookup_translations_policy(self, value):
        self.settings.selector_lookup_translations_policy = value

    selector_lookup_translations_policy = property(
            get_selector_lookup_translations_policy,
            set_selector_lookup_translations_policy)

selection = FormFieldsets(IMultiLanguageSelectionSchema)
selection.label = _(u'Site Languages')

options = FormFieldsets(IMultiLanguageOptionsSchema)
options.label = _(u'Negotiation Scheme')

extras = FormFieldsets(IMultiLanguageExtraOptionsSetupSchema)
extras.label = _(u'Extra options')

policies = FormFieldsets(IMultiLanguagePolicies)
policies.label = _(u'Policies')


class LanguageControlPanel(BasePanel):
    """A modified language control panel, allows selecting multiple languages.
    """
Example #60
0
    fb_enabled = ProxyFieldProperty(IFbSchema["fb_enabled"])
    fb_typebutton = ProxyFieldProperty(IFbSchema["fb_typebutton"])
    fbaction = ProxyFieldProperty(IFbSchema["fbaction"])
    fbadmins = ProxyFieldProperty(IFbSchema["fbadmins"])


class GpControlPanelAdapter(BaseControlPanelAdapter):
    """ Google+ control panel adapter """

    adapts(IPloneSiteRoot)
    implements(IGpSchema)

    gp_enabled = ProxyFieldProperty(IGpSchema["gp_enabled"])


baseset = FormFieldsets(IProvidersSchema)
baseset.id = "baseset"
baseset.label = _(u"Base Plugin Configuration")

twitterset = FormFieldsets(ITwitterSchema)
twitterset.id = "twitterset"
twitterset.label = _(u"Twitter settings")

fbset = FormFieldsets(IFbSchema)
fbset.id = "fbset"
fbset.label = _(u"Facebook settings")

gpset = FormFieldsets(IGpSchema)
gpset.id = "gpset"
gpset.label = _(u"Google+ settings")