· 5 years ago · Feb 03, 2020, 06:02 PM
1-- This module provides configuration data for [[Module:Protection banner]].
2
3return {
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.
121masterBanner = {
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.
132defaultBanners = {
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.
154banners = {
155 edit = {
156 blp = {
157 description = 'For pages protected to promote compliance with the'
158 .. ' [[The Toxic Gacha Fandom Wiki:Biographies of living persons'
159 .. '|biographies of living persons]] policy',
160 text = '${INTROFRAGMENT} to promote compliance with'
161 .. ' [[The Toxic Gacha Fandom Wiki:Biographies of living persons'
162 .. "|The TGFW's policy on the biographies"
163 .. ' of living people]].',
164 tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
165 .. ' biographies of living people',
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 .. " [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 TGFW 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 .. ' [[The Toxic Gacha Fandom Wiki:Sock puppetry|sock puppetry]]',
298 text = '${INTROFRAGMENT} to prevent [[The Toxic Gacha Fandom Wiki:Sock puppetry|sock puppets]] of'
299 .. ' [[The Toxic Gacha Fandom Wiki:Blocking policy|blocked]] or'
300 .. ' [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki:High-risk templates|high-risk]]'
307 .. ' templates and Lua modules',
308 text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
309 .. ' as it is [[The Toxic Gacha Fandom Wiki:High-risk templates|high-risk]].',
310 explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
311 .. ' ${EDITREQUEST} to ask an'
312 .. ' [[The Toxic Gacha Fandom Wiki:Administrators|administrator]] or'
313 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Consensus|consensus]]. You can also'
317 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Requests for page protection'
332 .. '#Current requests for edits to a protected page'
333 .. '|request an edit]],'
334 .. ' [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Vandalism|vandalism]]',
343 text = '${INTROFRAGMENT} due to [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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.
392protectionBlurbs = {
393 edit = {
394 default = 'This ${PAGETYPE} is currently [[Help:Protection|'
395 .. 'protected]] from editing',
396 autoconfirmed = 'Editing of this ${PAGETYPE} by [[The Toxic Gacha Fandom Wiki:User access'
397 .. ' levels#New users|new]] or [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:User access levels#New users|new]] or'
408 .. ' [[The Toxic Gacha Fandom Wiki:User access levels#Unregistered users|unregistered]]'
409 .. ' users are currently'
410 .. ' [[The Toxic Gacha Fandom Wiki: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.
434explanationBlurbs = {
435 edit = {
436 autoconfirmed = {
437 subject = 'See the [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Arbitration Committee|arbitration sanctions]].'
461 .. ' Please discuss any changes on the ${TALKPAGE}; you may'
462 .. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'
463 .. ' [[The Toxic Gacha Fandom Wiki:Consensus|consensus]].'
464 },
465 default = {
466 subject = 'See the [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki:Consensus'
473 .. '|consensus]]. You may also [[The Toxic Gacha Fandom Wiki:Requests for'
474 .. ' page protection#Current requests for reduction in protection level'
475 .. '|request]] that this page be unprotected.',
476 default = 'See the [[The Toxic Gacha Fandom Wiki:Protection policy|'
477 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
478 .. ' You may [[The Toxic Gacha Fandom Wiki:Requests for page'
479 .. ' protection#Current requests for edits to a protected page|request an'
480 .. ' edit]] to this page, or [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki:Requested moves]]. You can also'
492 .. ' [[The Toxic Gacha Fandom Wiki:Requests for page protection|request]] that the page be'
493 .. ' unprotected.',
494 default = 'See the [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Requested moves]]. You can also'
499 .. ' [[The Toxic Gacha Fandom Wiki:Requests for page protection|request]] that the page be'
500 .. ' unprotected.'
501 }
502 },
503 autoreview = {
504 default = {
505 default = 'See the [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki: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 [[The Toxic Gacha Fandom Wiki: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 .. ' [[The Toxic Gacha Fandom Wiki:Edit requests|protected edit request]], or you'
525 .. ' can [[The Toxic Gacha Fandom Wiki: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.
545protectionLevels = {
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
572images = {
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.
592indefImageReasons = {
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.
609imageLinks = {
610 edit = {
611 default = 'The Toxic Gacha Fandom Wiki:Protection policy#full',
612 templateeditor = 'The Toxic Gacha Fandom Wiki:Protection policy#template',
613 extendedconfirmed = 'The Toxic Gacha Fandom Wiki:Protection policy#extended',
614 autoconfirmed = 'The Toxic Gacha Fandom Wiki:Protection policy#semi'
615 },
616 move = {
617 default = 'The Toxic Gacha Fandom Wiki:Protection policy#move'
618 },
619 autoreview = {
620 default = 'The Toxic Gacha Fandom Wiki:Protection policy#pending'
621 },
622 upload = {
623 default = 'The Toxic Gacha Fandom Wiki: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".
637padlockIndicatorNames = {
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.
714reasonsWithNamespacePriority = {
715 vandalism = true,
716},
717
718-- The string to use as a namespace key for the protectionCategories table for each
719-- namespace number.
720categoryNamespaceKeys = {
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
733protectionCategories = {
734 ['all|all|all|all|all'] = 'TGFW fully protected pages',
735 ['all|all|office|all|all'] = 'TGFW Office-protected pages',
736 ['all|all|reset|all|all'] = 'TGFW Office-protected pages',
737 ['all|all|dmca|all|all'] = 'TGFW Office-protected pages',
738 ['all|all|mainpage|all|all'] = 'TGFW fully-protected main page files',
739 ['all|all|all|extendedconfirmed|all'] = 'TGFW extended-confirmed-protected pages',
740 ['all|all|ecp|extendedconfirmed|all'] = 'TGFW extended-confirmed-protected pages',
741 ['all|template|all|all|edit'] = 'TGFW fully protected templates',
742 ['all|all|all|autoconfirmed|edit'] = 'TGFW semi-protected pages',
743 ['indef|all|all|autoconfirmed|edit'] = 'TGFW indefinitely semi-protected pages',
744 ['all|all|blp|autoconfirmed|edit'] = 'TGFW indefinitely semi-protected biographies of living people',
745 ['temp|all|blp|autoconfirmed|edit'] = 'TGFW temporarily semi-protected biographies of living people',
746 ['all|all|dispute|autoconfirmed|edit'] = 'TGFW pages semi-protected due to dispute',
747 ['all|all|sock|autoconfirmed|edit'] = 'TGFW pages semi-protected from banned users',
748 ['all|all|vandalism|autoconfirmed|edit'] = 'TGFW pages semi-protected against vandalism',
749 ['all|category|all|autoconfirmed|edit'] = 'TGFW semi-protected categories',
750 ['all|file|all|autoconfirmed|edit'] = 'TGFW semi-protected files',
751 ['all|portal|all|autoconfirmed|edit'] = 'TGFW semi-protected portals',
752 ['all|project|all|autoconfirmed|edit'] = 'TGFW semi-protected project pages',
753 ['all|talk|all|autoconfirmed|edit'] = 'TGFW semi-protected talk pages',
754 ['all|template|all|autoconfirmed|edit'] = 'TGFW semi-protected templates',
755 ['all|user|all|autoconfirmed|edit'] = 'TGFW semi-protected user and user talk pages',
756 ['all|template|all|templateeditor|edit'] = 'TGFW template-protected templates',
757 ['all|all|blp|sysop|edit'] = 'TGFW indefinitely protected biographies of living people',
758 ['temp|all|blp|sysop|edit'] = 'TGFW temporarily protected biographies of living people',
759 ['all|all|dispute|sysop|edit'] = 'TGFW pages protected due to dispute',
760 ['all|all|sock|sysop|edit'] = 'TGFW pages protected from banned users',
761 ['all|all|vandalism|sysop|edit'] = 'TGFW pages protected against vandalism',
762 ['all|category|all|sysop|edit'] = 'TGFW fully protected categories',
763 ['all|file|all|sysop|edit'] = 'TGFW fully-protected files',
764 ['all|project|all|sysop|edit'] = 'TGFW fully-protected project pages',
765 ['all|talk|all|sysop|edit'] = 'TGFW fully-protected talk pages',
766 ['all|template|all|sysop|edit'] = 'TGFW fully protected templates',
767 ['all|user|all|sysop|edit'] = 'TGFW fully protected user and user talk pages',
768 ['all|module|all|all|edit'] = 'TGFW fully-protected modules',
769 ['all|module|all|templateeditor|edit'] = 'TGFW template-protected modules',
770 ['all|module|all|autoconfirmed|edit'] = 'TGFW semi-protected modules',
771 ['all|all|all|sysop|move'] = 'TGFW move-protected pages',
772 ['indef|all|all|sysop|move'] = 'TGFW indefinitely move-protected pages',
773 ['all|all|dispute|sysop|move'] = 'TGFW pages move-protected due to dispute',
774 ['all|all|vandalism|sysop|move'] = 'TGFW pages move-protected due to vandalism',
775 ['all|portal|all|sysop|move'] = 'TGFW move-protected portals',
776 ['all|portal|all|sysop|move'] = 'TGFW move-protected portals',
777 ['all|project|all|sysop|move'] = 'TGFW move-protected project pages',
778 ['all|talk|all|sysop|move'] = 'TGFW move-protected talk pages',
779 ['all|template|all|sysop|move'] = 'TGFW move-protected templates',
780 ['all|user|all|sysop|move'] = 'TGFW move-protected user and user talk pages',
781 ['all|all|all|autoconfirmed|autoreview'] = 'TGFW pending changes protected pages',
782 ['all|file|all|all|upload'] = 'TGFW upload-protected files',
783},
784
785--------------------------------------------------------------------------------
786-- Expiry category config
787--------------------------------------------------------------------------------
788
789-- This table configures the expiry category behaviour for each protection
790-- action.
791-- * If set to true, setting that action will always categorise the page if
792-- an expiry parameter is not set.
793-- * If set to false, setting that action will never categorise the page.
794-- * If set to nil, the module will categorise the page if:
795-- 1) an expiry parameter is not set, and
796-- 2) a reason is provided, and
797-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
798-- table.
799
800expiryCheckActions = {
801 edit = nil,
802 move = false,
803 autoreview = true,
804 upload = false
805},
806
807reasonsWithoutExpiryCheck = {
808 blp = true,
809 template = true,
810},
811
812--------------------------------------------------------------------------------
813-- Pagetypes
814--------------------------------------------------------------------------------
815
816-- This table produces the page types available with the ${PAGETYPE} parameter.
817-- Keys are namespace numbers, or the string "default" for the default value.
818pagetypes = {
819 [0] = 'article',
820 [6] = 'file',
821 [10] = 'template',
822 [14] = 'category',
823 [828] = 'module',
824 default = 'page'
825},
826
827--------------------------------------------------------------------------------
828-- Strings marking indefinite protection
829--------------------------------------------------------------------------------
830
831-- This table contains values passed to the expiry parameter that mean the page
832-- is protected indefinitely.
833indefStrings = {
834 ['indef'] = true,
835 ['indefinite'] = true,
836 ['indefinitely'] = true,
837 ['infinite'] = true,
838},
839
840--------------------------------------------------------------------------------
841-- Group hierarchy
842--------------------------------------------------------------------------------
843
844-- This table maps each group to all groups that have a superset of the original
845-- group's page editing permissions.
846hierarchy = {
847 sysop = {},
848 reviewer = {'sysop'},
849 filemover = {'sysop'},
850 templateeditor = {'sysop'},
851 extendedconfirmed = {'sysop'},
852 autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
853 user = {'autoconfirmed'},
854 ['*'] = {'user'}
855},
856
857--------------------------------------------------------------------------------
858-- Wrapper templates and their default arguments
859--------------------------------------------------------------------------------
860
861-- This table contains wrapper templates used with the module, and their
862-- default arguments. Templates specified in this table should contain the
863-- following invocation, and no other template content:
864--
865-- {{#invoke:Protection banner|main}}
866--
867-- If other content is desired, it can be added between
868-- <noinclude>...</noinclude> tags.
869--
870-- When a user calls one of these wrapper templates, they will use the
871-- default arguments automatically. However, users can override any of the
872-- arguments.
873wrappers = {
874 ['Template:Pp'] = {},
875 ['Template:Pp-extended'] = {'ecp'},
876 ['Template:Pp-blp'] = {'blp'},
877 -- we don't need Template:Pp-create
878 ['Template:Pp-dispute'] = {'dispute'},
879 ['Template:Pp-main-page'] = {'mainpage'},
880 ['Template:Pp-move'] = {action = 'move'},
881 ['Template:Pp-move-dispute'] = {'dispute', action = 'move'},
882 -- we don't need Template:Pp-move-indef
883 ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'},
884 ['Template:Pp-office'] = {'office'},
885 ['Template:Pp-office-dmca'] = {'dmca'},
886 ['Template:Pp-pc'] = {action = 'autoreview', small = true},
887 ['Template:Pp-pc1'] = {action = 'autoreview', small = true},
888 ['Template:Pp-reset'] = {'reset'},
889 ['Template:Pp-semi-indef'] = {small = true},
890 ['Template:Pp-sock'] = {'sock'},
891 ['Template:Pp-template'] = {'template', small = true},
892 ['Template:Pp-upload'] = {action = 'upload'},
893 ['Template:Pp-usertalk'] = {'usertalk'},
894 ['Template:Pp-vandalism'] = {'vandalism'},
895},
896
897--------------------------------------------------------------------------------
898--
899-- MESSAGES
900--
901--------------------------------------------------------------------------------
902
903msg = {
904
905--------------------------------------------------------------------------------
906-- Intro blurb and intro fragment
907--------------------------------------------------------------------------------
908
909-- These messages specify what is produced by the ${INTROBLURB} and
910-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
911-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
912-- intro-blurb-noexpiry or intro-fragment-noexpiry.
913-- It is possible to use banner parameters in these messages.
914['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
915['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
916['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
917['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
918
919--------------------------------------------------------------------------------
920-- Tooltip blurb
921--------------------------------------------------------------------------------
922
923-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
924-- If the protection is temporary the tooltip-blurb-expiry message is used, and
925-- if not the tooltip-blurb-noexpiry message is used.
926-- It is possible to use banner parameters in these messages.
927['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
928['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
929['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
930['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
931
932--------------------------------------------------------------------------------
933-- Special explanation blurb
934--------------------------------------------------------------------------------
935
936-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
937-- in the MediaWiki namespace.
938-- It is possible to use banner parameters in this message.
939['explanation-blurb-nounprotect'] = 'See the [[The Toxic Gacha Fandom Wiki:Protection policy|'
940 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
941 .. ' Please discuss any changes on the ${TALKPAGE}; you'
942 .. ' may ${EDITREQUEST} to ask an'
943 .. ' [[The Toxic Gacha Fandom Wiki:Administrators|administrator]] to make an edit if it'
944 .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
945 .. '|uncontroversial]] or supported by [[The Toxic Gacha Fandom Wiki:Consensus'
946 .. '|consensus]].',
947
948--------------------------------------------------------------------------------
949-- Protection log display values
950--------------------------------------------------------------------------------
951
952-- These messages determine the display values for the protection log link
953-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
954-- It is possible to use banner parameters in these messages.
955['protection-log-display'] = 'protection log',
956['pc-log-display'] = 'pending changes log',
957
958--------------------------------------------------------------------------------
959-- Current version display values
960--------------------------------------------------------------------------------
961
962-- These messages determine the display values for the page history link
963-- or the move log link produced by the ${CURRENTVERSION} parameter.
964-- It is possible to use banner parameters in these messages.
965['current-version-move-display'] = 'current title',
966['current-version-edit-display'] = 'current version',
967
968--------------------------------------------------------------------------------
969-- Talk page
970--------------------------------------------------------------------------------
971
972-- This message determines the display value of the talk page link produced
973-- with the ${TALKPAGE} parameter.
974-- It is possible to use banner parameters in this message.
975['talk-page-link-display'] = 'talk page',
976
977--------------------------------------------------------------------------------
978-- Edit requests
979--------------------------------------------------------------------------------
980
981-- This message determines the display value of the edit request link produced
982-- with the ${EDITREQUEST} parameter.
983-- It is possible to use banner parameters in this message.
984['edit-request-display'] = 'submit an edit request',
985
986--------------------------------------------------------------------------------
987-- Expiry date format
988--------------------------------------------------------------------------------
989
990-- This is the format for the blurb expiry date. It should be valid input for
991-- the first parameter of the #time parser function.
992['expiry-date-format'] = 'F j, Y "at" H:i e',
993
994--------------------------------------------------------------------------------
995-- Tracking categories
996--------------------------------------------------------------------------------
997
998-- These messages determine which tracking categories the module outputs.
999['tracking-category-incorrect'] = 'TGFW pages with incorrect protection templates',
1000['tracking-category-template'] = 'TGFW template-protected pages other than templates and modules',
1001
1002--------------------------------------------------------------------------------
1003-- Images
1004--------------------------------------------------------------------------------
1005
1006-- These are images that are not defined by their protection action and protection level.
1007['image-filename-indef'] = 'Full-protection-shackle.svg',
1008['image-filename-default'] = 'Transparent.gif',
1009
1010--------------------------------------------------------------------------------
1011-- End messages
1012--------------------------------------------------------------------------------
1013}
1014
1015--------------------------------------------------------------------------------
1016-- End configuration
1017--------------------------------------------------------------------------------
1018}