الفرق بين المراجعتين لصفحة: «وحدة:Lua banner»

تم حذف المحتوى تمت إضافة المحتوى
لا ملخص تعديل
لا ملخص تعديل
سطر 1:
-- This module implements the {{lua}} template.
local mMessageBoxyesno = require('وحدةModule:Message boxYesno')
 
local yesnomList = require('وحدةModule:YesnoList')
local mListmTableTools = require('وحدةModule:ListTableTools')
local mTableToolsmMessageBox = require('وحدةModule:TableToolsMessage box')
local mMessageBox = require('وحدة:Message box')
 
local p = {}
السطر 30 ⟵ 29:
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">خطأError: لمno تذكرmodules أي وحدةspecified</strong>'
else
local moduleLinks = {}
السطر 37 ⟵ 36:
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = 'هذاThis القالب يستعمل [[w:ar:ويكيبيديا:لوا|لوا]]:\n' .. moduleList
(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=Lua logo|link= w:ar:ويكيبيديا:لوا]]'
return mMessageBox.main('mbox', boxArgs)
end
السطر 71 ⟵ 72:
if not category then
local categories = {
['Module:String'] = 'قوالبLua تستندString-based على وحدة Stringtemplates',
['Module:Math'] = 'قوالبTemplates تستندbased علىon وحدةthe Math Lua module',
['Module:BaseConvert'] = 'قوالبTemplates تستندbased علىon وحدةthe BaseConvert Lua module',
['Module:Citation'] = 'قوالبLua-based استشهادcitation تستند على وحدة لواtemplates'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'قوالبLua-based تستند على وحدات لواtemplates'
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