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', 'search_enable_title_search',
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') sabors['tipusintranet'].custom_widget = DropdownChoiceWidget
# -*- 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 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' fs_phfield4 = FormFieldsets(IPHFieldFour)
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 label = "GetPaid Salesforce Order Recorder Settings"
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, ) label = _(u"heading_ecab_prefs",
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')
return self.settings.show_previous_events def set_show_previous_events(self, value): self.settings.show_previous_events = value show_previous_events = property(get_show_previous_events, set_show_previous_events) @property def settings(self): ann = IAnnotations(self.context) return ann.setdefault(SETTING_KEY, Settings()) logoset = FormFieldsets(ILogoSchema) logoset.id = 'logo' logoset.label = _(u'Logo') emailset = FormFieldsets(IEmailSchema) emailset.id = 'email' emailset.label = _(u'Email') sloganset = FormFieldsets(ISloganSchema) sloganset.id = 'slogan' sloganset.label = _(u'Slogan') parametersset = FormFieldsets(IParametersSchema) parametersset.id = 'parameters' parametersset.label = _(u'Parameters') title_widget = CustomWidgetFactory(ObjectWidget, TitleLanguagePair)
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) class FilterControlPanel(ControlPanelForm):
for url in bundle.urls(): styles.append("%s [%s]" % (url, bundle.extra_data.get("media", None))) return sorted(styles) @property def js(self): scripts = [] for name, bundle in self.env._named_bundles.iteritems(): if not name.startswith("js-"): continue scripts.extend(bundle.urls()) return sorted(scripts) assetsschema = FormFieldsets(IAssetsCPConfigSchema) assetsschema.id = "assetsconfig" assetsschema.label = _(u"label_assetsconfig", default=u"Configuration") assetsoverview = FormFieldsets(IAssetsCPOverviewSchema) assetsoverview.id = "assetsoverview" assetsoverview.label = _(u"label_assetsoverview", default=u"Overview") 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")
show_atoz_link = property(get_show_atoz_link, set_show_atoz_link) def get_show_previous_events(self): return self.settings.show_previous_events def set_show_previous_events(self, value): self.settings.show_previous_events = value show_previous_events = property(get_show_previous_events, set_show_previous_events) @property def settings(self): ann = IAnnotations(self.context) return ann.setdefault(SETTING_KEY, Settings()) logoset = FormFieldsets(ILogoSchema) logoset.id = 'logo' logoset.label = _(u'Logo') emailset = FormFieldsets(IEmailSchema) emailset.id = 'email' emailset.label = _(u'Email') sloganset = FormFieldsets(ISloganSchema) sloganset.id = 'slogan' sloganset.label = _(u'Slogan') parametersset = FormFieldsets(IParametersSchema) parametersset.id = 'parameters' parametersset.label = _(u'Parameters')
styles.append('%s [%s]' % ( url, bundle.extra.get('media', None))) return sorted(styles) @property def js(self): scripts = [] for name, bundle in self.env._named_bundles.iteritems(): if not name.startswith('js-'): continue scripts.extend(bundle.urls()) return sorted(scripts) assetsschema = FormFieldsets(IAssetsCPConfigSchema) assetsschema.id = 'assetsconfig' assetsschema.label = _(u'label_assetsconfig', default=u'Configuration') assetsoverview = FormFieldsets(IAssetsCPOverviewSchema) assetsoverview.id = 'assetsoverview' assetsoverview.label = _(u'label_assetsoverview', default=u'Overview') 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')
"trombi": self.jiProps.getProperty('lien_trombi', None), "plan_vide": self.jiProps.getProperty('didacticiel_plan_vide', None), "etablissement": self.jiProps.getProperty('etablissement', None), "categories_itunesu": self.jiProps.getProperty('categories_itunesu', None) } if not info in dico: return "" return dico[info] configAnalyticsset = FormFieldsets(IJalonConfigAnalyticsControlPanel) configAnalyticsset.id = 'configAnalytics' configAnalyticsset.label = _(u"Analytics") configLDAPset = FormFieldsets(IJalonConfigLDAPControlPanel) configLDAPset.id = 'configLDAP' configLDAPset.label = _(u"LDAP") configDidacticielset = FormFieldsets(IJalonConfigDidacticielControlPanel) configDidacticielset.id = 'configDidacticiel' configDidacticielset.label = _(u"Didacticiels") configMailErreurset = FormFieldsets(IJalonConfigMailErreurControlPanel) configMailErreurset.id = 'configMailErreur' configMailErreurset.label = _(u"Gestion des emails") configLienset = FormFieldsets(IJalonConfigLienControlPanel)
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) class FilterControlPanel(ControlPanelForm):
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' cseset.label = _(u'CSE')
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')
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.") form_name = _("RichFileStreaming settings")
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')
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): """ """ form_name = _(u"Mail Services")
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' form_fields['fields'].custom_widget = Text2ListWidget
@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) linked_settings_widget = CustomWidgetFactory(ObjectWidget, LinkedCSETuple)
class UIControlPanelAdapter(SchemaAdapterBase): """ Adapter for the interface schema fields """ adapts(IPloneSiteRoot) implements(IUITool) def __init__(self, context): super(UIControlPanelAdapter, self).__init__(context) self.portal = context ui_tool = getToolByName(self.portal, 'portal_ui_tool') self.context = ui_tool theme = FormFieldsets(IUIToolTheme) theme.id = 'theme' theme.label = _(u"Existing themes") theme.description = _(u'Please select a theme from the existing ones.') themeroller = FormFieldsets(IUIToolThemeroller) themeroller.id = 'themeroller' themeroller.label = _('Add theme') class ThemeDisplayWidget(DisplayWidget): """ Display the create directory link """ def __call__(self): tool = self.context.context tool._rebuildThemeHashes()
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')
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 = _( 'typespolicies_description_help', default=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 = _( 'categories_description_help', default=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. '
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.") form_name = _("Classifier settings")
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", default=u"Auto Assessment Box Settings")
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) form_fields['allowed_types'].custom_widget = AllowedTypesWidget
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' fs_phfield4 = FormFieldsets(IPHFieldFour)
if t not in self.context.types_not_searched and t not in BAD_TYPES ] def set_types_not_searched(self, value): # Note: we add BAD_TYPES to the value list. value = [ t for t in self.ttool.listContentTypes() if t not in value or t in BAD_TYPES ] self.context._updateProperty('types_not_searched', value) # This also defines the user friendly types types_not_searched = property(get_types_not_searched, set_types_not_searched) searchset = FormFieldsets(IBaseSearchSchema) searchset.id = 'search' searchset.label = _("Search settings") 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")
styles.append('%s [%s]' % (url, bundle.extra.get('media', None))) return sorted(styles) @property def js(self): scripts = [] for name, bundle in self.env._named_bundles.iteritems(): if not name.startswith('js-'): continue scripts.extend(bundle.urls()) return sorted(scripts) assetsschema = FormFieldsets(IAssetsCPConfigSchema) assetsschema.id = 'assetsconfig' assetsschema.label = _(u'label_assetsconfig', default=u'Configuration') assetsoverview = FormFieldsets(IAssetsCPOverviewSchema) assetsoverview.id = 'assetsoverview' assetsoverview.label = _(u'label_assetsoverview', default=u'Overview') 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')
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)
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 form_fields["types_seo_enabled"].custom_widget = type_seo_enabled
self.context = portal_properties.redmine_configuration_properties class RedmineControlPanelAdapter(BaseControlPanelAdapter): """ Redmine settings control panel adapter """ adapts(IPloneSiteRoot) implements(IRedmineSchema) redmine_url = ProxyFieldProperty(IRedmineSchema['redmine_url']) version = ProxyFieldProperty(IRedmineSchema['version']) user_api_key = ProxyFieldProperty(IRedmineSchema['user_api_key']) project = ProxyFieldProperty(IRedmineSchema['project']) baseset = FormFieldsets(IRedmineSchema) baseset.id = 'redmine-configuration' baseset.label = _(u'Redmine configuration') 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 IssueCreate(BrowserView):
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']) TCP_submit_button = ProxyFieldProperty( ICookiePolicySchema['TCP_submit_button']) baseset = FormFieldsets(ICookiePolicySchema) baseset.id = 'cookiepolicy' baseset.label = _(u'Global statusmessage overlay') class CookiePolicyControlPanel(ControlPanelForm): """ """ form_fields = FormFieldsets(baseset) label = _('Global statusmessage overlay settings') description = _('Configure settings for Global Statusmessage overlay.') form_name = _('Global statusmessage overlay')
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")
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')
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') categories.required = False
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) implements(IPinterestSchema)
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") configglossaireset = FormFieldsets(IJalonConfigGlossaireControlPanel)
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, )
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 form_fields['types_seo_enabled'].custom_widget = type_seo_enabled
def get_types_not_searched(self): # Note: we do not show BAD_TYPES. return [ t for t in self.ttool.listContentTypes() if t not in self.context.types_not_searched and t not in BAD_TYPES ] def set_types_not_searched(self, value): # Note: we add BAD_TYPES to the value list. value = [t for t in self.ttool.listContentTypes() if t not in value or t in BAD_TYPES] self.context._updateProperty("types_not_searched", value) # This also defines the user friendly types types_not_searched = property(get_types_not_searched, set_types_not_searched) searchset = FormFieldsets(IBaseSearchSchema) searchset.id = "search" searchset.label = _("Search settings") 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")