মডিউল:সুরক্ষিত পাতা সম্পাদনার অনুরোধ/সক্রিয়

উইকিপিডিয়া, মুক্ত বিশ্বকোষ থেকে
মডিউল নথি[তৈরি করুন]
require('মডিউল:No globals')

local yesno, makeMessageBox -- মডিউল:সুরক্ষিত পাতা সম্পাদনার অনুরোধ
local makeToolbar = require('মডিউল:Toolbar')._main
local getPagetype = require('মডিউল:Pagetype')._main
local effectiveProtectionLevel = require('মডিউল:Effective protection level')._main

----------------------------------------------------------------------
-- সহায়ক কার্যাদি
----------------------------------------------------------------------

local function makeWikilink(page, display)
	if display then
		return mw.ustring.format('[[%s|%s]]', page, display)
	else
		return mw.ustring.format('[[%s]]', page)
	end
end

----------------------------------------------------------------------
-- শিরোনাম শ্রেণি
----------------------------------------------------------------------

-- এটি মূলত মিডিয়াউইকি শিরোনাম শ্রেণীর মধ্যে কিছু অতিরিক্ত নিক্ষিপ্ত রেখে দেওয়া হয়েছে।

local title = {}
title.__index = title

function title.getProtectionLevelText(protectionLevel)
	-- নোঙ্গর এবং ইউআরএন ব্যবহার করতে লেখা পায়।
	local levels = {unprotected = 'editunprotected', autoconfirmed = 'editsemiprotected', sysop = 'editprotected', interfaceadmin = 'editinterfaceprotected'}
	return levels[protectionLevel]
end

function title.new(...)
	local success, obj = pcall(mw.title.new, ...)
	if not (success and obj) then return end

	-- একটি সুরক্ষাভিত্তিক বৈশিষ্ট্য যুক্ত করুন।
	obj.protectionLevel = effectiveProtectionLevel(obj.exists and 'edit' or 'create', obj)
	if obj.protectionLevel == '*' then
		-- অ-সুরক্ষিত পাতা তৈরি করুন return "unprotected".
		obj.protectionLevel = 'unprotected'
	elseif obj.protectionLevel == 'user' then
		-- আমাদের কেবল নিবন্ধিত হওয়া প্রয়োজন, আমাদের কেবল স্বয়ংনিশ্চিতকৃত হওয়ার প্রচেষ্টা করা, যেহেতু এটি আমাদের নিকটতম জিনিস।
		obj.protectionLevel = 'autoconfirmed'
	end

	-- একটি পাতার ধরণের বৈশিষ্ট্য যুক্ত করুন।
	obj.pagetype = getPagetype{page = obj.prefixedText, defaultns = 'all'}
	
	-- লিংক তৈরির পদ্ধতি যুক্ত করুন।
	function obj:makeUrlLink(query, display)
		return mw.ustring.format('[%s %s]', self:fullUrl(query), display)
	end

	function obj:makeViewLink(display)
		return self:makeUrlLink({redirect = 'no'}, display)
	end

	function obj:makeEditLink(display)
		return self:makeUrlLink({action = 'edit'}, display)
	end

	function obj:makeHistoryLink(display)
		return self:makeUrlLink({action = 'history'}, display)
	end

	function obj:makeLastEditLink(display)
		return self:makeUrlLink({diff = 'cur', oldid = 'prev'}, display)
	end

	function obj:makeWhatLinksHereLink(display)
		return makeWikilink('বিশেষ:সংযোগকারী_পৃষ্ঠাসমূহ/' .. self.prefixedText, display)
	end

	function obj:makeCompareLink(otherTitle, display)
		display = display or 'diff'
		local comparePagesTitle = title.new('বিশেষ:পাতার_তুলনা')
		return comparePagesTitle:makeUrlLink({page1 = self.prefixedText, page2 = otherTitle.prefixedText}, display)
	end

	function obj:makeLogLink(logType, display)
		local logTitle = title.new('বিশেষ:লগ')
		return logTitle:makeUrlLink({type = logType, page = self.prefixedText}, display)
	end

	function obj:urlEncode()
		return mw.uri.encode(self.prefixedText, 'WIKI')
	end

	function obj:makeUrnLink(boxProtectionLevel)
		-- একটি উত্পাদ ইউআরএন লিংক। সুরক্ষা স্তর সুরক্ষাস্তর টেমপ্লেট থেকে নেওয়া হয়, বরং পাতা থেকে নিজেই সনাক্ত করা,
		-- যেহেতু সনাক্তকরণটি ২০১৩ সালের নভেম্বর পর্যন্ত ক্যাসকেড-সুরক্ষিত এবং শিরোনাম-কালো তালিকাভুক্ত পাতাগুলির জন্য ভুল হতে পারে।
		local protectionLinkText = title.getProtectionLevelText(boxProtectionLevel)
		return mw.ustring.format('[urn:x-wp-%s:%s <span></span>]', protectionLinkText, self:urlEncode())
	end

	-- একটি উপপাতা শিরোনাম বস্তু নিন, তবে অ-সুরক্ষিত ব্যবহারের চেয়ে প্যাকল দিয়ে যান mw.title:subPageTitle.
	function obj:getSubpageTitle(subpage)
		return title.new(self.prefixedText .. '/' .. subpage)
	end
	
	return obj
