Module:Uses TemplateStyles:修订间差异
小 已保护“Module:Uses TemplateStyles”:高風險模板:500引用<!-- 機器人3 -->([编辑=仅允许自动确认用户](无限期)[移动=仅允许自动确认用户](无限期)) |
小 导入1个版本 |
||
| (未显示2个用户的2个中间版本) | |||
| 第4行: | 第4行: | ||
local mTableTools = require('Module:TableTools') | local mTableTools = require('Module:TableTools') | ||
local mMessageBox = require('Module:Message box') | local mMessageBox = require('Module:Message box') | ||
local TrackingCategory = require('Module:TrackingCategory') | |||
local p = {} | local p = {} | ||
| 第27行: | 第28行: | ||
local tStyles = mTableTools.compressSparseArray(args) | local tStyles = mTableTools.compressSparseArray(args) | ||
local box = p.renderBox(tStyles) | local box = p.renderBox(tStyles) | ||
p.renderTrackingCategories(args, tStyles) | |||
return box | return box | ||
end | end | ||
| 第90行: | 第91行: | ||
for i, ts in ipairs(tStyles) do | for i, ts in ipairs(tStyles) do | ||
local tsTitleObj = mw.title.new(ts) | local tsTitleObj = mw.title.new(ts) | ||
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil | if (tsTitleObj or {}).protectionLevels then --能夠讀取保護狀態的標題 | ||
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil | |||
if tsProt ~= currentProt then | |||
cats[#cats + 1] = "使用模板样式并受保护的模板" | |||
break | |||
end | |||
end | end | ||
end | end | ||
end | end | ||
local frame = mw.getCurrentFrame() | |||
for i, cat in ipairs(cats) do | for i, cat in ipairs(cats) do | ||
TrackingCategory.append(frame,cat) | |||
end | end | ||
end | end | ||
return p | return p | ||