Ajuda:Global infobox tools/en

De la Viquipèdia, l'enciclopèdia lliure

Mòdul:Global infobox tools

Used items

For functions are included:

  • T (type). The possible types are:
    • s or string
    • t or table
    • i or integer number
    • b or boolean
    • a o any value
  • R (required)


Special parameters in below description are:

  • frame: The standard frame to hook the template parameters.
  • args: The usual parameters sent from the immediate template (arguments).
  • pargs: The usual parameters sent from the mediate template (parent arguments).
  • ModuleName: The name of infobox module from this function is called. Used for more accurate error messages made by infobox administrator when the modules are modified, or created as new module.
item Parameters T R
T UsualListOpt The usual lists

list, with reserved words variables, parameters and labels

params, enables parameter names with its restrictions

template, TemplateData code

labels,

Color functions
F _GetInfoboxColor grp_color_key s X It returns a strong (n=1) or light (n=2) color of a grp_color_key
n i X
F GetInfoboxColor frame Idem previous function but from a template or page
F DisplayTitleColors It shows a table with all color pairs used in Catalan WP infoboxes
Icon functions
F _GetIcon icon_key s X It returns a icon name from icon_key
F GetIcon frame Idem previous function but from a template or page
F DisplayTitleIcons frame It shows a table with all icons used in Catalan WP infoboxes
General functions
F SetRsv_1ToArgs ModuleName Set values to reserved keys, from the immediate template (args)
  • rs: reserved keys of all infoboxes and their modified values
    • rs_main:
    • rs_i18n:
  • rss: reserved keys of the specific infobox and their modified values
    • rss_main:
    • rs_i18n:
frame
args
rs_main t X
rs_i18n t X
cat_list t
rss_main t
rss_i18n t
tab_lims t
F SetRsv_2ToArgs ModuleName Set values to reserved keys, from the immediate template (args) and mediate template (pargs).
frame
pargs t X
args
rs_main t X
rs_i18n t X
cat_list t
rss_main t
rss_i18n t
tab_lims t
F CollapsibleText S s X
MaxLength i X
F TitCollapsibleText frame
F CheckArgLab ModuleName It checks:
  • the standard tables (tab_main, tab_i18n; and, in lua, custom new items)
  • omit_params and preset_params

It deletes the items according to the content of the table omit_params

tab_main t X
tab_i18n t X
omit_params t
preset_params t
F CheckArgLabLua ModuleName
tab_main t X
tab_i18n t X
tab_i18n_new t
omit_params t
preset_params t
F CheckIdx_arglab ModuleName It checks index idx where each item must content a type and a key i.g. {'al',p.k.name}

Deletes from idx the keys contained in omit_params

idx t X
omit_params t
for_lua b
F CheckIdx_arglabLua ModuleName
idx t X
new_idx t
F GetInfotablePos It returns the number for header, label or data in the infobox.

I.e. if N = 3 then assign values in label3 and data3

F ArgNameForDemo tab t X
key s X
Image functions
F i_LoadI18n
F i_main frame
args
General functions
F add_arglab_item mod_abbrev s X
key s X
tab_main t X
tab_lang t X
lims t
F add_arglab_item_grp mod_abbrev s X
grp s X
key s X
tab_main t X
tab_lang t X
lims t
F CheckFuncs funcs It checks function local_func of i18n
F SetColorsAndIcon ModuleName It set values to usual reserved variables: colors and icon
color_gr s X
icon_key s X
F CheckLims ModuleName
tab t X
F Checki18nLims ModuleName
tab t X
V w_hint_txt true
V arg_suffix_equal '=...
F label_of_key_w_hint_txt args A text label with its key (with lbl_). The text label contains a hint text if its key is not in table of lab_no_ruby.

The text label is a preset label or a customized label for an article using l_ as prefix for argument.

tab t X
key s X
lab_no_ruby t
F label_of_key_w_hint_txts args
tab t X
key t X
keys a X
F ItemList_or_TempData ModuleAbbrev s X Returns
  • item list or TemplateData code according to |list=UsualListOpt, or
  • nothing, if |list= is not set
