模块:AutoUGroup:修订间差异

添加174字节 、​ 2023年8月2日 (星期三)
无编辑摘要
无编辑摘要
无编辑摘要
第3行: 第3行:
local p = {}
local p = {}


local function genGroupWT(group,useIcon)
local function genGroupWT(group,useIcon,useCat)
local res=""
local res=""
if(useIcon) then
if(useIcon) then
第9行: 第9行:
end
end
res=res.."[["..group.link.."|"..group.name.."]]"
res=res.."[["..group.link.."|"..group.name.."]]"
res=res.."[[Category:"..group.cat.."]]"
if(useCat) then
res=res.."[[Category:"..group.cat.."]]"
end
return res
return res
end
end
第15行: 第17行:
function p.group(frame)
function p.group(frame)
local icon
local icon
local cat
local args = require('Module:Arguments').getArgs(frame)
local args = require('Module:Arguments').getArgs(frame)
if(args["icon"]==nil) then
if(args["icon"]==nil) then
第21行: 第24行:
icon = yesno(args["icon"],true)
icon = yesno(args["icon"],true)
end
end
if(args[1]==nil) then
if(args["cat"]==nil) then
cat = true
else
cat = yesno(args["cat"],true)
end
if(args[1]==nil and cat) then
return "[[分类:模板参数填写错误的条目]]"
return "[[分类:模板参数填写错误的条目]]"
end
end
第27行: 第35行:
for txtk,txtv in ipairs(gv.str) do
for txtk,txtv in ipairs(gv.str) do
if(txtv==args[1]) then
if(txtv==args[1]) then
return genGroupWT(gv,icon)
return genGroupWT(gv,icon,cat)
end
end
end
end
end
end
return args[1].."[[分类:模板参数填写错误的条目]]"
if(cat) then
return args[1].."[[分类:模板参数填写错误的条目]]"
else
return ""
end
end
end


return p
return p
维护员、​界面管理员、​巡查员、​监督员、​小部件编辑者
3,469

个编辑