Content deleted Content added
update transclusion count |
mNo edit summary |
||
(24 intermediate revisions by 20 users not shown) | |||
Line 1:
{{High-use
{{Module rating|protected}}
{{Lua|Module:Protection banner/config|Module:File link|Module:Effective protection level|Module:Effective protection expiry|Module:Yesno|Module:Arguments|Module:Message box|Module:Submit an edit request}}
This module creates protection banners and padlock icons that are placed at the top of [[Help:Protection|protected pages]].
Line 18 ⟶ 19:
| user = ''username''
| section = ''talk page section name''
| category = ''
}}
Line 29 ⟶ 30:
First, load the module.
<
local mProtectionBanner = require('Module:Protection banner')
</syntaxhighlight>
Then you can make protection banners by using the _main function.
<
mProtectionBanner._main(args, cfg, titleObj)
</syntaxhighlight>
<var>args</var> is a table of arguments to pass to the module. For possible keys and values for this table, see the [[#Parameters|parameters section]]. The <var>cfg</var> and <var>titleObj</var> variables are intended only for testing; <var>cfg</var> specifies a customised config table to use instead of [[Module:Protection banner/config]], and <var>titleObj</var> specifies a mw.title object to use instead of the current title. <var>args</var>, <var>cfg</var> and <var>titleObj</var> are all optional.
Line 45 ⟶ 46:
All parameters are optional.
* '''1'''
* '''small'''
* '''action'''
* '''date'''
* '''user'''
* '''section'''
* '''category'''
* '''catonly''' – if set to "yes", "y", "1", or "true", will only return the protection categories, and not return the banner or padlock. This has no visible output.
== Reasons ==
Line 67 ⟶ 69:
{{error|Error: invalid protection date ("abc")}}
This error is produced if you supply
=== Invalid action ===
Line 92 ⟶ 94:
Bug reports and feature requests should be made on [[w:en:Module talk:Protection banner|the module's talk page]].
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here and interwikis go in Wikidata. -->
}}</includeonly>
|