本文整理汇总了Golang中github.com/corestoreio/csfw/config/element.NewFieldSlice函数的典型用法代码示例。如果您正苦于以下问题:Golang NewFieldSlice函数的具体用法?Golang NewFieldSlice怎么用?Golang NewFieldSlice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewFieldSlice函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "payment",
Groups: element.NewGroupSlice(
&element.Group{
ID: "vault",
Label: `Vault Provider`,
SortOrder: 2,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Fields: element.NewFieldSlice(
&element.Field{
// Path: payment/vault/vault_payment
ID: "vault_payment",
Label: `Vault Provider`,
Comment: element.LongText(`Specified provider should be enabled.`),
Type: element.TypeSelect,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
// SourceModel: Otnegam\Vault\Model\Adminhtml\Source\VaultProvidersMap
},
),
},
),
},
// Hidden Configuration, may be visible somewhere else ...
&element.Section{
ID: "payment",
Groups: element.NewGroupSlice(
&element.Group{
ID: "vault",
Fields: element.NewFieldSlice(
&element.Field{
// Path: payment/vault/debug
ID: `debug`,
Type: element.TypeHidden,
Visible: element.VisibleNo,
Default: true,
},
&element.Field{
// Path: payment/vault/model
ID: `model`,
Type: element.TypeHidden,
Visible: element.VisibleNo,
Default: `Otnegam\Vault\Model\VaultPaymentInterface`,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:55,代码来源:config_vault.go
示例2: TestScopeApplyDefaults
func TestScopeApplyDefaults(t *testing.T) {
defer debugLogBuf.Reset()
defer infoLogBuf.Reset()
pkgCfg := element.MustNewConfiguration(
&element.Section{
ID: "contact",
Groups: element.NewGroupSlice(
&element.Group{
ID: "contact",
Fields: element.NewFieldSlice(
&element.Field{
// Path: `contact/contact/enabled`,
ID: "enabled",
Default: true,
},
),
},
&element.Group{
ID: "email",
Fields: element.NewFieldSlice(
&element.Field{
// Path: `contact/email/recipient_email`,
ID: "recipient_email",
Default: `[email protected]`,
},
&element.Field{
// Path: `contact/email/sender_email_identity`,
ID: "sender_email_identity",
Default: 2.7182818284590452353602874713527,
},
&element.Field{
// Path: `contact/email/email_template`,
ID: "email_template",
Default: 4711,
},
),
},
),
},
)
s := config.NewService()
s.ApplyDefaults(pkgCfg)
cer, err := pkgCfg.FindFieldByPath("contact", "email", "recipient_email")
if err != nil {
t.Error(err)
return
}
sval, err := s.String(config.Path("contact/email/recipient_email"))
assert.NoError(t, err)
assert.Exactly(t, cer.Default.(string), sval)
assert.NoError(t, s.Close())
}
开发者ID:joao-parana,项目名称:csfw,代码行数:53,代码来源:service_test.go
示例3: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
SortOrder: 40,
Scope: scope.PermAll,
Groups: element.NewGroupSlice(
&element.Group{
ID: "frontend",
SortOrder: 100,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/frontend/swatches_per_product
ID: "swatches_per_product",
Label: `Swatches per Product`,
Type: element.TypeText,
SortOrder: 300,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: 16,
},
),
},
),
},
// Hidden Configuration, may be visible somewhere else ...
&element.Section{
ID: "general",
Groups: element.NewGroupSlice(
&element.Group{
ID: "validator_data",
Fields: element.NewFieldSlice(
&element.Field{
// Path: general/validator_data/input_types
ID: `input_types`,
Type: element.TypeHidden,
Visible: element.VisibleNo,
Default: `{"swatch_visual":"swatch_visual","swatch_text":"swatch_text"}`,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:48,代码来源:config_swatches.go
示例4: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
Groups: element.NewGroupSlice(
&element.Group{
ID: "search",
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/search/engine
ID: "engine",
Label: `Search Engine`,
Type: element.TypeSelect,
SortOrder: 19,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
// SourceModel: Otnegam\Search\Model\Adminhtml\System\Config\Source\Engine
},
&element.Field{
// Path: catalog/search/search_type
ID: "search_type",
Type: element.Type,
Visible: element.VisibleYes,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:32,代码来源:config_search.go
示例5: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "checkout",
Groups: element.NewGroupSlice(
&element.Group{
ID: "cart",
Fields: element.NewFieldSlice(
&element.Field{
// Path: checkout/cart/configurable_product_image
ID: "configurable_product_image",
Label: `Configurable Product Image`,
Type: element.TypeSelect,
SortOrder: 4,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `parent`,
// SourceModel: Otnegam\Catalog\Model\Config\Source\Product\Thumbnail
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:26,代码来源:config_configurableproduct.go
示例6: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "webapi",
Label: `Otnegam Web API`,
SortOrder: 102,
Scope: scope.PermAll,
Resource: 0, // Otnegam_Webapi::config_webapi
Groups: element.NewGroupSlice(
&element.Group{
ID: "soap",
Label: `SOAP Settings`,
SortOrder: 1,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: webapi/soap/charset
ID: "charset",
Label: `Default Response Charset`,
Comment: element.LongText(`If empty, UTF-8 will be used.`),
Type: element.TypeText,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.PermAll,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:32,代码来源:config_webapi.go
示例7: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
Groups: element.NewGroupSlice(
&element.Group{
ID: "review",
Label: `Product Reviews`,
SortOrder: 100,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/review/allow_guest
ID: "allow_guest",
Label: `Allow Guests to Write Reviews`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: true,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:29,代码来源:config_review.go
示例8: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "checkout",
Groups: element.NewGroupSlice(
&element.Group{
ID: "options",
Fields: element.NewFieldSlice(
&element.Field{
// Path: checkout/options/enable_agreements
ID: "enable_agreements",
Label: `Enable Terms and Conditions`,
Type: element.TypeSelect,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.PermAll,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:25,代码来源:config_checkoutagreements.go
示例9: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "rss",
Label: `RSS Feeds`,
SortOrder: 80,
Scope: scope.PermAll,
Resource: 0, // Otnegam_Rss::rss
Groups: element.NewGroupSlice(
&element.Group{
ID: "config",
Label: `Rss Config`,
SortOrder: 1,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: rss/config/active
ID: "active",
Label: `Enable RSS`,
Type: element.TypeSelect,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.PermAll,
// BackendModel: Otnegam\Rss\Model\System\Config\Backend\Links
// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:33,代码来源:config_rss.go
示例10: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "google",
Groups: element.NewGroupSlice(
&element.Group{
ID: "analytics",
Fields: element.NewFieldSlice(
&element.Field{
// Path: google/analytics/experiments
ID: "experiments",
Label: `Enable Content Experiments`,
Type: element.TypeSelect,
SortOrder: 30,
Visible: element.VisibleYes,
Scope: scope.PermAll,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
),
},
),
},
// Hidden Configuration, may be visible somewhere else ...
&element.Section{
ID: "google",
Groups: element.NewGroupSlice(
&element.Group{
ID: "optimizer",
Fields: element.NewFieldSlice(
&element.Field{
// Path: google/optimizer/active
ID: `active`,
Type: element.TypeHidden,
Visible: element.VisibleNo,
Default: false,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:44,代码来源:config_googleoptimizer.go
示例11: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "system",
Groups: element.NewGroupSlice(
&element.Group{
ID: "cron",
Label: `Cron (Scheduled Tasks) - all the times are in minutes`,
Comment: element.LongText(`For correct URLs generated during cron runs please make sure that Web > Secure and Unsecure Base URLs are explicitly set.`),
SortOrder: 15,
Scope: scope.NewPerm(scope.DefaultID),
Fields: element.NewFieldSlice(),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:18,代码来源:config_cron.go
示例12: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "multishipping",
Label: `Multishipping Settings`,
SortOrder: 311,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Resource: 0, // Otnegam_Multishipping::config_multishipping
Groups: element.NewGroupSlice(
&element.Group{
ID: "options",
Label: `Options`,
SortOrder: 2,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Fields: element.NewFieldSlice(
&element.Field{
// Path: multishipping/options/checkout_multiple
ID: "checkout_multiple",
Label: `Allow Shipping to Multiple Addresses`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: true,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: multishipping/options/checkout_multiple_maximum_qty
ID: "checkout_multiple_maximum_qty",
Label: `Maximum Qty Allowed for Shipping to Multiple Addresses`,
Type: element.TypeText,
SortOrder: 2,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: 100,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:44,代码来源:config_multishipping.go
示例13: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "google",
Label: `Google API`,
SortOrder: 340,
Scope: scope.PermAll,
Resource: 0, // Otnegam_GoogleAnalytics::google
Groups: element.NewGroupSlice(
&element.Group{
ID: "analytics",
Label: `Google Analytics`,
SortOrder: 10,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: google/analytics/active
ID: "active",
Label: `Enable`,
Type: element.TypeSelect,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.PermAll,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: google/analytics/account
ID: "account",
Label: `Account Number`,
Type: element.TypeText,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.PermAll,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:42,代码来源:config_googleanalytics.go
示例14: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "dev",
Groups: element.NewGroupSlice(
&element.Group{
ID: "js",
Fields: element.NewFieldSlice(
&element.Field{
// Path: dev/js/session_storage_logging
ID: "session_storage_logging",
Label: `Log JS Errors to Session Storage`,
Comment: element.LongText(`If enabled, can be used by functional tests for extended reporting`),
Type: element.TypeSelect,
SortOrder: 100,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: false,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: dev/js/session_storage_key
ID: "session_storage_key",
Label: `Log JS Errors to Session Storage Key`,
Comment: element.LongText(`Use this key to retrieve collected js errors`),
Type: element.TypeText,
SortOrder: 110,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: `collected_errors`,
},
),
},
),
},
)
Backend = NewBackend(ConfigStructure)
}
开发者ID:joao-parana,项目名称:csfw,代码行数:39,代码来源:config_ui.go
示例15: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "tax",
Label: `Tax`,
SortOrder: 303,
Scope: scope.PermAll,
Resource: 0, // Otnegam_Tax::config_tax
Groups: element.NewGroupSlice(
&element.Group{
ID: "classes",
Label: `Tax Classes`,
SortOrder: 10,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: tax/classes/shipping_tax_class
ID: "shipping_tax_class",
Label: `Tax Class for Shipping`,
Type: element.TypeSelect,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: false,
// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Product
},
&element.Field{
// Path: tax/classes/default_product_tax_class
ID: "default_product_tax_class",
Label: `Default Tax Class for Product`,
Type: element.TypeSelect,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: 2,
// BackendModel: Otnegam\Tax\Model\Config\TaxClass
// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Product
},
&element.Field{
// Path: tax/classes/default_customer_tax_class
ID: "default_customer_tax_class",
Label: `Default Tax Class for Customer`,
Type: element.TypeSelect,
SortOrder: 30,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: 3,
// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Customer
},
),
},
&element.Group{
ID: "calculation",
Label: `Calculation Settings`,
SortOrder: 20,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: tax/calculation/algorithm
ID: "algorithm",
Label: `Tax Calculation Method Based On`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: `TOTAL_BASE_CALCULATION`,
// SourceModel: Otnegam\Tax\Model\System\Config\Source\Algorithm
},
&element.Field{
// Path: tax/calculation/based_on
ID: "based_on",
Label: `Tax Calculation Based On`,
Type: element.TypeSelect,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: `shipping`,
// BackendModel: Otnegam\Tax\Model\Config\Notification
// SourceModel: Otnegam\Tax\Model\Config\Source\Basedon
},
&element.Field{
// Path: tax/calculation/price_includes_tax
ID: "price_includes_tax",
Label: `Catalog Prices`,
Comment: element.LongText(`This sets whether catalog prices entered from Otnegam Admin include tax.`),
Type: element.TypeSelect,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: false,
// BackendModel: Otnegam\Tax\Model\Config\Price\IncludePrice
// SourceModel: Otnegam\Tax\Model\System\Config\Source\PriceType
},
&element.Field{
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:config_tax.go
示例16: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "design",
Groups: element.NewGroupSlice(
&element.Group{
ID: "email",
Label: `Emails`,
SortOrder: 510,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: design/email/logo
ID: "logo",
Label: `Logo Image`,
Comment: element.LongText(`Allowed file types: jpg, jpeg, gif, png. To optimize logo for high-resolution displays, upload an image that is 3x normal size and then specify 1x dimensions in width/height fields below.`),
Type: element.TypeImage,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.PermAll,
// BackendModel: Otnegam\Config\Model\Config\Backend\Email\Logo
},
&element.Field{
// Path: design/email/logo_alt
ID: "logo_alt",
Label: `Logo Image Alt`,
Type: element.TypeText,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.PermAll,
},
&element.Field{
// Path: design/email/logo_width
ID: "logo_width",
Label: `Logo Width`,
Comment: element.LongText(`Only necessary if image has been uploaded above. Enter number of pixels, without appending "px".`),
Type: element.TypeText,
SortOrder: 30,
Visible: element.VisibleYes,
Scope: scope.PermAll,
},
&element.Field{
// Path: design/email/logo_height
ID: "logo_height",
Label: `Logo Height`,
Comment: element.LongText(`Only necessary if image has been uploaded above. Enter number of pixels, without appending "px".`),
Type: element.TypeText,
SortOrder: 40,
Visible: element.VisibleYes,
Scope: scope.PermAll,
},
&element.Field{
// Path: design/email/header_template
ID: "header_template",
Label: `Header Template`,
Comment: element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
Type: element.TypeSelect,
SortOrder: 50,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `design_email_header_template`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
},
&element.Field{
// Path: design/email/footer_template
ID: "footer_template",
Label: `Footer Template`,
Comment: element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
Type: element.TypeSelect,
SortOrder: 60,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `design_email_footer_template`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
},
),
},
),
},
// Hidden Configuration, may be visible somewhere else ...
&element.Section{
ID: "system",
Groups: element.NewGroupSlice(
&element.Group{
ID: "media_storage_configuration",
Fields: element.NewFieldSlice(
&element.Field{
// Path: system/media_storage_configuration/allowed_resources
ID: `allowed_resources`,
Type: element.TypeHidden,
Visible: element.VisibleNo,
Default: `{"email_folder":"email"}`,
},
),
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:config_email.go
示例17: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
Groups: element.NewGroupSlice(
&element.Group{
ID: "productalert",
Label: `Product Alerts`,
SortOrder: 250,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/productalert/allow_price
ID: "allow_price",
Label: `Allow Alert When Product Price Changes`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: false,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: catalog/productalert/allow_stock
ID: "allow_stock",
Label: `Allow Alert When Product Comes Back in Stock`,
Type: element.TypeSelect,
SortOrder: 3,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: false,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: catalog/productalert/email_price_template
ID: "email_price_template",
Label: `Price Alert Email Template`,
Comment: element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
Type: element.TypeSelect,
SortOrder: 2,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `catalog_productalert_email_price_template`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
},
&element.Field{
// Path: catalog/productalert/email_stock_template
ID: "email_stock_template",
Label: `Stock Alert Email Template`,
Comment: element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
Type: element.TypeSelect,
SortOrder: 4,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `catalog_productalert_email_stock_template`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
},
&element.Field{
// Path: catalog/productalert/email_identity
ID: "email_identity",
Label: `Alert Email Sender`,
Type: element.TypeSelect,
SortOrder: 5,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `general`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
},
),
},
&element.Group{
ID: "productalert_cron",
Label: `Product Alerts Run Settings`,
SortOrder: 260,
Scope: scope.NewPerm(scope.DefaultID),
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/productalert_cron/frequency
ID: "frequency",
Label: `Frequency`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
// BackendModel: Otnegam\Cron\Model\Config\Backend\Product\Alert
// SourceModel: Otnegam\Cron\Model\Config\Source\Frequency
},
&element.Field{
// Path: catalog/productalert_cron/time
ID: "time",
Label: `Start Time`,
Type: element.TypeTime,
SortOrder: 2,
Visible: element.VisibleYes,
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:config_productalert.go
示例18: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
Label: `Catalog`,
SortOrder: 40,
Scope: scope.PermAll,
Resource: 0, // Otnegam_Catalog::config_catalog
Groups: element.NewGroupSlice(
&element.Group{
ID: "fields_masks",
Label: `Product Fields Auto-Generation`,
SortOrder: 90,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/fields_masks/sku
ID: "sku",
Label: `Mask for SKU`,
Comment: element.LongText(`Use {{name}} as Product Name placeholder`),
Type: element.TypeText,
SortOrder: 10,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: `{{name}}`,
},
&element.Field{
// Path: catalog/fields_masks/meta_title
ID: "meta_title",
Label: `Mask for Meta Title`,
Comment: element.LongText(`Use {{name}} as Product Name placeholder`),
Type: element.TypeText,
SortOrder: 20,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: `{{name}}`,
},
&element.Field{
// Path: catalog/fields_masks/meta_keyword
ID: "meta_keyword",
Label: `Mask for Meta Keywords`,
Comment: element.LongText(`Use {{name}} as Product Name or {{sku}} as Product SKU placeholders`),
Type: element.TypeText,
SortOrder: 30,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: `{{name}}`,
},
&element.Field{
// Path: catalog/fields_masks/meta_description
ID: "meta_description",
Label: `Mask for Meta Description`,
Comment: element.LongText(`Use {{name}} and {{description}} as Product Name and Product Description placeholders`),
Type: element.TypeText,
SortOrder: 40,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID),
Default: `{{name}} {{description}}`,
},
),
},
&element.Group{
ID: "frontend",
Label: `Storefront`,
SortOrder: 100,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/frontend/list_mode
ID: "list_mode",
Label: `List Mode`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `grid-list`,
// SourceModel: Otnegam\Catalog\Model\Config\Source\ListMode
},
&element.Field{
// Path: catalog/frontend/grid_per_page_values
ID: "grid_per_page_values",
Label: `Products per Page on Grid Allowed Values`,
Comment: element.LongText(`Comma-separated.`),
Type: element.TypeText,
SortOrder: 2,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `9,15,30`,
},
&element.Field{
// Path: catalog/frontend/grid_per_page
ID: "grid_per_page",
Label: `Products per Page on Grid Default Value`,
Comment: element.LongText(`Must be in the allowed values list`),
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:structure.go
示例19: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "catalog",
Groups: element.NewGroupSlice(
&element.Group{
ID: "downloadable",
Label: `Downloadable Product Options`,
SortOrder: 600,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: catalog/downloadable/order_item_status
ID: "order_item_status",
Label: `Order Item Status to Enable Downloads`,
Type: element.TypeSelect,
SortOrder: 100,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: 9,
// SourceModel: Otnegam\Downloadable\Model\System\Config\Source\Orderitemstatus
},
&element.Field{
// Path: catalog/downloadable/downloads_number
ID: "downloads_number",
Label: `Default Maximum Number of Downloads`,
Type: element.TypeText,
SortOrder: 200,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
},
&element.Field{
// Path: catalog/downloadable/shareable
ID: "shareable",
Label: `Shareable`,
Type: element.TypeSelect,
SortOrder: 300,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: catalog/downloadable/samples_title
ID: "samples_title",
Label: `Default Sample Title`,
Type: element.TypeText,
SortOrder: 400,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `Samples`,
},
&element.Field{
// Path: catalog/downloadable/links_title
ID: "links_title",
Label: `Default Link Title`,
Type: element.TypeText,
SortOrder: 500,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `Links`,
},
&element.Field{
// Path: catalog/downloadable/links_target_new_window
ID: "links_target_new_window",
Label: `Open Links in New Window`,
Type: element.TypeSelect,
SortOrder: 600,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: true,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
&element.Field{
// Path: catalog/downloadable/content_disposition
ID: "content_disposition",
Label: `Use Content-Disposition`,
Type: element.TypeSelect,
SortOrder: 700,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `inline`,
// SourceModel: Otnegam\Downloadable\Model\System\Config\Source\Contentdisposition
},
&element.Field{
// Path: catalog/downloadable/disable_guest_checkout
ID: "disable_guest_checkout",
Label: `Disable Guest Checkout if Cart Contains Downloadable Items`,
Comment: element.LongText(`Guest checkout will only work with shareable.`),
Type: element.TypeSelect,
SortOrder: 800,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Default: true,
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:config_downloadable.go
示例20: init
func init() {
ConfigStructure = element.MustNewConfiguration(
&element.Section{
ID: "wishlist",
Label: `Wish List`,
SortOrder: 140,
Scope: scope.PermAll,
Resource: 0, // Otnegam_Wishlist::config_wishlist
Groups: element.NewGroupSlice(
&element.Group{
ID: "email",
Label: `Share Options`,
SortOrder: 2,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: wishlist/email/email_identity
ID: "email_identity",
Label: `Email Sender`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `general`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
},
&element.Field{
// Path: wishlist/email/email_template
ID: "email_template",
Label: `Email Template`,
Comment: element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: `wishlist_email_email_template`,
// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
},
&element.Field{
// Path: wishlist/email/number_limit
ID: "number_limit",
Label: `Max Emails Allowed to be Sent`,
Comment: element.LongText(`10 by default. Max - 10000`),
Type: element.TypeText,
SortOrder: 3,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: 10,
},
&element.Field{
// Path: wishlist/email/text_limit
ID: "text_limit",
Label: `Email Text Length Limit`,
Comment: element.LongText(`255 by default`),
Type: element.TypeText,
SortOrder: 4,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: 255,
},
),
},
&element.Group{
ID: "general",
Label: `General Options`,
SortOrder: 1,
Scope: scope.PermAll,
Fields: element.NewFieldSlice(
&element.Field{
// Path: wishlist/general/active
ID: "active",
Label: `Enabled`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.PermAll,
Default: true,
// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
},
),
},
&element.Group{
ID: "wishlist_link",
Label: `My Wish List Link`,
SortOrder: 3,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Fields: element.NewFieldSlice(
&element.Field{
// Path: wishlist/wishlist_link/use_qty
ID: "use_qty",
Label: `Display Wish List Summary`,
Type: element.TypeSelect,
SortOrder: 1,
Visible: element.VisibleYes,
Scope: scope.NewPerm(scope.DefaultID, scope.WebsiteID),
//.........这里部分代码省略.........
开发者ID:joao-parana,项目名称:csfw,代码行数:101,代码来源:config_wishlist.go
|
请发表评论