Open main menu

Changes

Module:Protection banner

527 bytes added, 01:44, 28 May 2014
make outline of the main function
}
--[[-- Not currently usedlocal error_categories cfg.errorCategories = {
incorrect = 'Wikipedia pages with incorrect protection templates',
no_expiry noExpiry = 'Wikipedia protected pages without expiry',
create = 'Wikipedia pages tagged as create-protected',
template = 'Wikipedia template-protected pages other than templates and modules'
}
--]]
--------------------------------------------------------------------------------
function p._main(args)
-- Get the protection level of the title we are working on. local protectionLevel do local title if args.page then title = mw.title.new(args.page) else title = mw.title.getCurrentTitle() end local protectionData = p.getProtectionData(title) protectionLevel = protectionData[args.action or 'edit'] protectionLevel = protectionLevel or '*'
end
-- Generate the banner or padlock output. local protectionData ret = '' ret = ret .. p.renderBannerOrPadlock(protectionLevel, args) -- Add protection category if protectionLevel ~= '*' then ret = ret .. p.renderProtectionCategory(protectionLevel, args) end -- Add tracking categories ret = ret .. p.getProtectionDatarenderTrackingCategories(titleprotectionLevel, args) return ret
end
Anonymous user