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")
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 ''
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)
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 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")
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")
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")
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")
class JalonConfigurationControlPanel(ControlPanelForm): label = _("Jalon Configuration") description = _("""Configuration de Jalon""") form_name = _("Jalon Configuration") form_fields = FormFieldsets(configAnalyticsset, configLDAPset, configDidacticielset, configMailErreurset, configLienset, configUnivset)
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")
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)
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')
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')
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")
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")
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.")
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")
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()
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 = _("")
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
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 _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
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")
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')
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)