end

----------------------------------------------------------------------
-- শিরোনাম টেবিল শ্রেণি
----------------------------------------------------------------------

local titleTable = {}
titleTable.__index = titleTable

function titleTable.new(args)
	-- সংখ্যাগত যুক্তি নিন এবং তাদের প্রত্যেকের জন্য শিরোনাম বস্তু তৈরি করুন।
	local nums = {}
	for k, v in pairs(args) do
		if type(k) == 'number' then
			table.insert(nums, k)
		end
	end
	table.sort(nums)
	local titles = {}
	for _, num in ipairs(nums) do
		local title = title.new(args[num])
		table.insert(titles, title)
	end
	-- বর্তমান শিরোনাম নিন, এবং শিরোনাম নির্দিষ্ট না করা থাকলে বিষয়টির শিরোনাম নিন।
	titles.currentTitle = mw.title.getCurrentTitle()
	if #titles < 1 then
		local subjectNs = titles.currentTitle.subjectNsText
		if subjectNs ~= '' then
			subjectNs = subjectNs .. ':'
		end
		table.insert(titles, title.new(subjectNs .. titles.currentTitle.text))
	end
	-- মেটাটেবল সেট করুন।
	setmetatable(titles, titleTable)
	return titles
end

function titleTable:memoize(memoField, func, ...)
	if self[memoField] ~= nil then
		return self[memoField]
	else
		self[memoField] = func(...)
		return self[memoField]
	end
end

function titleTable:titleIterator()
	local i = 0
	local n = #self
	return function()
		i = i + 1
		if i <= n then
			return self[i]
		end
	end
end

function titleTable:hasSameProperty(memoField, getPropertyFunc)
	-- যদি শিরোনাম সারণিতে একাধিক শিরোনাম থাকে, তাদের একই বৈশিষ্ট্য আছে কিনা তা পরীক্ষা করে দেখুন।
	-- বৈশিষ্ট্য পাওয়া ফান্ট ফাংশন ব্যবহার করে বৈশিষ্ট্যটি পাওয়া যায়, যা একটি একক যুক্তি হিসাবে একটি শিরোনাম বস্তু লাগবে।
	
	local function hasSameProperty(getPropertyFunc)
		local property
		for i, obj in ipairs(self) do
			if i == 1 then
				property = getPropertyFunc(obj)
			elseif getPropertyFunc(obj) ~= property then
				return false
			end
		end
		return true
	end

	return self:memoize(memoField, hasSameProperty, getPropertyFunc)
end	

function titleTable:hasSameExistenceStatus()
	-- সমস্ত শিরোনাম উপস্থিত থাকলে সত্য ফিরে আসে, বা যদি সেগুলির সবই না থাকে। অস্তিত্বের স্থিতির মিশ্রণ থাকলে মিথ্যা ফেরত দিন।
	return self:hasSameProperty('sameExistenceStatus', function (title) return title.exists end)
