Module:Protection banner: Difference between revisions

add catonly param which hides both the banner and padlock if set to yes. all testcases pass. tested in sandbox.
(Created page with "-- This module implements {{pp-meta}} and its daughter templates such as -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}. -- Initialise necessary modules. require('Module...")
 
w>ProcrastinatingReader
(add catonly param which hides both the banner and padlock if set to yes. all testcases pass. tested in sandbox.)
Line 843: Line 843:
-- protection from some other action, then don't bother displaying anything
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
-- for the other action (except categories).
if protectionObj.action == 'edit' or
if not yesno(args.catonly) and (protectionObj.action == 'edit' or
args.demolevel or
args.demolevel or
not getReachableNodes(
not getReachableNodes(
cfg.hierarchy,
cfg.hierarchy,
protectionObj.level
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)]
)[effectiveProtectionLevel('edit', protectionObj.title)])
then
then
-- Initialise the blurb object
-- Initialise the blurb object