پودمان:Other uses of

از ویکی‌پدیا، دانشنامهٔ آزاد
توضیحات پودمان[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

استفاده[ویرایش]

{{#invoke:Other uses of|function_name}}

local mOtheruses = require('Module:Other uses')
local p = {}
p.otherusesof = function (frame)
	function getArg (num)
		local x = frame:getParent().args[num]
		return x ~= '' and x or nil
	end
	local currentTitle = mw.title.getCurrentTitle()
	local prefixedText = currentTitle.prefixedText
	local ofWhat = getArg(1) or prefixedText
	local page = getArg(2)
	local options = {
		title = ofWhat,
		otherText = string.format('کاربردهای «%s»', ofWhat)
	}
	local skipCat = currentTitle.isTalkPage or currentTitle.namespace == 2
	local oddCat = skipCat and '' or "[[رده:الگو:سرنویس که از پارامترهای غیر معمول استفاده می‌کند]]"
	if (mw.ustring.lower(getArg(1) or "") == mw.ustring.lower(prefixedText)) or
		((not getArg(1)) and not getArg(2)) then
			options.otherText = options.otherText .. oddCat
	end
	arg = page and {page} or {}
	return mOtheruses._otheruses(arg, options)
end
return p