Zum Inhalt springen

Modul:Protection banner: Unterschied zwischen den Versionen

add a Protection:isTemporary method
(add red padlocks when expiry is explicitly set to indefinite)
(add a Protection:isTemporary method)
Zeile 157: Zeile 157:
function Protection:isProtected()
function Protection:isProtected()
return self.level ~= '*'
return self.level ~= '*'
end
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
end


Zeile 512: Zeile 516:


function Blurb:_makeIntroBlurbParameter()
function Blurb:_makeIntroBlurbParameter()
if type(self._protectionObj.expiry) == 'number' then
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
return self:_getExpandedMessage('intro-blurb-expiry')
else
else
Zeile 599: Zeile 603:


function Blurb:_makeTooltipBlurbParameter()
function Blurb:_makeTooltipBlurbParameter()
if type(self._protectionObj.expiry) == 'number' then
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
else
Zeile 659: Zeile 663:
local action = protectionObj.action
local action = protectionObj.action
local level = protectionObj.level
local level = protectionObj.level
local expiry = protectionObj.expiry
local namespace = protectionObj.title.namespace
local namespace = protectionObj.title.namespace
Zeile 666: Zeile 669:
and action == 'edit'
and action == 'edit'
and level == 'sysop'
and level == 'sysop'
and (not expiry or expiry == 'indef')
and not protectionObj:isTemporary()
then
then
-- Fully protected modules and templates get the special red "indef"
-- Fully protected modules and templates get the special red "indef"
Anonymer Benutzer