Modulo:Criteri cancellazione immediata/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix
usa id del namespace
Riga 76:
-- Funzioni di utilità
-- =============================================================================
 
local function to_namespace_id(ns)
args. if ns == 'default' then
return ns
elseif args.ns == nil'Principale' then
return mw.site.namespaces[''].id
elseif ns ~= nil and ns ~= '' and mw.site.namespaces[ns] then
return mw.site.namespaces[ns].id
end
end
 
local function to_criterion(key, value)
Riga 81 ⟶ 91:
 
for ns, props in pairs(value) do
if ns == 'Principale' thento_namespace_id(ns)
ns = ''
end
 
if ns and type(props) == 'table' then
if type(props.ordine) == 'number' then
criterion:setOrder(props.ordine, ns)
Riga 184 ⟶ 192:
end
 
if args.ns == to_namespace_id(args.ns) or 'Principaledefault' then
args.ns = ''
elseif args.ns == nil then
args.ns = 'default'
end
 
if args['tipo elenco'] == nil or get_list_prefix(args['tipo elenco']) == nil then
Riga 212 ⟶ 216:
local args = get_args(frame)
 
if args.criterio and (mw.site.namespaces[args.ns] ~= nil or args.ns == 'default') then
return get_criterion(args)
end
Riga 220 ⟶ 224:
local args = get_args(frame)
 
if mw.site.namespaces[args.ns] ~= nil or args.ns == 'default' then
return list_criteria(args)
end