Module:Protection banner/config

From KitwarePublic
< Module:Protection banner
Revision as of 23:19, 12 July 2016 by WikiSysop (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump 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 -- ${EXPIRY} - the protection expiry date in the format DD Month YYYY. If
  45 -- protection is indefinite or is not set, this is the blank string.
  46 --
  47 -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
  48 -- on the talk page; you may submit a request to ask an administrator to make
  49 -- an edit if it is minor or supported by consensus."
  50 --
  51 -- ${IMAGELINK} - a link to set the image to, depending on the protection
  52 -- action and protection level.
  53 --
  54 -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
  55 -- is set. E.g. "Editing of this page by new or unregistered users is currently 
  56 -- disabled until dd Month YYYY."
  57 --
  58 -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
  59 -- so that it can be used in run-on sentences.
  60 --
  61 -- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
  62 -- Defined in the cfg.pagetypes table.
  63 --
  64 -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
  65 -- "Editing of this page by new or unregistered users is currently disabled"
  66 --
  67 -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
  68 -- template.
  69 --
  70 -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
  71 -- "semi-protected".
  72 --
  73 -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
  74 -- depending on the protection action.
  75 --
  76 -- ${TALKPAGE} - a link to the talk page. If a section is specified, links
  77 -- straight to that talk page section.
  78 --
  79 -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
  80 -- create a blurb like "This template is semi-protected", or "This article is
  81 -- move-protected until DD Month YYYY".
  82 --
  83 -- ${VANDAL} - links for the specified username (or the root page name)
  84 -- using Module:Vandal-m.
  85 --
  86 --                                 Functions
  87 --
  88 -- For advanced users, it is possible to use Lua functions instead of strings
  89 -- in the banner config tables. Using functions gives flexibility that is not
  90 -- possible just by using parameters. Functions take two arguments, the
  91 -- protection object and the template arguments, and they must output a string.
  92 --
  93 -- For example:
  94 --
  95 -- text = function (protectionObj, args)
  96 --     if protectionObj.level == 'autoconfirmed' then
  97 --         return 'foo'
  98 --     else
  99 --         return 'bar'
 100 --     end
 101 -- end
 102 --
 103 -- Some protection object properties and methods that may be useful:
 104 -- protectionObj.action - the protection action
 105 -- protectionObj.level - the protection level
 106 -- protectionObj.reason - the protection reason
 107 -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
 108 --     to indefinite, and the protection time in unix time if temporary.
 109 -- protectionObj.protectionDate - the protection date in unix time, or nil if
 110 --     unspecified.
 111 -- protectionObj.bannerConfig - the banner config found by the module. Beware
 112 --     of editing the config field used by the function, as it could create an
 113 --     infinite loop.
 114 -- protectionObj:isProtected - returns a boolean showing whether the page is
 115 --     protected.
 116 -- protectionObj:isTemporary - returns a boolean showing whether the expiry is
 117 --     temporary.
 118 -- protectionObj:isIncorrect - returns a boolean showing whether the protection
 119 --     template is incorrect.
 120 --]]
 121 
 122 -- The master banner data, used if no values have been found in banners or
 123 -- defaultBanners.
 124 masterBanner = {
 125 	text = '${INTROBLURB}',
 126 	explanation = '${EXPLANATIONBLURB}',
 127 	tooltip = '${TOOLTIPBLURB}',
 128 	link = '${IMAGELINK}',
 129 	alt = 'Page ${PROTECTIONLEVEL}'
 130 },
 131 
 132 -- The default banner data. This holds banner data for different protection
 133 -- levels.
 134 -- *required* - this table needs edit, move, autoreview and upload subtables.
 135 defaultBanners = {
 136 	edit = {},
 137 	move = {},
 138 	autoreview = {
 139 		autoconfirmed = {
 140 			alt = 'Page protected with pending changes level 1',
 141 			tooltip = 'All edits by unregistered and new users are subject to review',
 142 			image = 'Padlock-silver-light.svg'
 143 		},
 144 		default = {
 145 			alt = 'Page protected with pending changes level 2',
 146 			tooltip = 'All edits by users who are not reviewers or administrators are'
 147 				.. ' subject to review',
 148 		}
 149 	},
 150 	upload = {}
 151 },
 152 
 153 -- The banner data. This holds banner data for different protection reasons.
 154 -- In fact, the reasons specified in this table control which reasons are
 155 -- valid inputs to the first positional parameter.
 156 --
 157 -- There is also a non-standard "description" field that can be used for items
 158 -- in this table. This is a description of the protection reason for use in the
 159 -- module documentation.
 160 --
 161 -- *required* - this table needs edit, move, autoreview and upload subtables.
 162 banners = {
 163 	edit = {
 164 		blp = {
 165 			description = 'For pages protected to promote compliance with the'
 166 				.. ' [[Wikipedia:Biographies of living persons'
 167 				.. '|biographies of living persons]] policy',
 168 			text = '${INTROFRAGMENT} to promote compliance with'
 169 				.. ' [[Wikipedia:Biographies of living persons'
 170 				.. "|Wikipedia's&nbsp;policy on&nbsp;the&nbsp;biographies"
 171 				.. ' of&nbsp;living&nbsp;people]].',
 172 			tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
 173 				.. ' biographies of living people',
 174 		},
 175 		dmca = {
 176 			description = 'For pages protected by the Wikimedia Foundation'
 177 				.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
 178 			explanation = function (protectionObj, args)
 179 				local ret = 'Pursuant to a rights owner notice under the Digital'
 180 					.. ' Millennium Copyright Act (DMCA) regarding some content'
 181 					.. ' in this article, the Wikimedia Foundation acted under'
 182 					.. ' applicable law and took down and restricted the content'
 183 					.. ' in question.'
 184 				if args.notice then
 185 					ret = ret .. ' A copy of the received notice can be found here: '
 186 						.. args.notice .. '.'
 187 				end
 188 				ret = ret .. ' For more information, including websites discussing'
 189 					.. ' how to file a counter-notice, please see'
 190 					.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
 191 					.. "'''Do not remove this template from the article until the"
 192 					.. " restrictions are withdrawn'''."
 193 				return ret
 194 			end,
 195 			image = 'Padlock-black.svg',
 196 		},
 197 		dispute = {
 198 			description = 'For pages protected due to editing disputes',
 199 			text = function (protectionObj, args)
 200 				-- Find the value of "disputes".
 201 				local display = 'disputes'
 202 				local disputes
 203 				if args.section then
 204 					disputes = string.format(
 205 						'[[%s:%s#%s|%s]]',
 206 						mw.site.namespaces[protectionObj.title.namespace].talk.name,
 207 						protectionObj.title.text,
 208 						args.section,
 209 						display
 210 					)
 211 				else
 212 					disputes = display
 213 				end
 214 
 215 				-- Make the blurb, depending on the expiry.
 216 				local msg
 217 				if type(protectionObj.expiry) == 'number' then
 218 					msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
 219 				else
 220 					msg = '${INTROFRAGMENT} until editing %s have been resolved.'
 221 				end
 222 				return string.format(msg, disputes)
 223 			end,
 224 			explanation = "This protection is '''not''' an endorsement of the"
 225 				.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
 226 			tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
 227 		},
 228 		mainpage = {
 229 			description = 'For pages protected for being displayed on the [[Main Page]]',
 230 			text = 'This file is currently'
 231 				.. ' [[Wikipedia:This page is protected|protected]] from'
 232 				.. ' editing because it is currently or will soon be displayed'
 233 				.. ' on the [[Main Page]].',
 234 			explanation = 'Images on the Main Page are protected due to their high'
 235 				.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
 236 				.. '<br /><span style="font-size:90%;">'
 237 				.. "'''Administrators:''' Once this image is definitely off the Main Page,"
 238 				.. ' please unprotect this file, or reduce to semi-protection,'
 239 				.. ' as appropriate.</span>',
 240 		},
 241 		office = {
 242 			description = 'For pages protected by the Wikimedia Foundation',
 243 			text = function (protectionObj, args)
 244 				local ret = 'This ${PAGETYPE} is currently under the'
 245 					.. ' scrutiny of the'
 246 					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
 247 					.. ' and is protected.'
 248 				if protectionObj.protectionDate then
 249 					ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
 250 				end
 251 				return ret
 252 			end,
 253 			explanation = "If you can edit this page, please discuss all changes and"
 254 				.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
 255 				.. " page unless you are authorized by the Wikimedia Foundation to do"
 256 				.. " so.'''",
 257 			image = 'Padlock-black.svg',
 258 		},
 259 		reset = {
 260 			description = 'For pages protected by the Wikimedia Foundation and'
 261 				.. ' "reset" to a bare-bones version',
 262  			text = 'This ${PAGETYPE} is currently under the'
 263 					.. ' scrutiny of the'
 264 					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
 265 					.. ' and is protected.',
 266 			explanation = function (protectionObj, args)
 267 				local ret = ''
 268 				if protectionObj.protectionDate then
 269 					ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
 270 				else
 271 					ret = ret .. 'This ${PAGETYPE} has been'
 272 				end
 273 				ret = ret .. ' reduced to a'
 274 				.. ' simplified, "bare bones" version so that it may be completely'
 275 				.. ' rewritten to ensure it meets the policies of'
 276 				.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
 277 				.. ' Standard Wikipedia policies will apply to its rewriting—which'
 278 				.. ' will eventually be open to all editors—and will be strictly'
 279 				.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
 280 				.. ' it is being rebuilt.\n\n'
 281 				.. 'Any insertion of material directly from'
 282 				.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
 283 				.. ' will any material added to the ${PAGETYPE} that is not properly'
 284 				.. ' sourced. The associated talk page(s) were also cleared on the'
 285 				.. " same date.\n\n"
 286 				.. "If you can edit this page, please discuss all changes and"
 287 				.. " additions on the ${TALKPAGE} first. '''Do not override"
 288 				.. " this action, and do not remove protection from this page,"
 289 				.. " unless you are authorized by the Wikimedia Foundation"
 290 				.. " to do so. No editor may remove this notice.'''"
 291 
 292 				return ret
 293 			end,
 294 			image = 'Padlock-black.svg',
 295 		},
 296 		sock = {
 297 			description = 'For pages protected due to'
 298 				.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
 299 			text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
 300 				.. ' [[Wikipedia:Blocking policy|blocked]] or'
 301 				.. ' [[Wikipedia:Banning policy|banned users]]'
 302 				.. ' from editing it.',
 303 			tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
 304 				.. ' editing it',
 305 		},
 306 		template = {
 307 			description = 'For [[Wikipedia:High-risk templates|high-risk]]'
 308 				.. ' templates and Lua modules',
 309 			text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
 310 				.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
 311 			explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
 312 				.. ' ${EDITREQUEST} to ask an'
 313 				.. ' [[Wikipedia:Administrators|administrator]] or'
 314 				.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
 315 				.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
 316 				.. '|uncontroversial]] or supported by'
 317 				.. ' [[Wikipedia:Consensus|consensus]]. You can also'
 318 				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
 319 				.. ' unprotected.',
 320 			tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
 321 				.. ' to prevent vandalism',
 322 			alt = 'Permanently protected ${PAGETYPE}',
 323 		},
 324 		usertalk = {
 325 			description = 'For pages protected against disruptive edits by a'
 326 				.. ' particular user',
 327 			text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
 328 				.. ' such as abusing the'
 329 				.. ' &#123;&#123;[[Template:unblock|unblock]]&#125;&#125; template.',
 330 			explanation = 'If you cannot edit this user talk page and you need to'
 331 				.. ' make a change or leave a message, you can'
 332 				.. ' [[Wikipedia:Requests for page protection'
 333 				.. '#Current requests for edits to a protected page'
 334 				.. '|request an edit]],'
 335 				.. ' [[Wikipedia:Requests for page protection'
 336 				.. '#Current requests for reduction in protection level'
 337 				.. '|request unprotection]],'
 338 				.. ' [[Special:Userlogin|log in]],'
 339 				.. ' or [[Special:UserLogin/signup|create an account]].',
 340 		},
 341 		vandalism = {
 342 			description = 'For pages protected against'
 343 				.. ' [[Wikipedia:Vandalism|vandalism]]',
 344 			text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
 345 			explanation = function (protectionObj, args)
 346 				local ret = ''
 347 				if protectionObj.level == 'sysop' then
 348 					ret = ret .. "This protection is '''not''' an endorsement of the"
 349 						.. ' ${CURRENTVERSION}. '
 350 				end
 351 				return ret .. '${EXPLANATIONBLURB}'
 352 			end,
 353 			tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
 354 		}
 355 	},
 356 	move = {
 357 		dispute = {
 358 			description = 'For pages protected against page moves due to'
 359 				.. ' disputes over the page title',
 360 			explanation = "This protection is '''not''' an endorsement of the"
 361 				.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
 362 			image = 'Padlock-olive.svg'
 363 		},
 364 		vandalism = {
 365 			description = 'For pages protected against'
 366 				.. ' [[Wikipedia:Vandalism#Page-move vandalism'
 367 				.. ' |page-move vandalism]]'
 368 		}
 369 	},
 370 	autoreview = {},
 371 	upload = {}
 372 },
 373 
 374 --------------------------------------------------------------------------------
 375 --
 376 --                            GENERAL DATA TABLES
 377 --
 378 --------------------------------------------------------------------------------
 379 
 380 --------------------------------------------------------------------------------
 381 -- Protection blurbs
 382 --------------------------------------------------------------------------------
 383 
 384 -- This table produces the protection blurbs available with the
 385 -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
 386 -- protection level, and is checked by the module in the following order:
 387 -- 1. page's protection action, page's protection level
 388 -- 2. page's protection action, default protection level
 389 -- 3. "edit" protection action, default protection level
 390 --
 391 -- It is possible to use banner parameters inside this table.
 392 -- *required* - this table needs edit, move, autoreview and upload subtables.
 393 protectionBlurbs = {
 394 	edit = {
 395 		default = 'This ${PAGETYPE} is currently [[Help:Protection|'
 396 			.. 'protected]] from editing',
 397 		autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
 398 			.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
 399 			.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]'
 400 	},
 401 	move = {
 402 		default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
 403 			.. ' from [[Help:Moving a page|page moves]]'
 404 	},
 405 	autoreview = {
 406 		autoconfirmed = '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 		default = 'All edits made to this ${PAGETYPE} by users who are not'
 412 			.. ' [[Wikipedia:Reviewing|reviewers]] or'
 413 			.. ' [[Wikipedia:Administrators|administrators]] are currently'
 414 			.. ' [[Wikipedia:Pending changes|subject to review]]'
 415 	},
 416 	upload = {
 417 		default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
 418 	}
 419 },
 420 
 421 
 422 --------------------------------------------------------------------------------
 423 -- Explanation blurbs
 424 --------------------------------------------------------------------------------
 425 
 426 -- This table produces the explanation blurbs available with the
 427 -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
 428 -- protection level, and whether the page is a talk page or not. If the page is
 429 -- a talk page it will have a talk key of "talk"; otherwise it will have a talk
 430 -- key of "subject". The table is checked in the following order:
 431 -- 1. page's protection action, page's protection level, page's talk key
 432 -- 2. page's protection action, page's protection level, default talk key
 433 -- 3. page's protection action, default protection level, page's talk key
 434 -- 4. page's protection action, default protection level, default talk key
 435 --
 436 -- It is possible to use banner parameters inside this table.
 437 -- *required* - this table needs edit, move, autoreview and upload subtables.
 438 explanationBlurbs = {
 439 	edit = {
 440 		autoconfirmed = {
 441 			subject = 'See the [[Wikipedia:Protection policy|'
 442 				.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
 443 				.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
 444 				.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
 445 				.. ' [[Wikipedia:Requests for page protection'
 446 				.. '#Current requests for reduction in protection level'
 447 				.. '|request unprotection]], [[Special:Userlogin|log in]], or'
 448 				.. ' [[Special:UserLogin/signup|create an account]].',
 449 			default = 'See the [[Wikipedia:Protection policy|'
 450 				.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
 451 				.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
 452 				.. ' [[Wikipedia:Requests for page protection'
 453 				.. '#Current requests for reduction in protection level'
 454 				.. '|request unprotection]], [[Special:Userlogin|log in]], or'
 455 				.. ' [[Special:UserLogin/signup|create an account]].',
 456 		},
 457 		default = {
 458 			subject = 'See the [[Wikipedia:Protection policy|'
 459 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 460 				.. ' Please discuss any changes on the ${TALKPAGE}; you'
 461 				.. ' may ${EDITREQUEST} to ask an'
 462 				.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
 463 				.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
 464 				.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
 465 				.. '|consensus]]. You may also [[Wikipedia:Requests for'
 466 				.. ' page protection#Current requests for reduction in protection level'
 467 				.. '|request]] that this page be unprotected.',
 468 			default = 'See the [[Wikipedia:Protection policy|'
 469 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 470 				.. ' You may [[Wikipedia:Requests for page'
 471 				.. ' protection#Current requests for edits to a protected page|request an'
 472 				.. ' edit]] to this page, or [[Wikipedia:Requests for'
 473 				.. ' page protection#Current requests for reduction in protection level'
 474 				.. '|ask]] for it to be unprotected.'
 475 		}
 476 	},
 477 	move = {
 478 		default = {
 479 			subject = 'See the [[Wikipedia:Protection policy|'
 480 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 481 				.. ' The page may still be edited but cannot be moved'
 482 				.. ' until unprotected. Please discuss any suggested moves on the'
 483 				.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
 484 				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
 485 				.. ' unprotected.',
 486 			default = 'See the [[Wikipedia:Protection policy|'
 487 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 488 				.. ' The page may still be edited but cannot be moved'
 489 				.. ' until unprotected. Please discuss any suggested moves at'
 490 				.. ' [[Wikipedia:Requested moves]]. You can also'
 491 				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
 492 				.. ' unprotected.'
 493 		}
 494 	},
 495 	autoreview = {
 496 		default = {
 497 			reviewer = 'See the [[Wikipedia:Protection policy|'
 498 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 499 				.. ' Edits to this ${PAGETYPE} will not be visible to readers'
 500 				.. ' until they are accepted by a reviewer or an administrator.'
 501 				.. ' To avoid the need for your edits to be reviewed, you may'
 502 				.. ' [[Wikipedia:Requests for page protection'
 503 				.. '#Current requests for reduction in protection level'
 504 				.. '|request unprotection]]. Experienced editors may also'
 505 				.. ' request the [[Wikipedia:Reviewing|reviewer user right]].',
 506 			default = 'See the [[Wikipedia:Protection policy|'
 507 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 508 				.. ' Edits to this ${PAGETYPE} by new and unregistered users'
 509 				.. ' will not be visible to readers until they are accepted by'
 510 				.. ' a reviewer. To avoid the need for your edits to be'
 511 				.. ' reviewed, you may'
 512 				.. ' [[Wikipedia:Requests for page protection'
 513 				.. '#Current requests for reduction in protection level'
 514 				.. '|request unprotection]], [[Special:Userlogin|log in]], or'
 515 				.. ' [[Special:UserLogin/signup|create an account]].'
 516 		},
 517 	},
 518 	upload = {
 519 		default = {
 520 			default = 'See the [[Wikipedia:Protection policy|'
 521 				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 522 				.. ' The page may still be edited but new versions of the file'
 523 				.. ' cannot be uploaded until it is unprotected. You can'
 524 				.. ' request that a new version be uploaded by using a'
 525 				.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
 526 				.. ' can  [[Wikipedia:Requests for page protection|request]]'
 527 				.. ' that the file be unprotected.'
 528 		}
 529 	}
 530 },
 531 
 532 --------------------------------------------------------------------------------
 533 -- Protection levels
 534 --------------------------------------------------------------------------------
 535 
 536 -- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
 537 -- produces a short label for different protection levels. It is sorted by
 538 -- protection action and protection level, and is checked in the following
 539 -- order:
 540 -- 1. page's protection action, page's protection level
 541 -- 2. page's protection action, default protection level
 542 -- 3. "edit" protection action, default protection level
 543 --
 544 -- It is possible to use banner parameters inside this table.
 545 -- *required* - this table needs edit, move, autoreview and upload subtables.
 546 protectionLevels = {
 547 	edit = {
 548 		default = 'protected',
 549 		templateeditor = 'template-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 = 'Padlock.svg',
 575 		templateeditor = 'Padlock-pink.svg',
 576 		autoconfirmed = 'Padlock-silver.svg'
 577 	},
 578 	move = {
 579 		default = 'Padlock-olive.svg',
 580 	},
 581 	autoreview = {
 582 		autoconfirmed = 'Padlock-silver-light.svg',
 583 		default = 'Padlock-orange.svg'
 584 	},
 585 	upload = {
 586 		default = 'Padlock-purple.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 		autoconfirmed = 'Wikipedia:Protection policy#semi'
 614 	},
 615 	move = {
 616 		default = 'Wikipedia:Protection policy#move'
 617 	},
 618 	autoreview = {
 619 		autoconfirmed = 'Wikipedia:Protection policy#pc1',
 620 		reviewer = 'Wikipedia:Protection policy#pc2'
 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 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|template|all|all|edit']            = 'Wikipedia fully-protected templates',
 740 	['all|all|all|autoconfirmed|edit']       = 'Wikipedia semi-protected pages',
 741 	['indef|all|all|autoconfirmed|edit']     = 'Wikipedia indefinitely semi-protected pages',
 742 	['all|all|blp|autoconfirmed|edit']       = 'Wikipedia indefinitely semi-protected biographies of living people',
 743 	['temp|all|blp|autoconfirmed|edit']      = 'Wikipedia temporarily semi-protected biographies of living people',
 744 	['all|all|dispute|autoconfirmed|edit']   = 'Wikipedia pages semi-protected due to dispute',
 745 	['all|all|sock|autoconfirmed|edit']      = 'Wikipedia pages semi-protected from banned users',
 746 	['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
 747 	['all|category|all|autoconfirmed|edit']  = 'Wikipedia semi-protected categories',
 748 	['all|file|all|autoconfirmed|edit']      = 'Wikipedia semi-protected files',
 749 	['all|portal|all|autoconfirmed|edit']    = 'Wikipedia semi-protected portals',
 750 	['all|project|all|autoconfirmed|edit']   = 'Wikipedia semi-protected project pages',
 751 	['all|talk|all|autoconfirmed|edit']      = 'Wikipedia semi-protected talk pages',
 752 	['all|template|all|autoconfirmed|edit']  = 'Wikipedia semi-protected templates',
 753 	['all|user|all|autoconfirmed|edit']      = 'Wikipedia semi-protected user and user talk pages',
 754 	['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
 755 	['all|all|blp|sysop|edit']               = 'Wikipedia indefinitely protected biographies of living people',
 756 	['temp|all|blp|sysop|edit']              = 'Wikipedia temporarily protected biographies of living people',
 757 	['all|all|dispute|sysop|edit']           = 'Wikipedia pages protected due to dispute',
 758 	['all|all|sock|sysop|edit']              = 'Wikipedia pages protected from banned users',
 759 	['all|all|vandalism|sysop|edit']         = 'Wikipedia pages protected against vandalism',
 760 	['all|category|all|sysop|edit']          = 'Wikipedia protected categories',
 761 	['all|file|all|sysop|edit']              = 'Wikipedia fully-protected files',
 762 	['all|project|all|sysop|edit']           = 'Wikipedia fully-protected project pages',
 763 	['all|talk|all|sysop|edit']              = 'Wikipedia fully-protected talk pages',
 764 	['all|template|all|sysop|edit']          = 'Wikipedia fully-protected templates',
 765 	['all|user|all|sysop|edit']              = 'Wikipedia protected user and user talk pages',
 766 	['all|module|all|all|edit']              = 'Wikipedia fully-protected modules',
 767 	['all|module|all|templateeditor|edit']   = 'Wikipedia template-protected modules',
 768 	['all|module|all|autoconfirmed|edit']    = 'Wikipedia semi-protected modules',
 769 	['all|all|all|sysop|move']               = 'Wikipedia move-protected pages',
 770 	['indef|all|all|sysop|move']             = 'Wikipedia indefinitely move-protected pages',
 771 	['all|all|dispute|sysop|move']           = 'Wikipedia pages move-protected due to dispute',
 772 	['all|all|vandalism|sysop|move']         = 'Wikipedia pages move-protected due to vandalism',
 773 	['all|portal|all|sysop|move']            = 'Wikipedia move-protected portals',
 774 	['all|portal|all|sysop|move']            = 'Wikipedia move-protected portals',
 775 	['all|project|all|sysop|move']           = 'Wikipedia move-protected project pages',
 776 	['all|talk|all|sysop|move']              = 'Wikipedia move-protected talk pages',
 777 	['all|template|all|sysop|move']          = 'Wikipedia move-protected templates',
 778 	['all|user|all|sysop|move']              = 'Wikipedia move-protected user and user talk pages',
 779 	['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages (level 1)',
 780 	['all|all|all|reviewer|autoreview']      = 'Wikipedia pending changes protected pages (level 2)',
 781 	['all|file|all|all|upload']              = 'Wikipedia upload-protected files',
 782 },
 783 
 784 --------------------------------------------------------------------------------
 785 -- Expiry category config
 786 --------------------------------------------------------------------------------
 787 
 788 -- This table configures the expiry category behaviour for each protection
 789 -- action.
 790 -- * If set to true, setting that action will always categorise the page if
 791 --   an expiry parameter is not set.
 792 -- * If set to false, setting that action will never categorise the page.
 793 -- * If set to nil, the module will categorise the page if:
 794 --   1) an expiry parameter is not set, and
 795 --   2) a reason is provided, and
 796 --   3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
 797 --      table.
 798 
 799 expiryCheckActions = {
 800 	edit = nil,
 801 	move = false,
 802 	autoreview = true,
 803 	upload = false
 804 },
 805 
 806 reasonsWithoutExpiryCheck = {
 807 	blp = true,
 808 	template = true,
 809 },
 810 
 811 --------------------------------------------------------------------------------
 812 -- Pagetypes
 813 --------------------------------------------------------------------------------
 814 
 815 -- This table produces the page types available with the ${PAGETYPE} parameter.
 816 -- Keys are namespace numbers, or the string "default" for the default value.
 817 pagetypes = {
 818 	[0] = 'article',
 819 	[6] = 'file',
 820 	[10] = 'template',
 821 	[14] = 'category',
 822 	[828] = 'module',
 823 	default = 'page'
 824 },
 825 
 826 --------------------------------------------------------------------------------
 827 -- Strings marking indefinite protection
 828 --------------------------------------------------------------------------------
 829 
 830 -- This table contains values passed to the expiry parameter that mean the page
 831 -- is protected indefinitely.
 832 indefStrings = {
 833 	['indef'] = true,
 834 	['indefinite'] = true,
 835 	['indefinitely'] = true,
 836 	['infinite'] = true,
 837 },
 838 
 839 --------------------------------------------------------------------------------
 840 -- Group hierarchy
 841 --------------------------------------------------------------------------------
 842 
 843 -- This table maps each group to all groups that have a superset of the original
 844 -- group's page editing permissions.
 845 hierarchy = {
 846 	sysop = {},
 847 	reviewer = {'sysop'},
 848 	filemover = {'sysop'},
 849 	templateeditor = {'sysop'},
 850 	autoconfirmed = {'reviewer', 'filemover', 'templateeditor'},
 851 	user = {'autoconfirmed'},
 852 	['*'] = {'user'}
 853 },
 854 
 855 --------------------------------------------------------------------------------
 856 -- Wrapper templates and their default arguments
 857 --------------------------------------------------------------------------------
 858 
 859 -- This table contains wrapper templates used with the module, and their
 860 -- default arguments. Templates specified in this table should contain the
 861 -- following invocation, and no other template content:
 862 --
 863 -- {{#invoke:Protection banner|main}}
 864 --
 865 -- If other content is desired, it can be added between
 866 -- <noinclude>...</noinclude> tags.
 867 --
 868 -- When a user calls one of these wrapper templates, they will use the
 869 -- default arguments automatically. However, users can override any of the
 870 -- arguments.
 871 wrappers = {
 872 	['Template:Pp']                         = {},
 873 	['Template:Pp-blp']                     = {'blp'},
 874 	-- we don't need Template:Pp-create
 875 	['Template:Pp-dispute']                 = {'dispute'},
 876 	['Template:Pp-main-page']                = {'mainpage'},
 877 	['Template:Pp-move']                    = {action = 'move'},
 878 	['Template:Pp-move-dispute']            = {'dispute', action = 'move'},
 879 	-- we don't need Template:Pp-move-indef
 880 	['Template:Pp-move-vandalism']          = {'vandalism', action = 'move'},
 881 	['Template:Pp-office']                  = {'office'},
 882 	['Template:Pp-office-dmca']             = {'dmca'},
 883 	['Template:Pp-pc1']                     = {action = 'autoreview', small = true},
 884 	['Template:Pp-pc2']                     = {action = 'autoreview', small = true},
 885 	['Template:Pp-reset']                   = {'reset'},
 886 	['Template:Pp-semi-indef']              = {expiry = 'indef', small = true},
 887 	['Template:Pp-sock']                    = {'sock'},
 888 	['Template:Pp-template']                = {'template', small = true},
 889 	['Template:Pp-upload']                  = {action = 'upload'},
 890 	['Template:Pp-usertalk']                = {'usertalk'},
 891 	['Template:Pp-vandalism']               = {'vandalism'},
 892 },
 893 
 894 --------------------------------------------------------------------------------
 895 -- 
 896 --                                 MESSAGES
 897 -- 
 898 --------------------------------------------------------------------------------
 899 
 900 msg = {
 901 
 902 --------------------------------------------------------------------------------
 903 -- Intro blurb and intro fragment
 904 --------------------------------------------------------------------------------
 905 
 906 -- These messages specify what is produced by the ${INTROBLURB} and
 907 -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
 908 -- intro-blurb-expiry or intro-fragment-expiry, and if not they use
 909 -- intro-blurb-noexpiry or intro-fragment-noexpiry.
 910 -- It is possible to use banner parameters in these messages.
 911 ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
 912 ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
 913 ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
 914 ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
 915 
 916 --------------------------------------------------------------------------------
 917 -- Tooltip blurb
 918 --------------------------------------------------------------------------------
 919 
 920 -- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
 921 -- If the protection is temporary the tooltip-blurb-expiry message is used, and
 922 -- if not the tooltip-blurb-noexpiry message is used.
 923 -- It is possible to use banner parameters in these messages.
 924 ['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
 925 ['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
 926 ['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
 927 ['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
 928 
 929 --------------------------------------------------------------------------------
 930 -- Special explanation blurb
 931 --------------------------------------------------------------------------------
 932 
 933 -- An explanation blurb for pages that cannot be unprotected, e.g. for pages
 934 -- in the MediaWiki namespace.
 935 -- It is possible to use banner parameters in this message.
 936 ['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
 937 	.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
 938 	.. ' Please discuss any changes on the ${TALKPAGE}; you'
 939 	.. ' may ${EDITREQUEST} to ask an'
 940 	.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
 941 	.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
 942 	.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
 943 	.. '|consensus]].',
 944 
 945 --------------------------------------------------------------------------------
 946 -- Protection log display values
 947 --------------------------------------------------------------------------------
 948 
 949 -- These messages determine the display values for the protection log link
 950 -- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
 951 -- It is possible to use banner parameters in these messages.
 952 ['protection-log-display'] = 'protection log',
 953 ['pc-log-display'] = 'pending changes log',
 954 
 955 --------------------------------------------------------------------------------
 956 -- Current version display values
 957 --------------------------------------------------------------------------------
 958 
 959 -- These messages determine the display values for the page history link
 960 -- or the move log link produced by the ${CURRENTVERSION} parameter.
 961 -- It is possible to use banner parameters in these messages.
 962 ['current-version-move-display'] = 'current title',
 963 ['current-version-edit-display'] = 'current version',
 964 
 965 --------------------------------------------------------------------------------
 966 -- Talk page
 967 --------------------------------------------------------------------------------
 968 
 969 -- This message determines the display value of the talk page link produced
 970 -- with the ${TALKPAGE} parameter.
 971 -- It is possible to use banner parameters in this message.
 972 ['talk-page-link-display'] = 'talk page',
 973 
 974 --------------------------------------------------------------------------------
 975 -- Edit requests
 976 --------------------------------------------------------------------------------
 977 
 978 -- This message determines the display value of the edit request link produced
 979 -- with the ${EDITREQUEST} parameter.
 980 -- It is possible to use banner parameters in this message.
 981 ['edit-request-display'] = 'submit an edit request',
 982 
 983 --------------------------------------------------------------------------------
 984 -- Expiry date format
 985 --------------------------------------------------------------------------------
 986 
 987 -- This is the format for the blurb expiry date. It should be valid input for
 988 -- the first parameter of the #time parser function.
 989 ['expiry-date-format'] = 'F j, Y',
 990 
 991 --------------------------------------------------------------------------------
 992 -- Tracking categories
 993 --------------------------------------------------------------------------------
 994 
 995 -- These messages determine which tracking categories the module outputs.
 996 ['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
 997 ['tracking-category-expiry'] = 'Wikipedia protected pages without expiry',
 998 ['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
 999 
1000 --------------------------------------------------------------------------------
1001 -- Images
1002 --------------------------------------------------------------------------------
1003 
1004 -- These are images that are not defined by their protection action and protection level.
1005 ['image-filename-indef'] = 'Padlock.svg',
1006 ['image-filename-default'] = 'Transparent.gif',
1007 
1008 --------------------------------------------------------------------------------
1009 -- End messages
1010 --------------------------------------------------------------------------------
1011 }
1012 
1013 --------------------------------------------------------------------------------
1014 -- End configuration
1015 --------------------------------------------------------------------------------
1016 }