end

function titleTable:hasSameProtectionStatus()
	-- সমস্ত শিরোনামে একই সুরক্ষার স্থিতি রয়েছে কিনা তা পরীক্ষা করুন (যদি অন্যত্র তৈরির সুরক্ষিত হয় বা সম্পাদনা-সুরক্ষার জন্য - দুটি মিশ্রিত হয় না).
	local sameExistenceStatus = self:hasSameExistenceStatus()
	if sameExistenceStatus then
		return self:hasSameProperty('sameProtectionStatus', function (title) return title.protectionLevel end)
	else
		return sameExistenceStatus
	end
end

function titleTable:hasSamePagetype()
	-- সমস্ত শিরোনামের পাতার ধরন একই আছে কিনা তা পরীক্ষা করে দেখুন।
	return self:hasSameProperty('samePagetype', function (title) return title.pagetype end)
end

function titleTable:propertyExists(memoField, getPropertyFunc)
	-- নির্দিষ্ট বৈশিষ্ট্য সহ কোনও শিরোনাম বিদ্যমান রয়েছে কিনা তা পরীক্ষা করুন।
	-- বৈশিষ্ট্য পাওয়া ফান্ট ফাংশন ব্যবহার করে বৈশিষ্ট্যটি পাওয়া যায়, যা একটি একক যুক্তি হিসাবে একটি শিরোনাম বস্তু গ্রহণ করে
	-- এবং একটি বুলিয়ান মান প্রদান করা উচিত।
	local function propertyExists(getPropertyFunc)
		for titleObj in self:titleIterator() do
			if getPropertyFunc(titleObj) then
				return true
			end
		end
		return false
	end
	return self:memoize(memoField, propertyExists, getPropertyFunc)
end

function titleTable:hasNonInterfacePage()
	return self:propertyExists('nonInterfacePage', function (titleObj) return titleObj.namespace ~= 8 end)
end

function titleTable:hasTemplateOrModule()
	return self:propertyExists('templateOrModule', function (titleObj) return titleObj.namespace == 10 or titleObj.namespace == 828 end)
end

function titleTable:hasNonTemplateOrModule()
	return self:propertyExists('nontemplateormodule', function (titleobj) return titleobj.namespace ~= 10 and titleobj.namespace ~= 828 end)
end

function titleTable:hasOtherProtectionLevel(level)
	for titleObj in self:titleIterator() do
		if titleObj.protectionLevel ~= level then
			return true
		end
	end
	return false
end

function titleTable:getProtectionLevels()
	local function getProtectionLevels()
		local levels = {}
		for titleObj in self:titleIterator() do
			local level = titleObj.protectionLevel
			levels[level] = true
		end
		return levels
	end
	return self:memoize('protectionLevels', getProtectionLevels)
end

----------------------------------------------------------------------
-- সংক্ষিপ্ত প্রচারলিপি শ্রেণীর সংজ্ঞা
----------------------------------------------------------------------

local blurb = {}
blurb.__index = blurb

function blurb.new(titleTable, boxProtectionLevel)
	local obj = {}
	obj.titles = titleTable
	obj.boxProtectionLevel = boxProtectionLevel
	obj.linkCount = 0 -- Counter for the number of total items in the object's link lists. 
	setmetatable(obj, blurb)
	return obj
end

-- স্থির পদ্ধতি --

function blurb.makeParaText(name, val)
	local pipe = mw.text.nowiki('|')
	local equals = mw.text.nowiki('=')
	val = val and ("''" .. val .. "''") or ''
	return mw.ustring.format('<code style="white-space: nowrap;">%s%s%s%s</code>', pipe, name, equals, val)
end

function blurb.makeTemplateLink(s)
	return mw.ustring.format('%s[[Template:%s|%s]]%s', mw.text.nowiki('{{'), s,	s, mw.text.nowiki('}}'))
