Module:Protection banner/config
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Protection banner/config/doc
1 -- This module provides configuration data for [[Module:Protection banner]].
2
3 return {
4
5 --------------------------------------------------------------------------------
6 --
7 -- BANNER DATA
8 --
9 --------------------------------------------------------------------------------
10
11 --[[
12 -- Banner data consists of six fields:
13 -- * text - the main protection text that appears at the top of protection
14 -- banners.
15 -- * explanation - the text that appears below the main protection text, used
16 -- to explain the details of the protection.
17 -- * tooltip - the tooltip text you see when you move the mouse over a small
18 -- padlock icon.
19 -- * link - the page that the small padlock icon links to.
20 -- * alt - the alt text for the small padlock icon. This is also used as tooltip
21 -- text for the large protection banners.
22 -- * image - the padlock image used in both protection banners and small padlock
23 -- icons.
24 --
25 -- The module checks in three separate tables to find a value for each field.
26 -- First it checks the banners table, which has values specific to the reason
27 -- for the page being protected. Then the module checks the defaultBanners
28 -- table, which has values specific to each protection level. Finally, the
29 -- module checks the masterBanner table, which holds data for protection
30 -- templates to use if no data has been found in the previous two tables.
31 --
32 -- The values in the banner data can take parameters. These are specified
33 -- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
34 -- enclosed in curly braces).
35 --
36 -- Available parameters:
37 --
38 -- ${CURRENTVERSION} - a link to the page history or the move log, with the
39 -- display message "current-version-edit-display" or
40 -- "current-version-move-display".
41 --
42 -- ${EDITREQUEST} - a link to create an edit request for the current page.
43 --
44 -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
45 -- on the talk page; you may submit a request to ask an administrator to make
46 -- an edit if it is minor or supported by consensus."
47 --
48 -- ${IMAGELINK} - a link to set the image to, depending on the protection
49 -- action and protection level.
50 --
51 -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
52 -- is set. E.g. "Editing of this page by new or unregistered users is currently
53 -- disabled until dd Month YYYY."
54 --
55 -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
56 -- so that it can be used in run-on sentences.
57 --
58 -- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
59 -- Defined in the cfg.pagetypes table.
60 --
61 -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
62 -- "Editing of this page by new or unregistered users is currently disabled"
63 --
64 -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
65 -- template.
66 --
67 -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
68 -- "semi-protected".
69 --
70 -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
71 -- depending on the protection action.
72 --
73 -- ${TALKPAGE} - a link to the talk page. If a section is specified, links
74 -- straight to that talk page section.
75 --
76 -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
77 -- create a blurb like "This template is semi-protected", or "This article is
78 -- move-protected until DD Month YYYY".
79 --
80 -- ${VANDAL} - links for the specified username (or the root page name)
81 -- using Module:Vandal-m.
82 --
83 -- Functions
84 --
85 -- For advanced users, it is possible to use Lua functions instead of strings
86 -- in the banner config tables. Using functions gives flexibility that is not
87 -- possible just by using parameters. Functions take two arguments, the
88 -- protection object and the template arguments, and they must output a string.
89 --
90 -- For example:
91 --
92 -- text = function (protectionObj, args)
93 -- if protectionObj.level == 'autoconfirmed' then
94 -- return 'foo'
95 -- else
96 -- return 'bar'
97 -- end
98 -- end
99 --
100 -- Some protection object properties and methods that may be useful:
101 -- protectionObj.action - the protection action
102 -- protectionObj.level - the protection level
103 -- protectionObj.reason - the protection reason
104 -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
105 -- to indefinite, and the protection time in unix time if temporary.
106 -- protectionObj.protectionDate - the protection date in unix time, or nil if
107 -- unspecified.
108 -- protectionObj.bannerConfig - the banner config found by the module. Beware
109 -- of editing the config field used by the function, as it could create an
110 -- infinite loop.
111 -- protectionObj:isProtected - returns a boolean showing whether the page is
112 -- protected.
113 -- protectionObj:isTemporary - returns a boolean showing whether the expiry is
114 -- temporary.
115 -- protectionObj:isIncorrect - returns a boolean showing whether the protection
116 -- template is incorrect.
117 --]]
118
119 -- The master banner data, used if no values have been found in banners or
120 -- defaultBanners.
121 masterBanner = {
122 text = '${INTROBLURB}',
123 explanation = '${EXPLANATIONBLURB}',
124 tooltip = '${TOOLTIPBLURB}',
125 link = '${IMAGELINK}',
126 alt = 'Page ${PROTECTIONLEVEL}'
127 },
128
129 -- The default banner data. This holds banner data for different protection
130 -- levels.
131 -- *required* - this table needs edit, move, autoreview and upload subtables.
132 defaultBanners = {
133 edit = {},
134 move = {},
135 autoreview = {
136 default = {
137 alt = 'Page protected with pending changes',
138 tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
139 image = 'Pending-protection-shackle.svg'
140 }
141 },
142 upload = {}
143 },
144
145 -- The banner data. This holds banner data for different protection reasons.
146 -- In fact, the reasons specified in this table control which reasons are
147 -- valid inputs to the first positional parameter.
148 --
149 -- There is also a non-standard "description" field that can be used for items
150 -- in this table. This is a description of the protection reason for use in the
151 -- module documentation.
152 --
153 -- *required* - this table needs edit, move, autoreview and upload subtables.
154 banners = {
155 edit = {
156 blp = {
157 description = 'For pages protected to promote compliance with the'
158 .. ' [[Wikipedia:Biographies of living persons'
159 .. '|biographies of living persons]] policy',
160 text = '${INTROFRAGMENT} to promote compliance with'
161 .. ' [[Wikipedia:Biographies of living persons'
162 .. "|Wikipedia's policy on the biographies"
163 .. ' of living people]].',
164 tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
165 .. ' biographies of living persons',
166 },
167 dmca = {
168 description = 'For pages protected by the Wikimedia Foundation'
169 .. ' due to [[Digital Millennium Copyright Act]] takedown requests',
170 explanation = function (protectionObj, args)
171 local ret = 'Pursuant to a rights owner notice under the Digital'
172 .. ' Millennium Copyright Act (DMCA) regarding some content'
173 .. ' in this article, the Wikimedia Foundation acted under'
174 .. ' applicable law and took down and restricted the content'
175 .. ' in question.'
176 if args.notice then
177 ret = ret .. ' A copy of the received notice can be found here: '
178 .. args.notice .. '.'
179 end
180 ret = ret .. ' For more information, including websites discussing'
181 .. ' how to file a counter-notice, please see'
182 .. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
183 .. "'''Do not remove this template from the article until the"
184 .. " restrictions are withdrawn'''."
185 return ret
186 end,
187 image = 'Office-protection-shackle.svg',
188 },
189 dispute = {
190 description = 'For pages protected due to editing disputes',
191 text = function (protectionObj, args)
192 -- Find the value of "disputes".
193 local display = 'disputes'
194 local disputes
195 if args.section then
196 disputes = string.format(
197 '[[%s:%s#%s|%s]]',
198 mw.site.namespaces[protectionObj.title.namespace].talk.name,
199 protectionObj.title.text,
200 args.section,
201 display
202 )
203 else
204 disputes = display
205 end
206
207 -- Make the blurb, depending on the expiry.
208 local msg
209 if type(protectionObj.expiry) == 'number' then
210 msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
211 else
212 msg = '${INTROFRAGMENT} until editing %s have been resolved.'
213 end
214 return string.format(msg, disputes)
215 end,
216 explanation = "This protection is '''not''' an endorsement of the"
217 .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
218 tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
219 },
220 ecp = {
221 description = 'For articles in topic areas authorized by'
222 .. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
223 .. ' meets the criteria for community use',
224 tooltip = 'This ${PAGETYPE} is extended-confirmed protected',
225 alt = 'Extended-protected ${PAGETYPE}',
226 },
227 mainpage = {
228 description = 'For pages protected for being displayed on the [[Main Page]]',
229 text = 'This file is currently'
230 .. ' [[Wikipedia:This page is protected|protected]] from'
231 .. ' editing because it is currently or will soon be displayed'
232 .. ' on the [[Main Page]].',
233 explanation = 'Images on the Main Page are protected due to their high'
234 .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
235 .. '<br /><span style="font-size:90%;">'
236 .. "'''Administrators:''' Once this image is definitely off the Main Page,"
237 .. ' please unprotect this file, or reduce to semi-protection,'
238 .. ' as appropriate.</span>',
239 },
240 office = {
241 description = 'For pages protected by the Wikimedia Foundation',
242 text = function (protectionObj, args)
243 local ret = 'This ${PAGETYPE} is currently under the'
244 .. ' scrutiny of the'
245 .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
246 .. ' and is protected.'
247 if protectionObj.protectionDate then
248 ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
249 end
250 return ret
251 end,
252 explanation = "If you can edit this page, please discuss all changes and"
253 .. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
254 .. " page unless you are authorized by the Wikimedia Foundation to do"
255 .. " so.'''",
256 image = 'Office-protection-shackle.svg',
257 },
258 reset = {
259 description = 'For pages protected by the Wikimedia Foundation and'
260 .. ' "reset" to a bare-bones version',
261 text = 'This ${PAGETYPE} is currently under the'
262 .. ' scrutiny of the'
263 .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
264 .. ' and is protected.',
265 explanation = function (protectionObj, args)
266 local ret = ''
267 if protectionObj.protectionDate then
268 ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
269 else
270 ret = ret .. 'This ${PAGETYPE} has been'
271 end
272 ret = ret .. ' reduced to a'
273 .. ' simplified, "bare bones" version so that it may be completely'
274 .. ' rewritten to ensure it meets the policies of'
275 .. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
276 .. ' Standard Wikipedia policies will apply to its rewriting—which'
277 .. ' will eventually be open to all editors—and will be strictly'
278 .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
279 .. ' it is being rebuilt.\n\n'
280 .. 'Any insertion of material directly from'
281 .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
282 .. ' will any material added to the ${PAGETYPE} that is not properly'
283 .. ' sourced. The associated talk page(s) were also cleared on the'
284 .. " same date.\n\n"
285 .. "If you can edit this page, please discuss all changes and"
286 .. " additions on the ${TALKPAGE} first. '''Do not override"
287 .. " this action, and do not remove protection from this page,"
288 .. " unless you are authorized by the Wikimedia Foundation"
289 .. " to do so. No editor may remove this notice.'''"
290
291 return ret
292 end,
293 image = 'Office-protection-shackle.svg',
294 },
295 sock = {
296 description = 'For pages protected due to'
297 .. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
298 text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
299 .. ' [[Wikipedia:Blocking policy|blocked]] or'
300 .. ' [[Wikipedia:Banning policy|banned users]]'
301 .. ' from editing it.',
302 tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
303 .. ' editing it',
304 },
305 template = {
306 description = 'For [[Wikipedia:High-risk templates|high-risk]]'
307 .. ' templates and Lua modules',
308 text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
309 .. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
310 explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
311 .. ' ${EDITREQUEST} to ask an'
312 .. ' [[Wikipedia:Administrators|administrator]] or'
313 .. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
314 .. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
315 .. '|uncontroversial]] or supported by'
316 .. ' [[Wikipedia:Consensus|consensus]]. You can also'
317 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
318 .. ' unprotected.',
319 tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
320 .. ' to prevent vandalism',
321 alt = 'Permanently protected ${PAGETYPE}',
322 },
323 usertalk = {
324 description = 'For pages protected against disruptive edits by a'
325 .. ' particular user',
326 text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
327 .. ' such as abusing the'
328 .. ' {{[[Template:unblock|unblock]]}} template.',
329 explanation = 'If you cannot edit this user talk page and you need to'
330 .. ' make a change or leave a message, you can'
331 .. ' [[Wikipedia:Requests for page protection'
332 .. '#Current requests for edits to a protected page'
333 .. '|request an edit]],'
334 .. ' [[Wikipedia:Requests for page protection'
335 .. '#Current requests for reduction in protection level'
336 .. '|request unprotection]],'
337 .. ' [[Special:Userlogin|log in]],'
338 .. ' or [[Special:UserLogin/signup|create an account]].',
339 },
340 vandalism = {
341 description = 'For pages protected against'
342 .. ' [[Wikipedia:Vandalism|vandalism]]',
343 text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
344 explanation = function (protectionObj, args)
345 local ret = ''
346 if protectionObj.level == 'sysop' then
347 ret = ret .. "This protection is '''not''' an endorsement of the"
348 .. ' ${CURRENTVERSION}. '
349 end
350 return ret .. '${EXPLANATIONBLURB}'
351 end,
352 tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
353 }
354 },
355 move = {
356 dispute = {
357 description = 'For pages protected against page moves due to'
358 .. ' disputes over the page title',
359 explanation = "This protection is '''not''' an endorsement of the"
360 .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
361 image = 'Move-protection-shackle.svg'
362 },
363 vandalism = {
364 description = 'For pages protected against'
365 .. ' [[Wikipedia:Vandalism#Page-move vandalism'
366 .. ' |page-move vandalism]]'
367 }
368 },
369 autoreview = {},
370 upload = {}
371 },
372
373 --------------------------------------------------------------------------------
374 --
375 -- GENERAL DATA TABLES
376 --
377 --------------------------------------------------------------------------------
378
379 --------------------------------------------------------------------------------
380 -- Protection blurbs
381 --------------------------------------------------------------------------------
382
383 -- This table produces the protection blurbs available with the
384 -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
385 -- protection level, and is checked by the module in the following order:
386 -- 1. page's protection action, page's protection level
387 -- 2. page's protection action, default protection level
388 -- 3. "edit" protection action, default protection level
389 --
390 -- It is possible to use banner parameters inside this table.
391 -- *required* - this table needs edit, move, autoreview and upload subtables.
392 protectionBlurbs = {
393 edit = {
394 default = 'This ${PAGETYPE} is currently [[Help:Protection|'
395 .. 'protected]] from editing',
396 autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
397 .. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
398 .. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
399 extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',
400 },
401 move = {
402 default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
403 .. ' from [[Help:Moving a page|page moves]]'
404 },
405 autoreview = {
406 default = 'All edits made to this ${PAGETYPE} by'
407 .. ' [[Wikipedia:User access levels#New users|new]] or'
408 .. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
409 .. ' users are currently'
410 .. ' [[Wikipedia:Pending changes|subject to review]]'
411 },
412 upload = {
413 default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
414 }
415 },
416
417
418 --------------------------------------------------------------------------------
419 -- Explanation blurbs
420 --------------------------------------------------------------------------------
421
422 -- This table produces the explanation blurbs available with the
423 -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
424 -- protection level, and whether the page is a talk page or not. If the page is
425 -- a talk page it will have a talk key of "talk"; otherwise it will have a talk
426 -- key of "subject". The table is checked in the following order:
427 -- 1. page's protection action, page's protection level, page's talk key
428 -- 2. page's protection action, page's protection level, default talk key
429 -- 3. page's protection action, default protection level, page's talk key
430 -- 4. page's protection action, default protection level, default talk key
431 --
432 -- It is possible to use banner parameters inside this table.
433 -- *required* - this table needs edit, move, autoreview and upload subtables.
434 explanationBlurbs = {
435 edit = {
436 autoconfirmed = {
437 subject = 'See the [[Wikipedia:Protection policy|'
438 .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
439 .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
440 .. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
441 .. ' [[Wikipedia:Requests for page protection'
442 .. '#Current requests for reduction in protection level'
443 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
444 .. ' [[Special:UserLogin/signup|create an account]].',
445 default = 'See the [[Wikipedia:Protection policy|'
446 .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
447 .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
448 .. ' [[Wikipedia:Requests for page protection'
449 .. '#Current requests for reduction in protection level'
450 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
451 .. ' [[Special:UserLogin/signup|create an account]].',
452 },
453 extendedconfirmed = {
454 default = 'Extended confirmed protection prevents edits from all unregistered editors'
455 .. ' and registered users with fewer than 30 days tenure and 500 edits.'
456 .. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
457 .. ' specifies that extended confirmed protection can be applied to combat'
458 .. ' disruption, if semi-protection has proven to be ineffective.'
459 .. ' Extended confirmed protection may also be applied to enforce'
460 .. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'
461 .. ' Please discuss any changes on the ${TALKPAGE}; you may'
462 .. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
463 .. ' [[Wikipedia:Consensus|consensus]].'
464 },
465 default = {
466 subject = 'See the [[Wikipedia:Protection policy|'
467 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
468 .. ' Please discuss any changes on the ${TALKPAGE}; you'
469 .. ' may ${EDITREQUEST} to ask an'
470 .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
471 .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
472 .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
473 .. '|consensus]]. You may also [[Wikipedia:Requests for'
474 .. ' page protection#Current requests for reduction in protection level'
475 .. '|request]] that this page be unprotected.',
476 default = 'See the [[Wikipedia:Protection policy|'
477 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
478 .. ' You may [[Wikipedia:Requests for page'
479 .. ' protection#Current requests for edits to a protected page|request an'
480 .. ' edit]] to this page, or [[Wikipedia:Requests for'
481 .. ' page protection#Current requests for reduction in protection level'
482 .. '|ask]] for it to be unprotected.'
483 }
484 },
485 move = {
486 default = {
487 subject = 'See the [[Wikipedia:Protection policy|'
488 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
489 .. ' The page may still be edited but cannot be moved'
490 .. ' until unprotected. Please discuss any suggested moves on the'
491 .. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
492 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
493 .. ' unprotected.',
494 default = 'See the [[Wikipedia:Protection policy|'
495 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
496 .. ' The page may still be edited but cannot be moved'
497 .. ' until unprotected. Please discuss any suggested moves at'
498 .. ' [[Wikipedia:Requested moves]]. You can also'
499 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
500 .. ' unprotected.'
501 }
502 },
503 autoreview = {
504 default = {
505 default = 'See the [[Wikipedia:Protection policy|'
506 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
507 .. ' Edits to this ${PAGETYPE} by new and unregistered users'
508 .. ' will not be visible to readers until they are accepted by'
509 .. ' a reviewer. To avoid the need for your edits to be'
510 .. ' reviewed, you may'
511 .. ' [[Wikipedia:Requests for page protection'
512 .. '#Current requests for reduction in protection level'
513 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
514 .. ' [[Special:UserLogin/signup|create an account]].'
515 },
516 },
517 upload = {
518 default = {
519 default = 'See the [[Wikipedia:Protection policy|'
520 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
521 .. ' The page may still be edited but new versions of the file'
522 .. ' cannot be uploaded until it is unprotected. You can'
523 .. ' request that a new version be uploaded by using a'
524 .. ' [[Wikipedia:Edit requests|protected edit request]], or you'
525 .. ' can [[Wikipedia:Requests for page protection|request]]'
526 .. ' that the file be unprotected.'
527 }
528 }
529 },
530
531 --------------------------------------------------------------------------------
532 -- Protection levels
533 --------------------------------------------------------------------------------
534
535 -- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
536 -- produces a short label for different protection levels. It is sorted by
537 -- protection action and protection level, and is checked in the following
538 -- order:
539 -- 1. page's protection action, page's protection level
540 -- 2. page's protection action, default protection level
541 -- 3. "edit" protection action, default protection level
542 --
543 -- It is possible to use banner parameters inside this table.
544 -- *required* - this table needs edit, move, autoreview and upload subtables.
545 protectionLevels = {
546 edit = {
547 default = 'protected',
548 templateeditor = 'template-protected',
549 extendedconfirmed = 'extended-protected',
550 autoconfirmed = 'semi-protected',
551 },
552 move = {
553 default = 'move-protected'
554 },
555 autoreview = {
556 },
557 upload = {
558 default = 'upload-protected'
559 }
560 },
561
562 --------------------------------------------------------------------------------
563 -- Images
564 --------------------------------------------------------------------------------
565
566 -- This table lists different padlock images for each protection action and
567 -- protection level. It is used if an image is not specified in any of the
568 -- banner data tables, and if the page does not satisfy the conditions for using
569 -- the ['image-filename-indef'] image. It is checked in the following order:
570 -- 1. page's protection action, page's protection level
571 -- 2. page's protection action, default protection level
572 images = {
573 edit = {
574 default = 'Full-protection-shackle.svg',
575 templateeditor = 'Template-protection-shackle.svg',
576 extendedconfirmed = 'Extended-protection-shackle.svg',
577 autoconfirmed = 'Semi-protection-shackle.svg'
578 },
579 move = {
580 default = 'Move-protection-shackle.svg',
581 },
582 autoreview = {
583 default = 'Pending-protection-shackle.svg'
584 },
585 upload = {
586 default = 'Upload-protection-shackle.svg'
587 }
588 },
589
590 -- Pages with a reason specified in this table will show the special "indef"
591 -- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
592 indefImageReasons = {
593 template = true
594 },
595
596 --------------------------------------------------------------------------------
597 -- Image links
598 --------------------------------------------------------------------------------
599
600 -- This table provides the data for the ${IMAGELINK} parameter, which gets
601 -- the image link for small padlock icons based on the page's protection action
602 -- and protection level. It is checked in the following order:
603 -- 1. page's protection action, page's protection level
604 -- 2. page's protection action, default protection level
605 -- 3. "edit" protection action, default protection level
606 --
607 -- It is possible to use banner parameters inside this table.
608 -- *required* - this table needs edit, move, autoreview and upload subtables.
609 imageLinks = {
610 edit = {
611 default = 'Wikipedia:Protection policy#full',
612 templateeditor = 'Wikipedia:Protection policy#template',
613 extendedconfirmed = 'Wikipedia:Protection policy#extended',
614 autoconfirmed = 'Wikipedia:Protection policy#semi'
615 },
616 move = {
617 default = 'Wikipedia:Protection policy#move'
618 },
619 autoreview = {
620 default = 'Wikipedia:Protection policy#pending'
621 },
622 upload = {
623 default = 'Wikipedia:Protection policy#upload'
624 }
625 },
626
627 --------------------------------------------------------------------------------
628 -- Padlock indicator names
629 --------------------------------------------------------------------------------
630
631 -- This table provides the "name" attribute for the <indicator> extension tag
632 -- with which small padlock icons are generated. All indicator tags on a page
633 -- are displayed in alphabetical order based on this attribute, and with
634 -- indicator tags with duplicate names, the last tag on the page wins.
635 -- The attribute is chosen based on the protection action; table keys must be a
636 -- protection action name or the string "default".
637 padlockIndicatorNames = {
638 autoreview = 'pp-autoreview',
639 default = 'pp-default'
640 },
641
642 --------------------------------------------------------------------------------
643 -- Protection categories
644 --------------------------------------------------------------------------------
645
646 --[[
647 -- The protection categories are stored in the protectionCategories table.
648 -- Keys to this table are made up of the following strings:
649 --
650 -- 1. the expiry date
651 -- 2. the namespace
652 -- 3. the protection reason (e.g. "dispute" or "vandalism")
653 -- 4. the protection level (e.g. "sysop" or "autoconfirmed")
654 -- 5. the action (e.g. "edit" or "move")
655 --
656 -- When the module looks up a category in the table, first it will will check to
657 -- see a key exists that corresponds to all five parameters. For example, a
658 -- user page semi-protected from vandalism for two weeks would have the key
659 -- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
660 -- changes the first part of the key to "all" and checks the table again. It
661 -- keeps checking increasingly generic key combinations until it finds the
662 -- field, or until it reaches the key "all-all-all-all-all".
663 --
664 -- The module uses a binary matrix to determine the order in which to search.
665 -- This is best demonstrated by a table. In this table, the "0" values
666 -- represent "all", and the "1" values represent the original data (e.g.
667 -- "indef" or "file" or "vandalism").
668 --
669 -- expiry namespace reason level action
670 -- order
671 -- 1 1 1 1 1 1
672 -- 2 0 1 1 1 1
673 -- 3 1 0 1 1 1
674 -- 4 0 0 1 1 1
675 -- 5 1 1 0 1 1
676 -- 6 0 1 0 1 1
677 -- 7 1 0 0 1 1
678 -- 8 0 0 0 1 1
679 -- 9 1 1 1 0 1
680 -- 10 0 1 1 0 1
681 -- 11 1 0 1 0 1
682 -- 12 0 0 1 0 1
683 -- 13 1 1 0 0 1
684 -- 14 0 1 0 0 1
685 -- 15 1 0 0 0 1
686 -- 16 0 0 0 0 1
687 -- 17 1 1 1 1 0
688 -- 18 0 1 1 1 0
689 -- 19 1 0 1 1 0
690 -- 20 0 0 1 1 0
691 -- 21 1 1 0 1 0
692 -- 22 0 1 0 1 0
693 -- 23 1 0 0 1 0
694 -- 24 0 0 0 1 0
695 -- 25 1 1 1 0 0
696 -- 26 0 1 1 0 0
697 -- 27 1 0 1 0 0
698 -- 28 0 0 1 0 0
699 -- 29 1 1 0 0 0
700 -- 30 0 1 0 0 0
701 -- 31 1 0 0 0 0
702 -- 32 0 0 0 0 0
703 --
704 -- In this scheme the action has the highest priority, as it is the last
705 -- to change, and the expiry has the least priority, as it changes the most.
706 -- The priorities of the expiry, the protection level and the action are
707 -- fixed, but the priorities of the reason and the namespace can be swapped
708 -- through the use of the cfg.bannerDataNamespaceHasPriority table.
709 --]]
710
711 -- If the reason specified to the template is listed in this table,
712 -- namespace data will take priority over reason data in the protectionCategories
713 -- table.
714 reasonsWithNamespacePriority = {
715 vandalism = true,
716 },
717
718 -- The string to use as a namespace key for the protectionCategories table for each
719 -- namespace number.
720 categoryNamespaceKeys = {
721 [ 2] = 'user',
722 [ 3] = 'user',
723 [ 4] = 'project',
724 [ 6] = 'file',
725 [ 8] = 'mediawiki',
726 [ 10] = 'template',
727 [ 12] = 'project',
728 [ 14] = 'category',
729 [100] = 'portal',
730 [828] = 'module',
731 },
732
733 protectionCategories = {
734 ['all|all|all|all|all'] = 'Wikipedia fully protected pages',
735 ['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
736 ['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
737 ['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
738 ['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files',
739 ['all|all|all|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
740 ['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia extended-confirmed-protected pages',
741 ['all|template|all|all|edit'] = 'Wikipedia fully protected templates',
742 ['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
743 ['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
744 ['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
745 ['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
746 ['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
747 ['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
748 ['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
749 ['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
750 ['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
751 ['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
752 ['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
753 ['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
754 ['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
755 ['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
756 ['all|all|all|templateeditor|edit'] = 'Wikipedia template-protected pages other than templates and modules',
757 ['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
758 ['all|template|all|templateeditor|move'] = 'Wikipedia template-protected templates', -- move-protected templates
759 ['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
760 ['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
761 ['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
762 ['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
763 ['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
764 ['all|category|all|sysop|edit'] = 'Wikipedia fully protected categories',
765 ['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files',
766 ['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages',
767 ['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages',
768 ['all|template|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected templates',
769 ['all|template|all|sysop|edit'] = 'Wikipedia fully protected templates',
770 ['all|user|all|sysop|edit'] = 'Wikipedia fully protected user and user talk pages',
771 ['all|module|all|all|edit'] = 'Wikipedia fully-protected modules',
772 ['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
773 ['all|module|all|extendedconfirmed|edit'] = 'Wikipedia extended-confirmed-protected modules',
774 ['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
775 ['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
776 ['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
777 ['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
778 ['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
779 ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
780 ['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
781 ['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
782 ['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
783 ['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
784 ['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
785 ['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
786 },
787
788 --------------------------------------------------------------------------------
789 -- Expiry category config
790 --------------------------------------------------------------------------------
791
792 -- This table configures the expiry category behaviour for each protection
793 -- action.
794 -- * If set to true, setting that action will always categorise the page if
795 -- an expiry parameter is not set.
796 -- * If set to false, setting that action will never categorise the page.
797 -- * If set to nil, the module will categorise the page if:
798 -- 1) an expiry parameter is not set, and
799 -- 2) a reason is provided, and
800 -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
801 -- table.
802
803 expiryCheckActions = {
804 edit = nil,
805 move = false,
806 autoreview = true,
807 upload = false
808 },
809
810 reasonsWithoutExpiryCheck = {
811 blp = true,
812 template = true,
813 },
814
815 --------------------------------------------------------------------------------
816 -- Pagetypes
817 --------------------------------------------------------------------------------
818
819 -- This table produces the page types available with the ${PAGETYPE} parameter.
820 -- Keys are namespace numbers, or the string "default" for the default value.
821 pagetypes = {
822 [0] = 'article',
823 [6] = 'file',
824 [10] = 'template',
825 [14] = 'category',
826 [828] = 'module',
827 default = 'page'
828 },
829
830 --------------------------------------------------------------------------------
831 -- Strings marking indefinite protection
832 --------------------------------------------------------------------------------
833
834 -- This table contains values passed to the expiry parameter that mean the page
835 -- is protected indefinitely.
836 indefStrings = {
837 ['indef'] = true,
838 ['indefinite'] = true,
839 ['indefinitely'] = true,
840 ['infinite'] = true,
841 },
842
843 --------------------------------------------------------------------------------
844 -- Group hierarchy
845 --------------------------------------------------------------------------------
846
847 -- This table maps each group to all groups that have a superset of the original
848 -- group's page editing permissions.
849 hierarchy = {
850 sysop = {},
851 reviewer = {'sysop'},
852 filemover = {'sysop'},
853 templateeditor = {'sysop'},
854 extendedconfirmed = {'sysop'},
855 autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
856 user = {'autoconfirmed'},
857 ['*'] = {'user'}
858 },
859
860 --------------------------------------------------------------------------------
861 -- Wrapper templates and their default arguments
862 --------------------------------------------------------------------------------
863
864 -- This table contains wrapper templates used with the module, and their
865 -- default arguments. Templates specified in this table should contain the
866 -- following invocation, and no other template content:
867 --
868 -- {{#invoke:Protection banner|main}}
869 --
870 -- If other content is desired, it can be added between
871 -- <noinclude>...</noinclude> tags.
872 --
873 -- When a user calls one of these wrapper templates, they will use the
874 -- default arguments automatically. However, users can override any of the
875 -- arguments.
876 wrappers = {
877 ['Template:Pp'] = {},
878 ['Template:Pp-extended'] = {'ecp'},
879 ['Template:Pp-blp'] = {'blp'},
880 -- we don't need Template:Pp-create
881 ['Template:Pp-dispute'] = {'dispute'},
882 ['Template:Pp-main-page'] = {'mainpage'},
883 ['Template:Pp-move'] = {action = 'move', catonly = 'yes'},
884 ['Template:Pp-move-dispute'] = {'dispute', action = 'move', catonly = 'yes'},
885 -- we don't need Template:Pp-move-indef
886 ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move', catonly = 'yes'},
887 ['Template:Pp-office'] = {'office'},
888 ['Template:Pp-office-dmca'] = {'dmca'},
889 ['Template:Pp-pc'] = {action = 'autoreview', small = true},
890 ['Template:Pp-pc1'] = {action = 'autoreview', small = true},
891 ['Template:Pp-reset'] = {'reset'},
892 ['Template:Pp-semi-indef'] = {small = true},
893 ['Template:Pp-sock'] = {'sock'},
894 ['Template:Pp-template'] = {'template', small = true},
895 ['Template:Pp-upload'] = {action = 'upload'},
896 ['Template:Pp-usertalk'] = {'usertalk'},
897 ['Template:Pp-vandalism'] = {'vandalism'},
898 },
899
900 --------------------------------------------------------------------------------
901 --
902 -- MESSAGES
903 --
904 --------------------------------------------------------------------------------
905
906 msg = {
907
908 --------------------------------------------------------------------------------
909 -- Intro blurb and intro fragment
910 --------------------------------------------------------------------------------
911
912 -- These messages specify what is produced by the ${INTROBLURB} and
913 -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
914 -- intro-blurb-expiry or intro-fragment-expiry, and if not they use
915 -- intro-blurb-noexpiry or intro-fragment-noexpiry.
916 -- It is possible to use banner parameters in these messages.
917 ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
918 ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
919 ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
920 ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
921
922 --------------------------------------------------------------------------------
923 -- Tooltip blurb
924 --------------------------------------------------------------------------------
925
926 -- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
927 -- If the protection is temporary the tooltip-blurb-expiry message is used, and
928 -- if not the tooltip-blurb-noexpiry message is used.
929 -- It is possible to use banner parameters in these messages.
930 ['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
931 ['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
932 ['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
933 ['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
934
935 --------------------------------------------------------------------------------
936 -- Special explanation blurb
937 --------------------------------------------------------------------------------
938
939 -- An explanation blurb for pages that cannot be unprotected, e.g. for pages
940 -- in the MediaWiki namespace.
941 -- It is possible to use banner parameters in this message.
942 ['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
943 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
944 .. ' Please discuss any changes on the ${TALKPAGE}; you'
945 .. ' may ${EDITREQUEST} to ask an'
946 .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
947 .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
948 .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
949 .. '|consensus]].',
950
951 --------------------------------------------------------------------------------
952 -- Protection log display values
953 --------------------------------------------------------------------------------
954
955 -- These messages determine the display values for the protection log link
956 -- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
957 -- It is possible to use banner parameters in these messages.
958 ['protection-log-display'] = 'protection log',
959 ['pc-log-display'] = 'pending changes log',
960
961 --------------------------------------------------------------------------------
962 -- Current version display values
963 --------------------------------------------------------------------------------
964
965 -- These messages determine the display values for the page history link
966 -- or the move log link produced by the ${CURRENTVERSION} parameter.
967 -- It is possible to use banner parameters in these messages.
968 ['current-version-move-display'] = 'current title',
969 ['current-version-edit-display'] = 'current version',
970
971 --------------------------------------------------------------------------------
972 -- Talk page
973 --------------------------------------------------------------------------------
974
975 -- This message determines the display value of the talk page link produced
976 -- with the ${TALKPAGE} parameter.
977 -- It is possible to use banner parameters in this message.
978 ['talk-page-link-display'] = 'talk page',
979
980 --------------------------------------------------------------------------------
981 -- Edit requests
982 --------------------------------------------------------------------------------
983
984 -- This message determines the display value of the edit request link produced
985 -- with the ${EDITREQUEST} parameter.
986 -- It is possible to use banner parameters in this message.
987 ['edit-request-display'] = 'submit an edit request',
988
989 --------------------------------------------------------------------------------
990 -- Expiry date format
991 --------------------------------------------------------------------------------
992
993 -- This is the format for the blurb expiry date. It should be valid input for
994 -- the first parameter of the #time parser function.
995 ['expiry-date-format'] = 'F j, Y "at" H:i e',
996
997 --------------------------------------------------------------------------------
998 -- Tracking categories
999 --------------------------------------------------------------------------------
1000
1001 -- These messages determine which tracking categories the module outputs.
1002 ['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
1003 ['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
1004
1005 --------------------------------------------------------------------------------
1006 -- Images
1007 --------------------------------------------------------------------------------
1008
1009 -- These are images that are not defined by their protection action and protection level.
1010 ['image-filename-indef'] = 'Full-protection-shackle.svg',
1011 ['image-filename-default'] = 'Transparent.gif',
1012
1013 --------------------------------------------------------------------------------
1014 -- End messages
1015 --------------------------------------------------------------------------------
1016 }
1017
1018 --------------------------------------------------------------------------------
1019 -- End configuration
1020 --------------------------------------------------------------------------------
1021 }