Module:Find sources: Difference between revisions

m
Changed protection settings for "Module:Find sources": re-raise, 1.5million transclusions and no edits from the EXCON editor ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
m (Changed protection settings for "Module:Find sources": dropping per request of EXCON editor ([Edit=Require extended confirmed access] (indefinite) [Move=Require template editor access] (indefinite)))
imported>Primefac
m (Changed protection settings for "Module:Find sources": re-raise, 1.5million transclusions and no edits from the EXCON editor ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
local ROOT_PAGE = 'Module:Find sources'
local ROOT_PAGE = 'Module:Find sources'
local TEMPLATE_ROOT = ROOT_PAGE .. '/templates/' -- for template config modules
local TEMPLATE_ROOT = ROOT_PAGE .. '/templates/' -- for template config modules
local LINK_ROOT = ROOT_PAGE .. '/links/' -- for link config modules
local LINK_CONFIG = ROOT_PAGE .. '/links' -- for link config modules
local CONFIG_PAGE = ROOT_PAGE .. '/config' -- for global config
local CONFIG_PAGE = ROOT_PAGE .. '/config' -- for global config


Line 45: Line 45:


-- Get link config.
-- Get link config.
local linkCfg = maybeLoadData(LINK_ROOT .. code)
local links = maybeLoadData(LINK_CONFIG)
local linkCfg = links[code]
if not linkCfg then
if not linkCfg then
error(string.format(
error(string.format(
"invalid link code '%s'; no link config found at [[%s]]",
"invalid link code '%s'; no link config found at [[%s]]",
code,
code,
LINK_ROOT .. code
LINK_CONFIG
))
))
end
end
Anonymous user