end

function blurb:makeProtectionText()
	local boxProtectionLevel = self.boxProtectionLevel
	local levels = {['*'] = 'unprotected', autoconfirmed = 'semi-protected', sysop = 'fully protected', interfaceadmin = 'interface-protected'}
	for level, protectionText in pairs(levels) do
		if level == boxProtectionLevel then
			return mw.ustring.format('[[Help:Protection|%s]]', protectionText)
		end
	end
	error('অজানা সুরক্ষা স্তর' .. boxProtectionLevel)
end

function blurb.getPagetypePlural(title)
	local pagetype = title.pagetype
	if pagetype == 'category' then
		return 'categories'
	else
		return pagetype .. 's'
	end
end

-- সাধারণ পদ্ধতি --

function blurb:makeLinkList(title)
	local tbargs = {} -- The argument list to pass to মডিউল:Toolbar
	tbargs.style = 'font-size: smaller;'
	tbargs.separator = 'dot'
	-- পাতার লিংক
	table.insert(tbargs, title:makeEditLink('edit'))
	table.insert(tbargs, title:makeHistoryLink('history'))
	table.insert(tbargs, title:makeLastEditLink('last'))
	table.insert(tbargs, title:makeWhatLinksHereLink('links'))
	-- খেলাঘর লিংক.
	local sandboxTitle = title:getSubpageTitle('খেলাঘর')
	if sandboxTitle and sandboxTitle.exists then
		table.insert(tbargs, sandboxTitle:makeViewLink('খেলাঘর'))
		table.insert(tbargs, sandboxTitle:makeEditLink('edit sandbox'))
		table.insert(tbargs, sandboxTitle:makeHistoryLink('sandbox history'))
		table.insert(tbargs, sandboxTitle:makeLastEditLink('sandbox last edit'))
		table.insert(tbargs, title:makeCompareLink(sandboxTitle, 'sandbox diff'))
	end
	-- পরীক্ষার কেস লিংক।
	local testcasesTitle = title:getSubpageTitle('testcases')
	if testcasesTitle and testcasesTitle.exists then
		table.insert(tbargs, testcasesTitle:makeViewLink('test cases'))
	end
	-- প্রতিস্থাপনের গণনা লিংক.
	if title.namespace == 10 or title.namespace == 828 then -- Only add the transclusion count link for templates and modules.
		local tclink = mw.uri.new{
			host = 'tools.wmflabs.org',
			path = '/templatecount/index.php',
			query = {
				lang = 'bn',
				name = title.text,
				namespace = title.namespace,
			},
			fragment = 'bottom'
		}
		tclink = string.format('[%s transclusion count]', tostring(tclink))
		table.insert(tbargs, tclink)
	end
	-- সুরক্ষা লগ লিংক.
	if title.namespace ~= 8 then -- MediaWiki pages don't have protection log entries.
		table.insert(tbargs, title:makeLogLink('protect', 'protection log'))
	end
	self.linkCount = self.linkCount + #tbargs -- বিষয় দ্বারা তৈরি মোট লিংকের সংখ্যাটি অনুসরণ করুন
	return makeToolbar(tbargs)
end

function blurb:makeLinkLists()
	local titles = self.titles
	if #titles == 1 then
		return self:makeLinkList(titles[1])
	else
		local ret = {}
		table.insert(ret, '<ul>')
		for i, titleObj in ipairs(titles) do
			table.insert(ret, mw.ustring.format('<li>%s %s</li>', titleObj:makeViewLink(titleObj.prefixedText), self:makeLinkList(titleObj)))
		end
		table.insert(ret, '</ul>')
		return table.concat(ret)
	end
end