ModuleName
tab_main t X
tab_lang t X
idx t X
lims t
other_arglab t
other_arg t
other_lab t
Lua functions
F IniLua args
tab t X
F AddLocalAdminItems tab_main t X
tab_i18n_new t X
F CheckAddLocalAdminLims ModuleName
main t X
new t
F load_key args It reads the preset values (in demo mode) or the values entered manually or read from WD, as appropriate.

and returns the found or set value

tab t X
key s X
lims t
untrans_arg_list t
F show args It adds to the infobox the the label and/or value (from the value val) for a key
tab t X
key s X
val a
F load_show_key args It adds to the infobox the the label and/or value for a key
  • taking the values, as appropriate, from:
  • the preset values (in demo mode) or entered manually or read from WD.
tab t X
key s X
lims t
untrans_arg_list t
F AddTitCollapsibleText args It adds a subheader with collapsible text
tab t X
key s X
val a
F AddHeader args It adds a simple header
tab t X
key s X
F AddHeaderArg args It adds a header with associated val
tab t X
key s X
val a
collapsible b X
F ExecFuncs_SetHeaders frame
tab t X
local_func f
n_last_capt i X
F HasAnyValue keys t X It is used i.g. for change the header group caption if exists any items of a subgroup defined in keys.
F HasNValues keys t X It returns the item number of the subgroup keys that have a value
F HasAllValues keys t X It returns true if all items of the subgroup keys have a value
F SetOtherHeader target_key s X To change a header label
label s X
F SetOtherLabel target_key s X To change a label text
label s X
F SetOtherData target_key s X To change a val content
val a X
F GetData key s X It returns the value of a key
F CheckShowParams frame It checks that all parameters (sent within args) are valid
args
ArgsPoss t X
F InfoboxWithItsValues Main return of only-lua infobox
Preinfobox functions
F GetParamNFromT ModuleName Used in preinfoboxes,
  • it adds non-standard items (and returned in i18nM and i18n), after checking them.
    • Non-standard items are defined in new_args
    • new_args is a table with i.g. ["name_1"] = {"name_1","Name_1"}, ... and
  • their optional position (new_pos) in standard table, are returned in idx
  • new_pos is a table with i.g. {"new_1", "prior_standard_item_name"}, ...
i18nM t X
i18n t X
idx t X
new_args t
new_pos t
F val_of_key key s X
val a
F valval_of_key key s X
val a
F rsval_of_key key s X
val a
F lbl_of_key key s X
val s X
F arg_of_key args It sends a string value of a normal argument with its key (with val_ prefix).

In demo mode sends the preferred name for the key. Accept NONE value.

tab t X
key s X
lims t
DefVal a
F lcfirst S s It returns lowercase first character. Used for a returned labels from Wikidades where the first character is always uppercase.
F arg_label_of_key args It adds to the table args_t the the label and/or value for a key, taking the values entered manually or read from WD, as appropriate.
tab t X
key s X
lims t
DefVal a
F std_lab_arg_to_tab frame It adds to the table args_t the label and/or value for each item according to the index, taking the values as test, entered manually or read from WD, as appropriate.
args
tab t X
idx t X
lims t
local_func f X
lab_no_ruby t
omit_params t
F arg_of_str args It sends a string value of a special parameter with its key (without val_ prefix). I.e. used for lang or item
key s X
F arg_of_rskey args It sends a string value of a reserved (rs) parameter with its key (without its rs_ prefix and with val_ prefix)
key s X
F arg_of_rsbool args It sends a boolean value of a reserved (rs) parameter with its key (without its rs_ prefix and with val_ prefix)
key s X
F IniPreinfo args It prepares the values to send to template:
  • if exist: lang, item, proof_params, preset_params
  • reserved words,
  • tracking categories
tab t X
preset_params t
F SendToTemplate frame It sends to TemplateN all contained values in the table args_t, having previously added the found errors made by editor
args
tab t X
TemplateN s r