الفرق بين المراجعتين لصفحة: «وحدة:Lua banner»
تم حذف المحتوى تمت إضافة المحتوى
Mr. Ibrahem (نقاش | مساهمات) لا ملخص تعديل |
لا ملخص تعديل |
||
سطر 1:
-- This module implements the {{lua}} template.
local
local
local
▲local mMessageBox = require('وحدة:Message box')
local p = {}
السطر 30 ⟵ 29:
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">
else
local moduleLinks = {}
السطر 37 ⟵ 36:
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = '
(mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
' uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=
return mMessageBox.main('mbox', boxArgs)
end
السطر 71 ⟵ 72:
if not category then
local categories = {
['Module:String'] = '
['Module:Math'] = '
['Module:BaseConvert'] = '
['Module:Citation'] = '
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or '
end
cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt = titleObj.protectionLevels["edit"][1]
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = "Templates using under-protected Lua modules"
break
end
end
end
|