Module:Request for permission links explained

local p = local getArgs = require('Module:Arguments').getArgs

function p.links(permission, parenthetical, username, userURL) local l = ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- To add a new link, find an empty line in the section below -- and add either a link or a wikilink, like so: -- -- l[#l+1] = '[URL external link]' -- l[#l+1] = 'wikilink' -- -- However, replace any instance of a username with: -- -- '..userURL..' -- For a [] URL/external link -- '..username..' -- For a wikilink -- -- Each new "l" (link string) will automatically have a spaced dot in -- the final output. To skip the spaced dot, add a line before with: -- -- before() -- -- See the existing links below for examples. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- local Before = -- Skip dots before 1, 2, 3. function before(replacement) Before[#l+1] = replacement end -- First links: 1. Userpage, 2. parenthetical (defined below in p.main) -- 3. User talk page, 4. User talk page history, 5. User contributions. l[1] = ''..username..'' l[2] = parenthetical l[3] = '(t' l[4] = 'th' l[5] = 'c' -- Permission-specific contributions links if permission

'Template editor' then before(' (') l[#l+1] = 'template space' l[#l+1] = 'edit requests)' elseif permission

'Page mover' then before(' (') l[#l+1] = 'RM/TR' l[#l+1] = 'RMs)' elseif permission

'File mover' then before(' (') l[#l+1] = 'file space)' end l[#l+1] = '

del' l[#l+1] = 'cross-wiki' l[#l+1] = 'SUL' l[#l+1] = 'edit counter'

if permission

'Event coordinator' then l[#l+1] = 'accounts created' elseif permission

'Template editor' then l[#l+1] = 'templates created' else l[#l+1] = 'pages created (xtools' l[#l+1] = 'sigma)' end

l[#l+1] = 'non-automated edits' l[#l+1] = 'BLP edits' l[#l+1] = 'undos' l[#l+1] = 'manual reverts' l[#l+1] = 'rollbacks' l[#l+1] = 'logs' before(' (') l[#l+1] = 'blocks' l[#l+1] = 'rights' l[#l+1] = 'moves)' if permission

'New page reviewer' then l[#l+1] = 'curation log' l[#l+1] = 'patrol log' l[#l+1] = 'AFD stats' l[#l+1] = 'AFC stats' l[#l+1] = 'CSD log' l[#l+1] = 'PROD log' l[#l+1] = 'Draftify log' l[#l+1] = 'Mainspace edits' elseif permission

'Page mover' then l[#l+1] = 'CSD log' end

l[#l+1] = 'rfar' l[#l+1] = 'spi' l[#l+1] = 'cci)' ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- New links should be somewhere above this line. -- Next, links for assigning permissions and notifying the user. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- before('

(') if permission

'AutoWikiBrowser' then l[#l+1] = "edit CheckPage)" else l[#l+1] = "assign permissions

]])" end local subpages = local templates = if permission then if templates[permission] then local templateURL = mw.ustring.gsub(permission..' granted', '%s', '%%20') local headingURL = templateURL if permission

'Rollback' then templateURL = templateURL..'%20'..'2' -- end before('(') l[#l+1] = 'notify)

' else l[#l] = l[#l]..'' end else before('(') for i=1,#subpages do if templates[subpages[i]] then local templateURL = mw.ustring.gsub(subpages[i]..' granted', '%s', '%%20') l[#l+1] = ''..templates[subpages[i]]..']' end end l[#l] = l[#l]..')' end -- All links should be within a plainlinks span Before[1] = '' l[#l] = l[#l]..'