function blurb:makeIntro()
	local titles = self.titles
	local requested = '[[উইকিপিডিয়া:সম্পাদনার অনুরোধ|অনুরোধ]] করা হচ্ছে যে'
	local protectionText
	if titles:hasNonInterfacePage() then
		protectionText = ' ' .. self:makeProtectionText()
	else
		protectionText = '' -- ইন্টারফেস পাতাগুলি অ-সুরক্ষিত করা যায় না, তাই আমাদের পরিষ্কারভাবে সেগুলি সুরক্ষিত বলার দরকার নেই।
	end
	-- আমাদের একাধিক শিরোনাম উত্তীর্ণ হয় এমন ক্ষেত্রে মোকাবেলা করুন।
	if #titles > 1 then
		local pagetype
		if titles:hasSamePagetype() then
			pagetype = blurb.getPagetypePlural(titles[1])
		else
			pagetype = 'pages'
		end
		return mw.ustring.format("'''%s edits be made to the following%s %s''':", requested, protectionText, pagetype)
	end
	-- আমাদের কেবল একটি শিরোনাম পাশ করা হয়েছে এমন ক্ষেত্রে মোকাবেলা করুন।
	local title = titles[1]
	local stringToFormat
	if title.exists then
		stringToFormat = '%s an edit be made to the%s %s at %s.'
	else
		stringToFormat = '%s the%s %s at %s be created.'
	end
	stringToFormat = "'''" .. stringToFormat .. "'''"
	return mw.ustring.format(stringToFormat, requested, protectionText, title.pagetype, title:makeViewLink(title.prefixedText))
end

