imported>Oetterer K (Schützte „Modul:Classgenerator/parameter/config“: Automatic protection of selected project pages ([Bearbeiten=Nur Administratoren erlauben] (unbeschränkt) [Verschieben=Nur Administratoren erlauben] (unbeschränkt))) |
K (Schützte „Modul:Classgenerator/parameter/config“: Automatic protection of selected project pages ([Bearbeiten=Nur Administratoren erlauben] (unbeschränkt) [Verschieben=Nur Administratoren erlauben] (unbeschränkt))) |
Aktuelle Version vom 6. April 2023, 19:19 Uhr
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module provides data for Module:Classgenerator/parameter/class
Usage[Quelltext bearbeiten]
local cfg = mw.loadData('Module:Classgenerator/parameter/config')
local superglobal = mw.loadData( 'Module:Foundationclass/globalconfig' )
local form = {
enable = true,
name = nil, -- the name of the form
teaserText = 'Please use [[Form:Classgenerator]]!', -- this is the text displayed on the form:name page (before you see the actual form)
typeCreateLink = 'none',
createInfotext = nil,
createInputPlaceholder = nil,
createInputQueryString = nil,
createLinkPageName = nil,
createLinkQueryString = nil,
createLinkType = nil,
labelCreate = 'Add parameter', -- label for create entityh
labelEdit = 'Edit parameter', -- label for edit entity
headerText = 'This is your list of parameters. You put all data here, that you would like to handle - be it data you process normally, data you would only like to gather vai form or data you simply want to store',
notification = 'The order of your parameters here will reflect the order of your form input fields.', -- this notification will be displayed above your form
sectionList = nil,
allowsFreeText = nil,
buttons = {'save', 'preview', 'changes', 'cancel'}, -- which buttons should appera below the form
fieldSize = 80, -- what is the default size= for the form fields
textareaAttributes = { -- the defaults for your textarea fields
rows = 4,
cols = 80,
autogrow = true,
editor = false,
},
fieldOrder = { -- the order in which the form fields appear. NOTE: a parameter not in this list, will not appear in the form!!
-- the order in which the form fields appear. NOTE: a parameter not in this list, will not appear in the form!!
-- YOU HAVE TO FILL THIS TABLE! Put in here all parameters, that are used in the form, even if you have your own sfGenerateForm() implemented using a different table.
-- Reason: This is also be used in plausibility tests
-- form building and template parameter processing (except plausi test) will be performed, using the other tables further down below)
'name',
'cardinality',
'cargo',
'cargo_hidden',
'cargo_size',
'cargo_type',
'description',
'label',
'property',
'property_name',
'property_type',
'severity',
'values',
'sf',
'td_default',
'td_type',
'add_cargo_table_and_field',
'class',
'default',
'hidden',
'input_type',
'placeholder',
'restricted',
'unique',
'unique_for_category',
'unique_for_concept',
'unique_for_namespace',
'uploadable',
'default_filename',
'image_preview',
'autogrow',
'autozoom',
'base_type',
'center',
'cols',
'date_format',
'disable_dates',
'disable_days_of_week',
'disable_input_field',
'editor',
'enable_input_field',
'existing_values_only',
'first_date',
'geoservice',
'height',
'hide_reset_button',
'hide_week_numbers',
'highlight_dates',
'highlight_days_of_week',
'include_timezone',
'last_date',
'mapping_cargo_field',
'mapping_cargo_table',
'mapping_property',
'mapping_template',
'max_values',
'maxlength',
'message',
'regexp',
'rows',
'show_reset_button',
'show_on_select',
'show_week_numbers',
'size',
'structure',
'values_dependent_on',
'values_from_category',
'values_from_concept',
'values_from_namespace',
'week_start',
'width',
'zoom',
},
fieldOrderGeneral = { -- the order in which the form fields appear. This is the first, mostly general part
'name',
'cardinality',
'cargo',
'cargo_type',
'cargo_hidden',
'cargo_size',
'description',
'label',
'property',
'property_name',
'property_type',
'severity',
'sf',
'td_default',
'td_type',
'values',
},
fieldOrderSFgeneral = { -- the order in which the form fields appear. This is the second, semantic forms related part
'input_type',
'default',
'placeholder',
'add_cargo_table_and_field',
'class',
'hidden',
'holds_template',
'restricted',
'unique',
'unique_for_category',
'unique_for_concept',
'unique_for_namespace',
'uploadable',
'default_filename',
'image_preview',
},
fieldOrderSFtypeDependent = {
-- note: there is a bunch of attributes missing from https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs
'autogrow',
'autozoom',
'base_type',
'center',
'cols',
'date_format',
'disable_input_field',
'disable_dates',
'disable_days_of_week',
'editor',
'enable_input_field',
'existing_values_only',
'first_date',
'geoservice',
'height',
'hide_reset_button',
'hide_week_numbers',
'highlight_dates',
'highlight_days_of_week',
'include_timezone',
'last_date',
'mapping_cargo_field',
'mapping_cargo_table',
'mapping_property',
'mapping_template',
'max_values',
'maxlength',
'message',
'regexp',
'rows',
'show_on_select',
'show_reset_button',
'show_week_numbers',
'size',
'structure',
'values_dependent_on',
'values_from_category',
'values_from_concept',
'values_from_namespace',
'week_start',
'width',
'zoom',
},
}
local global = {
cargoTable = nil, -- if you use dataStore cargo, name the table here
cargoUidFieldname = '', -- this is the table-field, the object can use to identiy itself. must be unique!
-- if set to nil or a string which does not point to existing parameter or points to a parameter without a cargo_type, this defaults to _pageName
category = '', -- the mediawiki category, the entity is placed into
delimiter = ',', -- see to it, that the delimiter is not a character, that will be encoded by mw.text.encode. CargoUtil.store encodes the data for security reasons
description = 'This is the list of parameters for the class. All data is represented here, be it data processed normally, data only to gatherd via form or data that is simply stored.',
entityTitle = 'Class parameter', -- generic title for the entity
namespace = '', -- if you put this entity on a special namespace, name it here. NOTE: You have to be precise. This is case sensitive. But omit the colon.
restrictedTo = superglobal.restrictionRole, -- so we want the class only be created by a certain role. Since we can't limit the form to a role, we have to limit all fields to a role. This is that role.
}
local template = {
addCommentsToConfig = false, -- you can add explanatory comments to your autocreated config file. makes it more verbose, but increases size
delimiterResult = '###~~~NEXTPARAMETER~~~###', -- here start a new result
delimiterFormFieldName = '###~~~NOWCOMESTHELUADEFINITION~~~###', -- this seperates fieldname (if it is in form/template) from definitionstring
name = 'Classgenerator/parameter', -- the name of your template. e.g.: your template can be found on the page [[Template:nameOfYourTemplate]]
templateDocumentationSeeAlso = {'Classgenerator'} -- used in the see also-section of your template documentation
}
local parameter = {
-- this is your list of parameters. you put all data here, that you would like to handle
-- * parameters of your form (and thus your template)
-- * when you fill td_type, your parameter will be treated as a template parameter
-- * when you add the parameter name to form.fieldOrder, it will be added to the form
-- * and also data, that you only want to store (omit these from form.fieldOrder and leave the sf table).
-- missing: values_dependent_on, values_from_external data, values_from_url, also some semantic forms inputs
name = {
cardinality = 'single',
description = 'The name of the parameter. Use only upper and lowercase characters, numbers (not the first symbol), dash and underscore.', -- do not use a " or templateDocumentation will fail!
label = 'Parameter',
severity = 'mandatory',
sf = {
input_type = 'regexp',
message = 'Allowed characters are [a-zA-Z_][0-9a-zA-Z_-]+',
placeholder = 'Parameter name',
regexp = '/^[a-zA-Z_][0-9a-zA-Z_-]+$/',
restricted = global.restrictedTo,
},
td_type = 'line',
},
cardinality = { -- prefix _ is necessary or sf disables all but one of the radiobutton options
cardinality = 'single',
description = 'Is this a single or a multivalue field?', -- do not use a " or templateDocumentation will fail!
label = 'Cardinality',
severity = 'mandatory',
sf = {
default = 'single',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_default = 'single',
td_type = 'line',
values = {'single', 'list'},
},
cargo = {
cardinality = 'single',
description = 'Do you want to store this parameter in a cargo field? Works only, if you have a cargo table name specified in the GLOBAL section.', -- do not use a " or templateDocumentation will fail!
label = 'Store in cargo',
severity = 'mandatory',
sf = {
hidden = false,
default = 'Yes',
input_type = 'radiobutton',
restricted = global.restrictedTo,
show_on_select = { Yes = {'cargo_hidden', 'cargo_size', 'cargo_type', 'add_cargo_table_and_field', }}
},
td_default = 'Yes',
td_type = 'boolean',
values = {'Yes', 'No'},
},
cargo_hidden = {
cardinality = 'single',
description = 'If set, the field is not listed in either Special:ViewTable or Special:Drilldown, although it is still queriable.',
label = 'Cargo hidden',
severity = 'suggested',
sf = {
hidden = false,
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
cargo_size = {
cardinality = 'single',
description = 'for fields of type Text, Wikitext or String, sets the size of this field, i.e. the number of characters; default is 300', -- do not use a " or templateDocumentation will fail!
label = 'Cargo size',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 4,
placeholder = 'size of field',
regexp = '/^[0-9]*$/',
restricted = global.restrictedTo,
},
td_type = 'number',
},
cargo_type = {
cardinality = 'single',
description = 'Which type will this parameter be stored in. If you don\t whish to store this parameter, leave this empty.', -- do not use a " or templateDocumentation will fail!
label = 'Cargo field type <small>[https://www.mediawiki.org/wiki/Extension:Cargo/Storing_data#Declaring_a_table [help]]</small>',
severity = 'mandatory',
sf = {
default = 'Text',
hidden = false,
input_type = 'combobox',
placeholder = 'Pick one!',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'Page', 'Text', 'Integer', 'Float', 'Date', 'Datetime', 'Boolean', 'Coordinates', 'Wikitext', 'File', 'String', 'URL', 'Email'},
},
description = {
cardinality = 'single',
description = 'A short description of this paramter. Serves mainly as a hint via tooltip to users of the form to help them fill the parameter.',
label = 'Description',
severity = 'mandatory',
sf = {
input_type = 'textarea',
placeholder = 'Field description for users',
restricted = global.restrictedTo,
},
td_type = 'string',
},
label = {
cardinality = 'single',
description = 'The label for this parameter. Use short but descriptive text (~1-3 words). This will be placed next to the input field in the form.',
label = 'Label',
severity = 'mandatory',
sf = {
input_type = 'text',
placeholder = 'Labeltext',
restricted = global.restrictedTo,
},
td_type = 'line',
},
property = {
cardinality = 'single',
description = 'Do you want to store this parameter semantically? Works only, if you have switched semantic store on in the GLOBAL section.', -- do not use a " or templateDocumentation will fail!
label = 'Store semantically',
severity = 'mandatory',
sf = {
hidden = false,
default = 'Yes',
input_type = 'radiobutton',
restricted = global.restrictedTo,
show_on_select = { Yes = {'property_name', 'property_type'}}
},
td_default = 'Yes',
td_type = 'boolean',
values = {'Yes', 'No'},
},
property_name = {
cardinality = 'single',
description = 'The name of your property this date is stored in - if you are using data store smw that is. NOTE: Do not use spaces, use underscrores (_) instead.', -- do not use a " or templateDocumentation will fail!
label = 'Property name',
severity = 'mandatory',
sf = {
base_type = 'combobox',
input_type = 'regexp',
message = 'Allowed characters are [a-zA-Z][0-9a-zA-Z_ -]+',
placeholder = 'Property name',
regexp = '/^[a-zA-Z][0-9a-zA-Z_ -]*$/',
restricted = global.restrictedTo,
values_from_namespace = 'Attribut',
},
td_type = 'line',
},
property_type = {
cardinality = 'single',
description = 'The type of your property this date is stored in - if you are using data store smw that is.', -- do not use a " or templateDocumentation will fail!
label = 'Property type <small>[https://semantic-mediawiki.org/wiki/Help:List_of_datatypes [help]]</small>',
severity = 'mandatory',
sf = {
default = 'Text',
hidden = false,
input_type = 'combobox',
placeholder = 'Pick one!',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {},
},
severity = { -- prefox _ is necessary or sf disables all but one of the radiobutton options
cardinality = 'single',
description = 'Is this field mandatory, suggested or optional', -- do not use a " or templateDocumentation will fail!
label = 'Severity',
severity = 'mandatory',
sf = {
default = 'suggested',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'mandatory', 'suggested', 'optional'},
},
sf = {
cardinality = 'single',
description = 'Should this field be present (not necessary visible, see #hidden) on the form (and therefore be available as parameter in the template)?',
label = 'Regular form parameter',
severity = 'mandatory',
sf = {
default = 'Yes',
input_type = 'radiobutton',
restricted = global.restrictedTo,
show_on_select = {Yes = {'cardinality', 'severity', 'parameter', 'td_default', 'td_type', 'values'}, No = {'cardinality', 'severity', 'values'}},
},
td_type = 'boolean',
values = {'Yes', 'No', 'Holds template', 'Information'},
},
td_default = {
cardinality = 'single',
description = 'Information only present on the template documentation: to what default value will this be set?', -- do not use a " or templateDocumentation will fail!
label = 'Template doc default',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'Hint: Not used in template execution',
restricted = global.restrictedTo,
},
td_type = 'line',
},
td_type = {
cardinality = 'single',
description = 'What type should be used on the template documentation page?', -- do not use a " or templateDocumentation will fail!
label = 'Template doc parameter type <small>[https://www.mediawiki.org/wiki/Extension:TemplateData#Format [help]]</small>',
severity = 'mandatory',
sf = {
default = 'line',
existing_values_only = true,
input_type = 'combobox',
placeholder = 'Pick one!',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'unknown', 'number', 'string', 'line', 'boolean', 'date', 'wiki-page-name', 'wiki-file-name', 'wiki-user-name', 'content', 'unbalanced-wikitext'},
},
values = {
cardinality = 'list',
description = 'A list of values for this parameter. Depending on SEVERITY and EXISTING VALUES ONLY, the parameter maybe is restricted to this values.',
label = 'List of values',
severity = 'suggested',
sf = {
input_type = 'tokens',
placeholder = 'Predefined values',
restricted = global.restrictedTo,
},
td_type = 'line',
},
-- here we start with the basic sf attributes
-- note on 'cargo_field' and 'cargo_table': these fields will be calculated dynamicall in object initialization, not in form. field will be set to parameter name, and table will be set to cargo table.
-- add them somewhere either way for automatic processing
add_cargo_table_and_field = {
cardinality = 'single',
description = 'Should the \'cargo table=\' and \'cargo field=\' statements be added to this? Fails, if no table is secified in GENERAL-Section!', -- do not use a " or templateDocumentation will fail!
label = 'Add cargo linking',
severity = 'suggested', -- should be mandatory but cannot, sinc it is part of a show_on_select that is not detected automatically
sf = {
hidden = false,
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_default = 'No',
td_type = 'boolean',
values = {'Yes', 'No'},
},
cargo_field = {
cardinality = 'single',
description = 'This is the cargo field, sf attaches to this field. Automatically set to fieldname, if add_cargo_table_and_field is selected', -- do not use a " or templateDocumentation will fail!
label = 'Cargo field',
severity = 'suggested',
},
cargo_table = {
cardinality = 'single',
description = 'This is the cargo table, sf attaches to this field. Automatically set to global table, if add_cargo_table_and_field is selected', -- do not use a " or templateDocumentation will fail!
label = 'Cargo table',
severity = 'suggested',
},
class = {
cardinality = 'single',
description = 'The css class for the input field for this parameter', -- do not use a " or templateDocumentation will fail!
label = 'CSS class',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'CSS Class',
restricted = global.restrictedTo,
},
td_type = 'line',
},
default = {
cardinality = 'single',
description = 'Default value. Preset for this input field.', -- do not use a " or templateDocumentation will fail!
label = 'Default',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'Defaults to this',
restricted = global.restrictedTo,
},
td_type = 'line',
},
hidden = {
cardinality = 'single',
description = 'Specifies that this field will be hidden in the form: used to preserve values in edited pages.', -- do not use a " or templateDocumentation will fail!
label = 'Hidden',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
holds_template = {
cardinality = 'single',
description = 'Specifies that this field will hold the results of another (multiple) template!',
label = 'Holds template',
severity = 'optional',
sf = {
hidden = true, -- value will be filled by myArgumentProcessing depending on the setting of sf
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
input_type = {
cardinality = 'single',
description = 'Specifies the type of input this field will have in the form.', -- do not use a " or templateDocumentation will fail!
label = 'Input type',
severity = 'suggested',
sf = {
existing_values_only = true,
input_type = 'Dropdown',
placeholder = 'Pick one!',
restricted = superglobal.restrictedTo,
show_on_select = {},
},
td_type = 'line',
values = {},-- this will be set to SFfield/config.validInputTypes by class. can't be done here w/o a lua error
},
restricted = {
cardinality = 'single',
description = 'Specifies that this field will be editable only by this user group. Use \'DEFAULT\' if you want this to be the globally defined restriction group.',
label = 'Restricted',
severity = 'optional',
sf = {
input_type = 'combobox',
placeholder = 'User group',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'global.restrictedTo'},
},
unique = {
cardinality = 'single',
description = 'Specifies that the value entered for this field must be unique, i.e. must not be the same as any value for the SMW property (if SMW is being used) or Cargo field ' ..
'(if Cargo is being used) corresponding to this form field.',
label = 'Unique',
severity = 'optional',
sf = {
input_type = 'Radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
unique_for_category = {
cardinality = 'single',
description = 'Specifies that the value entered for this field must not be the same as the name of any page in the given category.',
label = 'Unique for category',
severity = 'optional',
sf = {
input_type = 'combobox',
placeholder = 'Category name',
restricted = global.restrictedTo,
values_from_namespace = 'Category',
},
td_type = 'line',
},
unique_for_concept = {
cardinality = 'single',
description = 'Specifies that the value entered for this field must not be the same as the name of any page in the given SMW concept.',
label = 'Unique for concept',
severity = 'optional',
sf = {
hidden = false, -- true, if no smw datastore
input_type = 'combobox',
placeholder = 'Concept name',
restricted = global.restrictedTo,
values_from_namespace = 'Konzept',
},
td_type = 'line',
},
unique_for_namespace = {
cardinality = 'single',
description = 'Specifies that the value entered for this field must not be the same as the name of any page in the given namespace.',
label = 'Unique for namespace',
severity = 'optional',
sf = {
input_type = 'text',
placeholder = 'Namespace name',
restricted = global.restrictedTo,
},
td_type = 'boolean',
},
uploadable = {
cardinality = 'single',
description = 'Is this a text input field that refers to a file and do you want the user to be able to upload that file right here?', -- do not use a " or templateDocumentation will fail!
label = 'Uploadable',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
show_on_select = {},
},
td_type = 'boolean',
values = {'true', 'false'},
},
default_filename = {
cardinality = 'single',
description = 'Specifies the default filename for files uploaded with this field.', -- do not use a " or templateDocumentation will fail!
label = 'Default filename',
severity = 'optional',
sf = {
input_type = 'text',
placeholder = 'Your filename default',
restricted = global.restrictedTo,
},
td_type = 'line',
},
image_preview = {
cardinality = 'single',
description = 'Specifies that a thumbnail of the uploaded image should be placed under the field in the form.', -- do not use a " or templateDocumentation will fail!
label = 'Image preview',
severity = 'optional',
sf = {
default = 'true',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
-- here comes the type dependent attributes
autogrow = {
cardinality = 'single',
description = 'You can set a default for the autogrow attribute of your textarea fields', -- do not use a " or templateDocumentation will fail!
label = 'textarea autogrow',
severity = 'optional',
sf = {
existing_values_only = true,
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
autozoom = {
cardinality = 'single',
description = 'Turns autozoom feature on or off.',
label = 'Autozoom',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'on', 'off'},
},
base_type = {
cardinality = 'single',
description = 'The base type for this regular expression field', -- do not use a " or templateDocumentation will fail!
label = 'Base type',
severity = 'optional',
sf = {
default = 'text',
input_type = 'dropdown',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {},
},
center = {
cardinality = 'single',
description = 'Allows to set the coordinates of the map\'s centre. When this parameter is not provided, the map will centre itself on the current location, or when not set, to coordinates 0,0.',
label = 'Center',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'Geo coordiantes',
restricted = global.restrictedTo,
},
td_type = 'line',
},
cols = {
cardinality = 'single',
description = 'You can set a default for the columns attribute of your textarea fields', -- do not use a " or templateDocumentation will fail!
label = 'textarea cols',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
placeholder = '#of cols',
regexp = '/^[0-9]*$/',
restricted = global.restrictedTo,
},
td_type = 'number',
},
date_format = {
cardinality = 'single',
description = 'The date format string. It is only used for date display in the input field. See https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs#Parameters for more information.',
label = 'date format',
severity = 'suggested',
sf = {
default = 'dd.mm.yy',
input_type = 'text',
placeholder = 'format',
restricted = global.restrictedTo,
},
td_type = 'line',
},
disable_dates = {
cardinality = 'list',
description = 'Comma-separated list of disabled dates/date ranges (dates in yyyy/mm/dd format, ranges in yyyy/mm/dd-yyyy/mm/dd format)',
label = 'disabled dates',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'yyyy/mm/dd format',
restricted = global.restrictedTo,
},
td_type = 'line',
},
disable_days_of_week = {
cardinality = 'list',
description = 'List of days that can not be selected (e.g. weekend: 6, 0)',
label = 'disabled days of week',
severity = 'suggested',
sf = {
input_type = 'checkboxes',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {0, 1, 2, 3, 4, 5, 6},
},
disable_input_field = {
cardinality = 'single',
description = 'If the user shall be able to fill the input field directly or only via the menu.', -- do not use a " or templateDocumentation will fail!
label = 'Disable input field',
severity = 'optional',
sf = {
default = 'false',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
editor = {
cardinality = 'single',
description = 'You can set a default for the editor attribute of your textarea fields. As of now, semantic forms only supports wikieditor (or none).', -- do not use a " or templateDocumentation will fail!
label = 'textarea editor',
severity = 'optional',
sf = {
input_type = 'text with autocomplete',
placeholder = '\'wikieditor\' or \'none\'',
restricted = global.restrictedTo,
},
td_type = 'line',
},
enable_input_field = {
cardinality = 'single',
description = 'If the user shall be able to fill the input field directly or only via the menu.', -- do not use a " or templateDocumentation will fail!
label = 'Enable input field',
severity = 'optional',
sf = {
default = 'true',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
existing_values_only = {
cardinality = 'single',
description = 'Set a combo box or tokens to only allow the autocomplete values, and not any arbitrary values, thus having it function even more like a dropdown.', -- do not use a " or templateDocumentation will fail!
label = 'Existing values only',
severity = 'optional',
sf = {
default = 'false',
existing_values_only = true,
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
first_date = {
cardinality = 'single',
description = 'The first date that can be chosen (in yyyy/mm/dd format)',
label = 'first date',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'yyyy/mm/dd format',
restricted = global.restrictedTo,
},
td_type = 'line',
},
geoservice = {
cardinality = 'single',
description = 'Allows to set the geocoding service used to turn addresses into coordinates.',
label = 'Geoservice',
severity = 'optional',
sf = {
existing_values_only = true,
input_type = 'combobox',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {'googlemaps', 'googlemaps2', 'yahoomaps'},
},
height = {
cardinality = 'single',
description = 'Allows to set the height of the map, in pixels.',
label = 'Height',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
regexp = '/^[0-9]*$/',
placeholder = 'height in px',
restricted = global.restrictedTo,
},
td_type = 'number',
},
hide_reset_button = {
cardinality = 'single',
description = 'If a reset button shall be shown. This is the only way for the user to erase the input field if it is disabled for direct input.',
label = 'hide reset button',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
hide_week_numbers = {
cardinality = 'single',
description = ' If week numbers shall be shown left of the week.',
label = 'hide week numbers',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
highlight_dates = {
cardinality = 'list',
description = 'Comma-separated list of disabled dates/date ranges that shall appear highlighted (dates in yyyy/mm/dd format, ranges in yyyy/mm/dd-yyyy/mm/dd format)',
label = 'highlighted dates',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'yyyy/mm/dd format',
restricted = global.restrictedTo,
},
td_type = 'line',
},
highlight_days_of_week = {
cardinality = 'list',
description = 'List of days that shall appear highlighted (e.g. weekend: 6, 0)',
label = 'highlighted days of week',
severity = 'suggested',
sf = {
default = '6,0',
input_type = 'checkboxes',
restricted = global.restrictedTo,
},
td_type = 'line',
values = {0, 1, 2, 3, 4, 5, 6},
},
include_timezone = {
cardinality = 'single',
description = 'Specifies that a time zone field should be included.',
label = 'include timezone',
severity = 'optional',
sf = {
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
last_date = {
cardinality = 'single',
description = 'The last date that can be chosen (in yyyy/mm/dd format)',
label = 'last date',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'yyyy/mm/dd format',
restricted = global.restrictedTo,
},
td_type = 'line',
},
mapping_cargo_field = {
cardinality = 'single',
description = 'Tries to map autocomplete values via cargo. Can only be used for fields that select pages. You have to specifiy CARGO_TABLE for this to work, as well!',
label = 'Mapping cargo field',
severity = 'optional',
sf = {
hidden = false,
input_type = 'text',
placeholder = 'map via cargo table',
restricted = global.restrictedTo,
},
td_type = 'line',
},
mapping_cargo_table = {
cardinality = 'single',
description = 'Tries to map autocomplete values via cargo. Can only be used for fields that select pages. You have to specifiy CARGO_FIELD for this to work, as well!',
label = 'Mapping cargo table',
severity = 'optional',
sf = {
hidden = false,
input_type = 'text',
placeholder = 'map via cargo table',
restricted = global.restrictedTo,
},
td_type = 'line',
},
mapping_property = {
cardinality = 'single',
description = 'Tries to map autocomplete values via smw. Can only be used for fields that select pages.',
label = 'Mapping property',
severity = 'optional',
sf = {
base_type = 'combobox',
hidden = false,
input_type = 'regexp',
message = 'Allowed characters are [a-zA-Z_][0-9a-zA-Z_ -]+',
placeholder = 'map via property',
regexp = '/^[a-zA-Z_][0-9a-zA-Z_ -]*$/',
restricted = global.restrictedTo,
values_from_namespace = 'Attribut',
},
td_type = 'line',
},
mapping_template = {
cardinality = 'single',
description = 'Takes in the name of a \'mapping template\' (a template that takes in a single, unnamed parameter, i.e. {{{1|}}}, and displays a \'mapped\' string as a result), ' ..
'and uses that template to map every potential value, so that the values\' \'aliases\' appear on the screen, and not the values themselves. Takes only the name of the template w/o namespace.',
label = 'Mapping template',
severity = 'optional',
sf = {
input_type = 'combobox',
placeholder = 'template name',
restricted = global.restrictedTo,
values_from_namespace = 'Template',
},
td_type = 'line',
},
max_values = {
cardinality = 'single',
description = 'Used for input type tokens; specifies the maximum number of values that can be entered in a field that holds multiple values.', -- do not use a " or templateDocumentation will fail!
label = 'Max values',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
placeholder = 'max # of values',
regexp = '/^[0-9]*$/',
restricted = global.restrictedTo,
},
td_type = 'number',
},
maxlength = {
cardinality = 'single',
description = 'Used for text and textarea fields. Specifies the maximum allowed length of the input.', -- do not use a " or templateDocumentation will fail!
label = 'Maxlength',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
placeholder = 'Maximum length',
regexp = '/^[0-9]*$/',
restricted = global.restrictedTo,
},
td_type = 'number',
},
message = {
cardinality = 'single',
description = 'Used as user feedback message in case the regex did not match with the input.', -- do not use a " or templateDocumentation will fail!
label = 'Message',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'Feedback message',
restricted = global.restrictedTo,
},
td_type = 'line',
},
placeholder = {
cardinality = 'single',
description = 'Used for the text, textarea, combobox and tokens fields. Specifies help text that is displayed in the input until the user clicks on it.', -- do not use a " or templateDocumentation will fail!
label = 'Placeholder',
severity = 'suggested',
sf = {
input_type = 'text',
placeholder = 'Placeholder(placeholder)',
restricted = global.restrictedTo,
},
td_type = 'line',
},
regexp = {
cardinality = 'single',
description = 'If you set \'input type\' to regexp, this specifies your regular expression the input has to match to be valid. ' ..
'This must be given including the slashes, e.g. \'/^[0-9]+/\'! Defaults to /.*/, i.e. any value.',
label = 'Regexp',
severity = 'mandatory',
sf = {
default = '^[0-9]+$',
input_type = 'text',
placeholder = 'Regular expression',
restricted = global.restrictedTo,
},
td_type = 'line',
},
rows = {
cardinality = 'single',
description = 'You can set a default for the rows attribute of your textarea fields', -- do not use a " or templateDocumentation will fail!
label = 'textarea rows',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 2,
placeholder = '#of rows',
regexp = '/^[0-9]*$/',
restricted = global.restrictedTo,
},
td_type = 'number',
},
size = {
cardinality = 'single',
description = 'Used for text entries, combobox, tokens and listbox. For the first three it specifies the width, in characters; for a listbox it specifies the height. If not set, will be defaulted as set in FORM-Section.',
label = 'Size',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
regexp = '/^[0-9]*$/',
placeholder = 'Maximum size',
restricted = global.restrictedTo,
},
td_type = 'number',
},
show_on_select = {
cardinality = 'list',
description = 'Can be used for inputs of type \'checkbox\', \'checkboxes\', \'radiobutton\', \'dropdown\' and \'listbox\' to specify that one or more tags ' ..
'with a certain ID should only be displayed to the user if a certain value (or values) is selected within that input. Use entries in the form \'value=field\'. ' ..
'Hint: If you want to calculate this dynamically later, set this field to \'false\'! ' ..
'All fields will be prefixed by a globaly configured prefix string. See Module:SFfield/class for more information.',
label = 'Show on select',
severity = 'optional',
sf = {
input_type = 'tokens',
placeholder = 'value = fieldname',
restricted = global.restrictedTo,
},
td_type = 'string',
},
show_reset_button = {
cardinality = 'single',
description = 'If a reset button shall be shown. This is the only way for the user to erase the input field if it is disabled for direct input.',
label = 'show reset button',
severity = 'optional',
sf = {
default = 'true',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
show_week_numbers = {
cardinality = 'single',
description = ' If week numbers shall be shown left of the week.',
label = 'show week numbers',
severity = 'optional',
sf = {
default = 'true',
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'boolean',
values = {'true', 'false'},
},
structure = {
cardinality = 'single',
description = 'The structure of your menu. Please use mediawiki ul notation. * for first lavel, ** for second, ... One entry per line', -- do not use a " or templateDocumentation will fail!
label = 'Structure',
severity = 'mandatory',
sf = {
input_type = 'textarea',
placeholder = 'build an unordered list to represent your structure',
restricted = global.restrictedTo,
rows = 7,
},
td_type = 'string',
},
values_dependent_on = {
cardinality = 'single',
description = 'Can be used for inputs of type \'combobox\', \'text with autocomplete\', \'textarea with autocomplete\' and \'tokens\'. Specifies that the ' ..
'current set of allowed values for this field are all the values taken by this same field from pages where \'field name\' is equal to the value selected for \'field name\' in the current form.',
label = 'Values dependent on',
severity = 'optional',
sf = {
input_type = 'text',
placeholder = 'template name[field name]',
restricted = global.restrictedTo,
},
td_type = 'line',
},
values_from_category = {
cardinality = 'single',
description = 'Similar to values=, but gets its values from the names of all pages belonging to a specific category.', -- do not use a " or templateDocumentation will fail!
label = 'Values from category',
severity = 'optional',
sf = {
input_type = 'combobox',
placeholder = 'Category name',
restricted = global.restrictedTo,
values_from_namespace = 'Category',
},
td_type = 'line',
},
values_from_concept = {
cardinality = 'single',
description = 'Similar to values=, but gets its values from the names of all pages belonging to a specific SMW concept.', -- do not use a " or templateDocumentation will fail!
label = 'Values from concept',
severity = 'optional',
sf = {
hidden = false,
input_type = 'combobox',
placeholder = 'Concept name',
restricted = global.restrictedTo,
values_from_namespace = 'Konzept',
},
td_type = 'line',
},
values_from_namespace = {
cardinality = 'single',
description = 'Similar to values=, but gets its values from the names of all pages belonging to a specific namespace.', -- do not use a " or templateDocumentation will fail!
label = 'Values from namespace',
severity = 'optional',
sf = {
input_type = 'text',
placeholder = 'Namespace name',
restricted = global.restrictedTo,
},
td_type = 'line',
},
week_start = {
cardinality = 'single',
description = 'The first day of the week (0 - Sunday, 1 - Monday, ...)',
label = 'Week start',
severity = 'optional',
sf = {
default = 1,
input_type = 'radiobutton',
restricted = global.restrictedTo,
},
td_type = 'number',
values = {0, 1, 2, 3, 4, 5, 6},
},
width = {
cardinality = 'single',
description = 'Allows to set the width of the map, in pixels.',
label = 'Width',
severity = 'optional',
sf = {
input_type = 'regexp',
maxlength = 3,
regexp = '/^[0-9]*$/',
placeholder = 'width in px',
restricted = global.restrictedTo,
},
td_type = 'number',
},
zoom = {
cardinality = 'single',
description = 'Allows to set the zoom level of the map. When not provided , the zoom will be set so you can see the entire planet.',
label = 'Zoom',
severity = 'optional',
sf = {
default = 10,
input_type = 'regexp',
maxlength = 3,
regexp = '/^[0-9]*$/',
placeholder = '0-20',
restricted = global.restrictedTo,
},
td_type = 'number',
},
}
parameter.sf.sf.show_on_select['Holds template'] = {'cardinality', 'severity', 'td_default', 'td_type', 'values'}
return {
form = form,
global = global,
parameter = parameter,
template = template,
}