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

-- This module provides configuration data for Module:Protection banner.

return {


-- -- BANNER DATA --


--[[ -- Banner data consists of six fields: -- * text - the main protection text that appears at the top of protection -- banners. -- * explanation - the text that appears below the main protection text, used -- to explain the details of the protection. -- * tooltip - the tooltip text you see when you move the mouse over a small -- padlock icon. -- * link - the page that the small padlock icon links to. -- * alt - the alt text for the small padlock icon. This is also used as tooltip -- text for the large protection banners. -- * image - the padlock image used in both protection banners and small padlock -- icons. -- -- The module checks in three separate tables to find a value for each field. -- First it checks the banners table, which has values specific to the reason -- for the page being protected. Then the module checks the defaultBanners -- table, which has values specific to each protection level. Finally, the -- module checks the masterBanner table, which holds data for protection -- templates to use if no data has been found in the previous two tables. -- -- The values in the banner data can take parameters. These are specified -- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name -- enclosed in curly braces). -- -- Available parameters: -- -- ${CURRENTVERSION} - a link to the page history or the move log, with the -- display message "current-version-edit-display" or -- "current-version-move-display". -- -- ${EDITREQUEST} - a link to create an edit request for the current page. -- -- ${EXPIRY} - the protection expiry date in the format DD Month YYYY. If -- protection is indefinite or is not set, this is the blank string. -- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes -- on the talk page; you may submit a request to ask an administrator to make -- an edit if it is minor or supported by consensus." -- -- ${IMAGELINK} - a link to set the image to, depending on the protection -- action and protection level. -- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry -- is set. E.g. "Editing of this page by new or unregistered users is currently -- disabled until dd Month YYYY." -- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation -- so that it can be used in run-on sentences. -- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template". -- Defined in the cfg.pagetypes table. -- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g. -- "Editing of this page by new or unregistered users is currently disabled" -- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the -- template. -- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or -- "semi-protected". -- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log, -- depending on the protection action. -- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links -- straight to that talk page section. -- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to -- create a blurb like "This template is semi-protected", or "This article is -- move-protected until DD Month YYYY". -- -- ${VANDAL} - links for the specified username (or the root page name) -- using Module:Vandal-m. -- -- Functions -- -- For advanced users, it is possible to use Lua functions instead of strings -- in the banner config tables. Using functions gives flexibility that is not -- possible just by using parameters. Functions take two arguments, the -- protection object and the template arguments, and they must output a string. -- -- For example: -- -- text = function (protectionObj, args) -- if protectionObj.level == 'autoconfirmed' then -- return 'foo' -- else -- return 'bar' -- end -- end -- -- Some protection object properties and methods that may be useful: -- protectionObj.action - the protection action -- protectionObj.level - the protection level -- protectionObj.reason - the protection reason -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set -- to indefinite, and the protection time in unix time if temporary. -- protectionObj.protectionDate - the protection date in unix time, or nil if -- unspecified. -- protectionObj.bannerConfig - the banner config found by the module. Beware -- of editing the config field used by the function, as it could create an -- infinite loop. -- protectionObj:isProtected - returns a boolean showing whether the page is -- protected. -- protectionObj:isTemporary - returns a boolean showing whether the expiry is -- temporary. -- protectionObj:isIncorrect - returns a boolean showing whether the protection -- template is incorrect. --]]

-- The master banner data, used if no values have been found in banners or -- defaultBanners. masterBanner = { text = '${INTROBLURB}', explanation = '${EXPLANATIONBLURB}', tooltip = '${TOOLTIPBLURB}', link = '${IMAGELINK}', alt = 'Page ${PROTECTIONLEVEL}' },

-- The default banner data. This holds banner data for different protection -- levels. -- *required* - this table needs edit, move, and autoreview subtables. defaultBanners = { edit = {}, move = {}, autoreview = { autoconfirmed = { alt = 'Page protected with pending changes level 1', tooltip = 'All edits by unregistered and new users are subject to review', image = 'Padlock-silver-light.svg' }, default = { alt = 'Page protected with pending changes level 2', tooltip = 'All edits by users who are not reviewers or administrators are' .. ' subject to review', } } },