function blurb:makeBody()
	local titles = self.titles
	local protectionLevels = titles:getProtectionLevels()
	local boxProtectionLevel = self.boxProtectionLevel
	local hasNonInterfacePage = titles:hasNonInterfacePage()
	local isPlural = false
	if #titles > 1 then
		isPlural = true
	end

	local descriptionText = "এই অনুরোধ টেমপ্লেটের দ্বারা '''সম্পূর্ণ এবং নির্দিষ্ট বিবরণ''' অনুসরণ করা উচিত, "
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' then
		local editText = 'edit'
		if isPlural then
			editText = editText .. 's'
		end
		local descriptionCompleteText = mw.ustring.format('so that an editor unfamiliar with the subject matter could complete the requested %s immediately.', editText)
		descriptionText = descriptionText .. descriptionCompleteText
	else
		descriptionText = descriptionText .. 'এটাই, কোন পাঠ্য অপসারণ করা উচিত তা উল্লেখ করুন এবং পাঠ্যের একটি আক্ষরিক অনুলিপি যা এটিতে প্রতিস্থাপন করা উচিত।'
			.. [["দয়া করে ''ক'' পরিবর্তন করুন এটি '''গ্রহণযোগ্য নয়''' এবং প্রত্যাখ্যাত হবে; অনুরোধ '''অবশ্যই''' ফর্মের হতে হবে ''দয়া করে'' ''ক'' কে ''খ'' তে পরিবর্তন করুন''।]]
	end

	local smallText = ''
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' then
		local templateFullText
		if boxProtectionLevel == 'sysop' then
			templateFullText = 'fully protected'
		elseif boxProtectionLevel == 'templateeditor' then
			templateFullText = 'template-protected'
		end
		smallText =	'Edit requests to ' .. templateFullText	.. " pages should only be used for edits that are either '''uncontroversial''' or supported by [[Wikipedia:Consensus|consensus]]."
			.. " If the proposed edit might be controversial, discuss it on the protected page's talk page '''before''' using this template."
	else
		local userText
		local responseTemplate
		if boxProtectionLevel == 'autoconfirmed' then
			userText = '[[উইকিপিডিয়া:ব্যবহারকারী অধিকার স্তর#স্বয়ংনিশ্চিতকৃত ও নিশ্চিতকৃত ব্যবহারকারীগণ|স্বয়ংনিশ্চিতকৃত]] ব্যবহারকারী'
			responseTemplate = blurb.makeTemplateLink('ESp')
		elseif boxProtectionLevel == 'interfaceadmin' then
			userText = '[[উইকিপিডিয়া:ব্যবহারকারী অধিকার স্তর#ইন্টারফেস প্রশাসক|ইন্টারফেস প্রশাসক]]'
			responseTemplate = blurb.makeTemplateLink('EIp')
		else
			userText = 'user'
			responseTemplate = blurb.makeTemplateLink('ESp')
		end
		local answeredPara = blurb.makeParaText('answered', 'no')
		local stringToFormat =	'সম্পাদনা যে কারর দ্বারা করা যেতে পারে %s. '
			.. [[মনে রাখবেন যখন অনুরোধ গৃহীত হবে %s  কে "'''হ্যাঁ'''" তে পরিবর্তন করতে ভুলবেন না, প্রত্যাখ্যান করা বা ব্যবহারকারীর উত্তরের জন্য অপেক্ষা করে ধরে রাখা।]]
			.. "এটি এমন যাতে নিষ্ক্রিয় বা সমাপ্ত অনুরোধগুলি অনাবশ্যকভাবে সম্পাদনার অনুরোধ বিভাগটি পূরণ না করে।"
			.. 'আপনি প্রতিক্রিয়াতে %s টেম্পলেটটিও ব্যবহার করতে চাইতে পারেন।'
		smallText = mw.ustring.format(stringToFormat, userText, answeredPara, responseTemplate)
	end

	if not isPlural then
		local title = titles[1]
		if title.namespace == 10 or title.namespace == 828 then
			local sandboxTitle = title:getSubpageTitle('খেলাঘর')
			if sandboxTitle and sandboxTitle.exists then
				smallText = smallText .. ' প্রথমে পরিবর্তনগুলি বিবেচনা করুন '
					.. sandboxTitle:makeViewLink(title.pagetype .. "'s sandbox")
				local testcasesTitle = title:getSubpageTitle('testcases')
				if testcasesTitle and testcasesTitle.exists then
					smallText = smallText .. ' and ' .. testcasesTitle:makeViewLink('test them thoroughly here')
				end
				smallText = smallText .. ' before submitting an edit request.'
			end
		end
	end
	if hasNonInterfacePage then
		smallText = smallText .. ' কোনও পাতা সুরক্ষিত বা অ-সুরক্ষিত করতে [[উইকিপিডিয়া:পাতা সুরক্ষার আবেদন|পাতা সুরক্ষার আবেদন]] পাতায় অনুরোধ করুন।'
	end
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'interfaceadmin' then
		smallText = smallText .. ' অনুরোধটি সম্পন্ন বা অস্বীকৃত হয়ে গেলে, দয়া করে যুক্ত করুন' .. blurb.makeParaText('answered', 'yes') .. ' parameter to deactivate the template.'
	end
	return mw.ustring.format('%s\n<p style="font-size:smaller; line-height:1.3em;">\n%s\n</p>', descriptionText, smallText)
end

function blurb:export()
	local intro = self:makeIntro()
	local linkLists = self:makeLinkLists()
	local body = self:makeBody()
	-- Start long links lists on a new line.
	local linkListSep = ' '
	if self.linkCount > 5 then
		linkListSep = '<br/>'
	end
	return mw.ustring.format('%s%s%s\n\n%s', intro, linkListSep, linkLists, body)
end

----------------------------------------------------------------------
-- এটি মডিউল:সুরক্ষিত পাতা সম্পাদনার অনুরোধ উপশ্রেণী সক্রিয় বাক্সগুলির জন্য বক্সশ্রেণী
----------------------------------------------------------------------

local box = {}
box.__index = box

function box.new(protectionType, args)
	-- এখানে ব্যবহৃত উত্তরাধিকার ব্যবস্থায়, কোন বস্তুর মেটাটেবল তার বর্গ, এবং একটি শ্রেণীর মেটাটেটেবল হলো তার সুপারক্লাস
	local obj = getmetatable(box).new(protectionType, args)
	setmetatable(obj, box)
	local boxProtectionLevels = {semi = 'autoconfirmed', full = 'sysop', interface = 'interfaceadmin'}
	obj.boxProtectionLevel = boxProtectionLevels[protectionType]
	obj.demo = yesno(args.demo)
	-- Set dependent objects.
	obj.titles = titleTable.new(args)
	if not yesno(args.force) and obj.titles:hasSameProperty('sameProtectionStatus', function (title) return title.protectionLevel end) and obj.titles[1].protectionLevel ~= 'unprotected' then
		obj.boxProtectionLevel = obj.titles[1].protectionLevel
	end
	obj.blurb = blurb.new(obj.titles, obj.boxProtectionLevel)
	return obj
end

function box:setImage()
	local titles = self.titles
	local boxProtectionLevel = self.boxProtectionLevel
	local padlock
	if boxProtectionLevel == 'sysop' then
		padlock = 'Full-protection-shackle.svg'
	elseif boxProtectionLevel == 'interfaceadmin' then
		padlock = 'Interface-protection-shackle.svg'
	elseif boxProtectionLevel == 'autoconfirmed' then
		padlock = 'Semi-protection-shackle.svg'
	else
		padlock = 'Padlock-bronze-open.svg'
	end
	local stringToFormat = '[[File:%s|%dpx|alt=|link=]]'
	local smallPadlock = mw.ustring.format(stringToFormat, padlock, 25)
	local largePadlock = mw.ustring.format(stringToFormat, padlock, 60)
	self:setArg('smallimage', smallPadlock)
	self:setArg('image', largePadlock)
end

function box:buildUrnLinks()
	local ret = {}
	local boxProtectionLevel = self.boxProtectionLevel
	for titleObj in self.titles:titleIterator() do
		table.insert(ret, titleObj:makeUrnLink(boxProtectionLevel))
	end
	return mw.ustring.format('<span class="plainlinks" style="display:none">%s</span>', table.concat(ret))
end

function box:setBlurbText()
	self:setArg('text', self.blurb:export() .. self:buildUrnLinks())
end

function box:exportRequestTmbox()
	self:setImage()
	self:setBlurbText()
	self:setArg('class', 'editrequest')
	self:setArg('id', title.getProtectionLevelText(self.boxProtectionLevel)) -- নোঙ্গরের জন্য। হ্যাঁ, এটি একই আইডি সহ একাধিক উপাদানকে নিয়ে যায়। আমাদের সম্ভবত এটি এক পর্যায়ে ঠিক করা উচিত
	return makeMessageBox('tmbox', self.tmboxArgs)
end

function box:exportRequestCategories()
	local cats = {}
	local boxProtectionLevel = self.boxProtectionLevel
	local function addCat(cat)
		table.insert(cats, mw.ustring.format('[[Category:%s]]', cat))
	end
	local protectionCats = {
		autoconfirmed = 'Wikipedia semi-protected edit requests',
		sysop = 'Wikipedia fully-protected edit requests',
		interfaceadmin = 'Wikipedia interface-protected edit requests'
	}
	addCat(protectionCats[boxProtectionLevel])
	if self.titles:hasOtherProtectionLevel(boxProtectionLevel) then
		addCat('উইকিপিডিয়া সম্পাদনার অনুরোধ সম্ভবত ভুল টেম্পলেট ব্যবহার করা হয়েছে')
	end
	return table.concat(cats)
end

function box:export()
	if not self.titles.currentTitle.isTalkPage and not self.demo then
		return '<span class="error">ত্রুটি: সুরক্ষিত পাতার সম্পাদনার অনুরোধগুলি কেবল আলাপ পাতায় করা যেতে পারে।</span>[[বিষয়শ্রেণী:সম্পাদনা অনুরোধ টেমপ্লেট ব্যবহার করা হয়েছে যা আলাপ পাতা নয়]]'
	end
	local ret = {}
	table.insert(ret, self:exportRequestTmbox())
	if not self.demo then
		table.insert(ret, self:exportRequestCategories())
	end
	return table.concat(ret)
end

----------------------------------------------------------------------
-- ফাংশন রফতানি হয়েছে মডিউল:সুরক্ষিত পাতা সম্পাদনার অনুরোধ
----------------------------------------------------------------------

return function(superclass, yn, mb)
	yesno = yn
	makeMessageBox = mb
	return setmetatable(box, superclass)
end