Open main menu

Changes

Module:Protection banner

232 bytes removed, 18:16, 28 June 2014
rm some locals that only get used once
--]]
local cats = cfg.protectionCategories
local cat
for i = 1, 2^noActive do
local key = {}
local attempt = cats[key]
if attempt then
cat = return makeCategoryLink(attempt break)
end
end
 
return makeCategoryLink(cat)
end
function Protection:makeExpiryCategory()
local reasonsWithoutExpiryCheck cfg = self._cfg.reasonsWithoutExpiryCheck local expiryCheckActions = self._cfg.expiryCheckActions local cat
if not self.expiry
and cfg.expiryCheckActions[self.action]
and self.reason -- the old {{pp-protected}} didn't check for expiry
and not cfg.reasonsWithoutExpiryCheck[self.reason]
then
cat = return makeCategoryLink(self._cfg.msg['tracking-category-expiry'])
end
return makeCategoryLink(cat)
end
function Protection:makeErrorCategory()
local cfg expiry = self._cfg local catexpiry
if not self:isProtected()
or type(self.expiry) == 'number' and self.expiry < os.time()
then
cat = cfgreturn makeCategoryLink(self._cfg.msg['tracking-category-incorrect'])
end
return makeCategoryLink(cat)
end
function Protection:makeTemplateCategory()
local cfg action, namespace = self._cfg local title = action, self.title local cat.namespace
if self.level == 'templateeditor'
and (
(self.action ~= 'edit' and self.action ~= 'move') or (title.namespace ~= 10 and title.namespace ~= 828)
)
then
cat = cfgreturn makeCategoryLink(self._cfg.msg['tracking-category-template'])
end
return makeCategoryLink(cat)
end
function Blurb.makeFullUrl(page, query, display)
local url = mw.uri.fullUrl(page, query) url = tostring(url) return string.format( '[%s %s]', url tostring(mw.uri.fullUrl(page, query)), display )
end
-- Private methods --
function Blurb:_getExpandedMessage(msgmsgKey) local msg = return self:_substituteParameters(self._cfg.msg[msgmsgKey] return self:_substituteParameters(msg)
end
Anonymous user