-- The banner data. This holds banner data for different protection reasons. -- In fact, the reasons specified in this table control which reasons are -- valid inputs to the first positional parameter. -- -- There is also a non-standard "description" field that can be used for items -- in this table. This is a description of the protection reason for use in the -- module documentation. -- -- *required* - this table needs edit, move, and autoreview subtables. banners = { edit = { blp = { description = 'For pages protected to promote compliance with the' .. ' [[Wikipedia:Biographies of living persons' .. '|biographies of living persons]] policy.', text = '${INTROFRAGMENT} to promote compliance with' .. ' [[Wikipedia:Biographies of living persons' .. "|Wikipedia's policy on the biographies" .. ' of living people]].', tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on' .. ' biographies of living people', }, dmca = { description = 'For pages protected by the Wikimedia Foundation' .. ' due to Digital Millennium Copyright Act takedown requests.', explanation = function (protectionObj, args) local ret = 'Pursuant to a rights owner notice under the Digital' .. ' Millennium Copyright Act (DMCA) regarding some content' .. ' in this article, the Wikimedia Foundation acted under' .. ' applicable law and took down and restricted the content' .. ' in question.' if args.notice then ret = ret .. ' A copy of the received notice can be found here: ' .. args.notice .. '.' end ret = ret .. ' For more information, including websites discussing' .. ' how to file a counter-notice, please see' .. " Wikipedia:Office actions and the article's ${TALKPAGE}." .. "Do not remove this template from the article until the" .. " restrictions are withdrawn." return ret end, image = 'Padlock-black.svg', }, dispute = { description = 'For pages protected due to editing disputes.', text = function (protectionObj, args) -- Find the value of "disputes". local display = 'disputes' local disputes if args.section then disputes = string.format( '%s', mw.site.namespaces[protectionObj.title.namespace].talk.name, protectionObj.title.text, args.section, display ) else disputes = display end

-- Make the blurb, depending on the expiry. local msg if type(protectionObj.expiry) == 'number' then msg = '${INTROFRAGMENT} or until editing %s have been resolved.' else msg = '${INTROFRAGMENT} until editing %s have been resolved.' end return string.format(msg, disputes) end, explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', tooltip = '${TOOLTIPFRAGMENT} due to editing disputes', }, mainpage = { description = 'For pages protected for being displayed on the Main Page.', text = 'This file is currently' .. ' protected from' .. ' editing because it is currently or will soon be displayed' .. ' on the Main Page.', explanation = 'Images on the Main Page are protected due to their high' .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.' .. '
' .. "Administrators: Once this image is definitely off the Main Page," .. ' please unprotect this file, or reduce to semi-protection,' .. ' as appropriate.', }, office = { description = 'For pages protected by the Wikimedia Foundation.', text = function (protectionObj, args) local ret = 'This ${PAGETYPE} is currently under the' .. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.' if protectionObj.protectionDate then ret = ret .. ' It has been protected since ${PROTECTIONDATE}.' end return ret end, explanation = "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not remove protection from this" .. " page unless you are authorized by the Wikimedia Foundation to do" .. " so.", image = 'Padlock-black.svg', }, reset = { description = 'For pages protected by the Wikimedia Foundation and' .. ' "reset" to a bare-bones version.',

  1. text = 'This ${PAGETYPE} is currently under the'

.. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.', explanation = function (protectionObj, args) local ret = if protectionObj.protectionDate then ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was' else ret = ret .. 'This ${PAGETYPE} has been' end ret = ret .. ' reduced to a' .. ' simplified, "bare bones" version so that it may be completely' .. ' rewritten to ensure it meets the policies of' .. ' Neutral Point of View and Verifiability.' .. ' Standard Wikipedia policies will apply to its rewriting—which' .. ' will eventually be open to all editors—and will be strictly' .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while' .. ' it is being rebuilt.\n\n' .. 'Any insertion of material directly from' .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as' .. ' will any material added to the ${PAGETYPE} that is not properly' .. ' sourced. The associated talk page(s) were also cleared on the' .. " same date.\n\n" .. "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not override" .. " this action, and do not remove protection from this page," .. " unless you are authorized by the Wikimedia Foundation" .. " to do so. No editor may remove this notice."

return ret end, image = 'Padlock-black.svg', }, sock = { description = 'For pages protected due to' .. ' sock puppetry.', text = '${INTROFRAGMENT} to prevent sock puppets of' .. ' blocked or' .. ' banned users' .. ' from editing it.', tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from' .. ' editing it', }, template = { description = 'For high-risk' .. ' templates and Lua modules.', text = 'This is a permanently protected ${PAGETYPE},' .. ' as it is high-risk.', explanation = 'Please discuss any changes on the ${TALKPAGE}; you may' .. ' ${EDITREQUEST} to ask an' .. ' administrator or' .. ' template editor to make an edit if' .. ' it is [[Help:Minor edit#When to mark an edit as a minor edit' .. '|uncontroversial]] or supported by' .. ' consensus. You can also' .. ' request that the page be' .. ' unprotected.', tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}' .. ' to prevent vandalism', alt = 'Permanently protected ${PAGETYPE}', }, usertalk = { description = 'For pages protected against disruptive edits by a' .. ' particular user.', text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,' .. ' such as abusing the' .. ' {{unblock}} template.', explanation = 'If you cannot edit this user talk page and you need to' .. ' make a change or leave a message, you can' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for edits to a protected page' .. '|request an edit]],' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]],' .. ' log in,' .. ' or create an account.', }, vandalism = { description = 'For pages protected against' .. ' vandalism.', text = '${INTROFRAGMENT} due to vandalism.', explanation = function (protectionObj, args) local ret = if protectionObj.level == 'sysop' then ret = ret .. "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ' end return ret .. '${EXPLANATIONBLURB}' end, tooltip = '${TOOLTIPFRAGMENT} due to vandalism', } }, move = { dispute = { description = 'For pages protected against page moves due to' .. ' disputes over the page title.', explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', image = 'Padlock-olive.svg' }, vandalism = { description = 'For pages protected against' .. ' [[Wikipedia:Vandalism#Page-move vandalism' .. ' |page-move vandalism]].' } }, autoreview = {} },


-- -- GENERAL DATA TABLES --



-- Protection blurbs


-- This table produces the protection blurbs available with the -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and -- protection level, and is checked by the module in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, and autoreview subtables. protectionBlurbs = { edit = { default = 'This ${PAGETYPE} is currently ' .. 'protected from editing', autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access' .. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered' .. ' users|unregistered]] users is currently disabled' }, move = { default = 'This ${PAGETYPE} is currently protected' .. ' from page moves' }, autoreview = { autoconfirmed = 'All edits made to this ${PAGETYPE} by' .. ' new or' .. ' unregistered' .. ' users are currently' .. ' subject to review', default = 'All edits made to this ${PAGETYPE} by users who are not' .. ' reviewers or' .. ' administrators are currently' .. ' subject to review' } },



-- Explanation blurbs


-- This table produces the explanation blurbs available with the -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action, -- protection level, and whether the page is a talk page or not. If the page is -- a talk page it will have a talk key of "talk"; otherwise it will have a talk -- key of "subject". The table is checked in the following order: -- 1. page's protection action, page's protection level, page's talk key -- 2. page's protection action, page's protection level, default talk key -- 3. page's protection action, default protection level, page's talk key -- 4. page's protection action, default protection level, default talk key -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, and autoreview subtables. explanationBlurbs = { edit = { autoconfirmed = { subject = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details. If you' .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can' .. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]], log in, or' .. ' create an account.', default = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details. If you' .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]], log in, or' .. ' create an account.', }, default = { subject = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' administrator to make an edit if it' .. ' is [[Help:Minor edit#When to mark an edit as a minor edit' .. '|uncontroversial]] or supported by [[Wikipedia:Consensus' .. '|consensus]]. You may also [[Wikipedia:Requests for' .. ' page protection#Current requests for reduction in protection level' .. '|request]] that this page be unprotected.', default = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' You may [[Wikipedia:Requests for page' .. ' protection#Current requests for edits to a protected page|request an' .. ' edit]] to this page, or [[Wikipedia:Requests for' .. ' page protection#Current requests for reduction in protection level' .. '|ask]] for it to be unprotected.' } }, move = { default = { subject = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' The page may still be edited but cannot be moved' .. ' until unprotected. Please discuss any suggested moves on the' .. ' ${TALKPAGE} or at Wikipedia:Requested moves. You can also' .. ' request that the page be' .. ' unprotected.', default = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' The page may still be edited but cannot be moved' .. ' until unprotected. Please discuss any suggested moves at' .. ' Wikipedia:Requested moves. You can also' .. ' request that the page be' .. ' unprotected.' } }, autoreview = { default = { reviewer = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Edits to this ${PAGETYPE} will not be visible to readers' .. ' until they are accepted by a reviewer or an administrator.' .. ' To avoid the need for your edits to be reviewed, you may' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]]. Experienced editors may also' .. ' request the reviewer user right.', default = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Edits to this ${PAGETYPE} by new and unregistered users' .. ' will not be visible to readers until they are accepted by' .. ' a reviewer. To avoid the need for your edits to be' .. ' reviewed, you may' .. ' [[Wikipedia:Requests for page protection' .. '#Current requests for reduction in protection level' .. '|request unprotection]], log in, or' .. ' create an account.' }, } },


-- Protection levels


-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which -- produces a short label for different protection levels. It is sorted by -- protection action and proteciton level, and is checked in the following -- order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, and autoreview subtables. protectionLevels = { edit = { default = 'protected', templateeditor = 'template-protected', autoconfirmed = 'semi-protected', }, move = { default = 'move-protected' }, autoreview = { } },


-- Images


-- This table lists different padlock images for each protection action and -- protection level. It is used if an image is not specified in any of the -- banner data tables, and if the page does not satisfy the conditions for using -- the ['image-filename-indef'] image. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level images = { edit = { default = 'Padlock.svg', templateeditor = 'Padlock-pink.svg', autoconfirmed = 'Padlock-silver.svg' }, move = { default = 'Padlock-olive.svg', }, autoreview = { autoconfirmed = 'Padlock-silver-light.svg', default = 'Padlock-orange.svg' } },

-- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true },


-- Image links


-- This table provides the data for the ${IMAGELINK} parameter, which gets -- the image link for small padlock icons based on the page's protection action -- and protection level. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, and autoreview subtables. imageLinks = { edit = { default = 'Wikipedia:Protection policy#full', templateeditor = 'Wikipedia:Protection policy#template', autoconfirmed = 'Wikipedia:Protection policy#semi' }, move = { default = 'Wikipedia:Protection policy#move' }, autoreview = { autoconfirmed = 'Wikipedia:Protection policy#pc1', reviewer = 'Wikipedia:Protection policy#pc2' } },


-- Padlock indicator names


-- This table provides the "name" attribute for the Error: Page status indicators' name attribute must not be empty.