Content deleted Content added
self. |
sync to live module |
||
(19 intermediate revisions by 13 users not shown) | |||
Line 3:
-- Initialise necessary modules.
require('
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
Line 171:
end
function Protection:
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
title.contentModel == 'javascript' or title.contentModel == 'css'
)▼
▲ end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
function Protection:isTemporary()
Line 189 ⟶ 196:
function Protection:makeProtectionCategory()
local cfg = self._cfg▼
local title = self.title▼
▲ if not self:isProtected() then
return ''
end
▲ local cfg = self._cfg
▲ local title = self.title
-- Get the expiry key fragment.
Line 318 ⟶ 324:
function Protection:isIncorrect()
local expiry = self.expiry
return not self:
or type(expiry) == 'number' and expiry < os.time()
end
Line 333 ⟶ 339:
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = {
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
Line 646 ⟶ 652:
function Blurb:_makeVandalTemplateParameter()
return mw.getCurrentFrame():expandTemplate{
title="vandal-m",
args={self._args.user or self._protectionObj.title.baseText} }
end
Line 836 ⟶ 843:
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
-- Initialise the blurb object
Line 847 ⟶ 854:
-- Render the banner
if protectionObj:
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
Line 858 ⟶ 865:
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
-- For arbitration enforcement, flagging [[WP:PIA]] pages to enable [[Special:AbuseFilter/1339]] to flag edits to them
if protectionObj.level == "extendedconfirmed" then
if require("Module:TableTools").inArray(protectionObj.title.talkPageTitle.categories, "Wikipedia pages subject to the extended confirmed restriction related to the Arab-Israeli conflict") then
ret[#ret + 1] = "<p class='PIA-flag' style='display:none; visibility:hidden;' title='This page is subject to the extended confirmed restriction related to the Arab-Israeli conflict.'></p>"
end
end
|