pet是什么意思| 伐木累是什么意思| 夏天用什么护肤品比较好| 漂洗和洗涤有什么区别| 怀孕10天有什么症状| 小孩出冷汗是什么原因| 拔苗助长告诉我们什么道理| 清华大学校长什么级别| zara是什么意思| dl什么意思| 皮肤痒用什么药膏| 肾功能检查挂什么科| 属龙什么命| 什么人喜欢天天下雨| 就诊卡是什么| 酩酊是什么意思| 鹿五行属什么| 总出虚汗什么原因怎么解决| 东星斑为什么这么贵| 什么食物养胃| 铁蛋白低是什么意思| 稀松平常是什么意思| 狗狗流鼻涕吃什么药| 尧五行属什么| 1年是什么朝代| 什么是认证| 上海话册那什么意思| 下一个台风什么时候来| 绞丝旁一个奇念什么| 面藕是什么| 黄疸严重会造成什么后果| 吃什么能让月经快点来| pigeon是什么意思| 糖尿病适合吃什么水果| 中元节出什么生肖| 10月28号是什么星座| 梦见邻居是什么意思| 脚底红是什么原因| 肺结节吃什么中成药| 同房出血要做什么检查| 全身瘙痒是什么原因| 吃什么东西对心脏好| 什么人容易得天疱疮| aww是什么意思| 买什么保险最好最划算| 尿道发炎吃什么药| 嗓子痒咳嗽是什么原因| 非甾体抗炎药是什么意思| 三个土是什么字怎么读| 腿血栓什么症状| 直肠给药对小孩身体有什么影响| 女性绝经前有什么症状| 普高和职高有什么区别| 脉滑是什么意思| 蕌头是什么| 右后背疼是什么病| affairs是什么意思| 合肥有什么好吃的| 头皮一阵一阵发麻是什么原因| 14k金是什么意思| 1.16是什么星座| 夏对什么| 肌酐激酶高是什么原因| b是什么牌子| 以爱之名什么意思| 蓝姓是什么民族| 滴虫性阴炎有什么症状表现| 柠檬酸是什么东西| cph是什么意思| 痿是什么意思| 黄芪味道是什么味道| 什么水果可以解酒| 婴儿口水多是什么原因| 人生是什么| 双花红棍什么意思| 室性期前收缩是什么病| 大腿前侧肌肉叫什么| 火华读什么| 吃什么能让头发变黑| 慢性胃炎和浅表性胃炎有什么区别| 靖国神社是什么| 肝不好吃什么| 白醋泡脚有什么功效| 显妣是什么意思| 港币长什么样| 丙申五行属什么| 为什么胃有灼热感| 偷鸡不成蚀把米什么意思| 豆浆喝多了有什么坏处| 申字五行属什么| 脾不好吃什么药| 典型是什么意思| 肺结节挂什么科室| 梦见手机失而复得是什么意思| 五常指的是什么| 吃什么代谢快有助于减肥| 佝偻病是什么样子图片| 腿脚肿胀是什么原因引起的| 压力是什么| 宝宝什么时候长牙| 三点水加盆读什么| 世界八大奇迹分别是什么| 花青素有什么作用| 白带发黄有异味是什么原因| 什么时候喝蜂蜜水最好| 卢沟桥事变又称什么| 吃什么缓解孕吐| 大便有酸味是什么原因| 乌龙茶是什么茶| 牛筋面是什么做的| 土土念什么| 紫茉莉什么时候开花| 头麻是什么原因| advil是什么药| 米咖色是什么颜色| 男人是女人的什么| 孕妇吃什么水果对胎儿好| 为什么大便是黑色的| 指什么为什么| 干贝是什么东西| 痕迹是什么意思| 丝瓜有什么营养| 自然生化流产是什么意思| 火龙果有什么功效| 纯净水和矿泉水有什么区别| 照烧是什么意思| 什么护肤品最好用| 前额头痛吃什么药| 肌红蛋白偏低说明什么| 蓝莓有什么功效与作用| 杂酱面用什么面| 尿浑浊是什么病的前兆| 包租婆是什么意思| 唐僧代表什么生肖| 辩证思维是什么意思| 脚气是什么菌| 贵格是什么意思| 亚甲炎是什么原因引起的| 12月25日是什么日子| 槿字五行属什么| nz是什么意思| 世界上最长的英语单词是什么| 什么蔬菜含铁高| 小学生的学籍号是什么| 3.1是什么星座| 乳头痒什么原因| 腰酸痛是什么原因| 胰岛素起什么作用| 抗核抗体弱阳性说明什么| 做梦飞起来了是什么兆头| fredperry是什么牌子| 中成药是什么| 空调的几匹是什么意思| 不知道干什么| 女人多吃什么补黄体酮| 5月12日是什么星座| 震颤是什么意思| 腹部胀气是什么原因| 遇见是什么意思| zs是什么意思| 献血浆为什么会给钱| 依稀是什么意思| 避重就轻是什么意思| 专班是什么意思| 视力矫正是什么意思| 白糖和冰糖有什么区别| 为什么日语怎么说| 董五行属什么| 陈晓和赵丽颖为什么分手| 日丙念什么| 买手店是什么意思| 为什么会落枕| 兆字五行属什么| 脂肪肝吃什么中成药| 血常规查什么| 缩量是什么意思| 甲状腺密度不均匀是什么意思| 什么的春天| 前列腺增大伴钙化是什么意思| 喝苦荞茶对身体有什么好处| 人潮汹涌是什么意思| 做梦搬家是什么意思| 伪娘是什么| 牙龈为什么会肿| 哺乳期头疼可以吃什么药| 什么样的心情| 四不放过是什么| 腹泻是什么症状| 生孩子需要准备什么东西| 张力是什么意思| 道德经适合什么人看| 男人眼袋大是什么原因造成的| 6月30日是什么座| 磷是什么元素| 手心经常出汗是什么原因| 频繁打哈欠是什么原因| 水镜先生和司马懿是什么关系| 两肺纹理增重什么意思| 杏仁是什么树的果实| 上午十点多是什么时辰| 求欢是什么意思| 朱砂痣代表什么| 沧海桑田什么意思| 开心的动物是什么生肖| 嗣后是什么意思| 鹅蛋脸适合什么样的发型| 子鱼是什么鱼| 蘑菇和什么不能一起吃| 怀孕初期能吃什么不能吃什么| 话说多了声音嘶哑是什么原因| 4月份什么星座| 什么不可什么四字词语| 焦虑症吃什么中成药| 泰州有什么好玩的地方| 琥珀五行属什么| 灰指甲有什么特效药可以治好| 坚什么什么什么成语| 冷幽默是什么意思| 五福是什么生肖| 2010年是什么命| 血压低吃什么药见效快| 梅花是什么颜色| 恩五行属性是什么| 斗是什么意思| 茶水费是什么意思| com代表什么意思| 世界上最小的长度单位是什么| 心慌是什么原因引起的| 妇炎康片主要治什么妇科病| 姑息是什么意思| 为什么射精是流出来的| 蛇遇猪就得哭什么意思| 下呼吸道感染吃什么药| 心度高血压是什么意思| 犹太人为什么有钱| 舌头发白吃什么药好| 小儿咳嗽吃什么药好| 道士是干什么的| 主理人什么意思| 尖嘴猴腮是什么生肖| 羊水是什么味道| 回盲瓣呈唇形什么意思| 低血糖平时要注意什么| 炙子是什么意思| 什么的表达| 知府相当于现在什么官| 气短是什么症状| 五更是什么时辰| 一命呜呼是什么意思| 4月1号是什么星座| 怀孕初期胸部有什么变化| 血肌酐高吃什么食物| 狮子座跟什么星座最配| 甲亢什么意思| 什么是蜘蛛痣| ac是胎儿的什么| 反犬旁和什么有关| 心胸狭窄是什么意思| 被舔是什么感觉| 学生近视配什么镜片好| 30岁用什么眼霜比较好| 小孩尖叫是什么原因| 一个口一个塞念什么| 电器着火用什么灭火器| 百度Pojdi na vsebino

美媒:国海证券因“假章门”遭重罚 被暂停三项业务一年

Iz Wikipedije, proste enciklopedije
Documentation icon Dokumentacija modula[predogled] [uredi] [zgodovina] [osve?i]
百度 国内石油天然气体制改革持续深化,市场活力不断增强。

Ta modul je namenjen delovanju predloge {{Infopolje}}. Za navodila glejte njeno dokumentacijsko stran.

Sledilne kategorije

[uredi kodo]
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
	plainlist_t = {
		patterns = {
			'^plainlist$',
			'%splainlist$',
			'^plainlist%s',
			'%splainlist%s'
		},
		found = false,
		styles = 'Plainlist/styles.css'
	},
	hlist_t = {
		patterns = {
			'^hlist$',
			'%shlist$',
			'^hlist%s',
			'%shlist%s'
		},
		found = false,
		styles = 'Hlist/styles.css'
	}
}

local function has_list_class(args_to_check)
	for _, list in pairs(lists) do
		if not list.found then
			for _, arg in pairs(args_to_check) do
				for _, pattern in ipairs(list.patterns) do
					if mw.ustring.find(arg or '', pattern) then
						list.found = true
						break
					end
				end
				if list.found then break end
			end
		end
	end
end

local function fixChildBoxes(sval, tt)
	local function notempty( s ) return s and s:match( '%S' ) end
	
	if notempty(sval) then
		local marker = '<span class=special_infobox_marker>'
		local s = sval
		-- start moving templatestyles and categories inside of table rows
		local slast = ''
		while slast ~= s do
			slast = s
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
		end
		-- end moving templatestyles and categories inside of table rows
		s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
		s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
		if s:match(marker) then
			s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
			s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
			s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
		end
		if s:match(marker) then
			local subcells = mw.text.split(s, marker)
			s = ''
			for k = 1, #subcells do
				if k == 1 then
					s = s .. subcells[k] .. '</' .. tt .. '></tr>'
				elseif k == #subcells then
					local rowstyle = ' style="display:none"'
					if notempty(subcells[k]) then rowstyle = ''	end
					s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
						subcells[k]
				elseif notempty(subcells[k]) then
					if (k % 2) == 0 then
						s = s .. subcells[k]
					else
						s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
							subcells[k] .. '</' .. tt .. '></tr>'
					end
				end
			end
		end
		-- the next two lines add a newline at the end of lists for the PHP parser
		-- [[Special:Diff/849054481]]
		-- remove when [[:phab:T191516]] is fixed or OBE
		s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
		s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
		return s
	else
		return sval
	end
end

-- Cleans empty tables
local function cleanInfobox()
	root = tostring(root)
	if has_rows == false then
		root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
	end
end

-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)

	local vals = {}
	for k, v in pairs(t1) do
		vals[v] = true
	end
	for k, v in pairs(t2) do
		vals[v] = true
	end
	local ret = {}
	for k, v in pairs(vals) do
		table.insert(ret, k)
	end
	return ret
end

-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
	local nums = {}
	for k, v in pairs(args) do
		local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
		if num then table.insert(nums, tonumber(num)) end
	end
	table.sort(nums)
	return nums
end

-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
	
	if rowArgs.header and rowArgs.header ~= '_BLANK_' then
		has_rows = true
		has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
		
		root
			:tag('tr')
				:addClass(rowArgs.rowclass)
				:cssText(rowArgs.rowstyle)
				:tag('th')
					:attr('colspan', '2')
					:addClass('infobox-header')
					:addClass(rowArgs.class)
					:addClass(args.headerclass)
					-- @deprecated next; target .infobox-<name> .infobox-header
					:cssText(args.headerstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(fixChildBoxes(rowArgs.header, 'th'))
		if rowArgs.data then
			root:wikitext(
				'[[Kategorija:Strani, ki uporabljajo infopolja s prezrtimi podatkovnimi celicami]]'
			)
		end
	elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
		has_rows = true
		has_list_class({ rowArgs.rowclass, rowArgs.class })
		
		local row = root:tag('tr')
		row:addClass(rowArgs.rowclass)
		row:cssText(rowArgs.rowstyle)
		if rowArgs.label then
			row
				:tag('th')
					:attr('scope', 'row')
					:addClass('infobox-label')
					-- @deprecated next; target .infobox-<name> .infobox-label
					:cssText(args.labelstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(rowArgs.label)
					:done()
		end

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', not rowArgs.label and '2' or nil)
			:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
			:addClass(rowArgs.class)
			-- @deprecated next; target .infobox-<name> .infobox(-full)-data
			:cssText(rowArgs.datastyle)
			:cssText(rowArgs.rowcellstyle)
			:wikitext(fixChildBoxes(rowArgs.data, 'td'))
	else
		table.insert(empty_row_categories, rowArgs.data or '')
	end
end

local function renderTitle()
	if not args.title then return end

	has_rows = true
	has_list_class({args.titleclass})
	
	root
		:tag('caption')
			:addClass('infobox-title')
			:addClass(args.titleclass)
			-- @deprecated next; target .infobox-<name> .infobox-title
			:cssText(args.titlestyle)
			:wikitext(args.title)
	
end

local function renderAboveRow()
	if not args.above then return end

	has_rows = true
	has_list_class({ args.aboveclass })
	
	root
		:tag('tr')
			:tag('th')
				:attr('colspan', '2')
				:addClass('infobox-above')
				:addClass(args.aboveclass)
				-- @deprecated next; target .infobox-<name> .infobox-above
				:cssText(args.abovestyle)
				:wikitext(fixChildBoxes(args.above,'th'))
end

local function renderBelowRow()
	if not args.below then return end

	has_rows = true
	has_list_class({ args.belowclass })
	
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-below')
				:addClass(args.belowclass)
				-- @deprecated next; target .infobox-<name> .infobox-below
				:cssText(args.belowstyle)
				:wikitext(fixChildBoxes(args.below,'td'))
end

local function addSubheaderRow(subheaderArgs)
	if subheaderArgs.data and
		subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
		has_rows = true
		has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
		
		local row = root:tag('tr')
		row:addClass(subheaderArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-subheader')
			:addClass(subheaderArgs.class)
			:cssText(subheaderArgs.datastyle)
			:cssText(subheaderArgs.rowcellstyle)
			:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
	else
		table.insert(empty_row_categories, subheaderArgs.data or '')
	end
end

local function renderSubheaders()
	if args.subheader then
		args.subheader1 = args.subheader
	end
	if args.subheaderrowclass then
		args.subheaderrowclass1 = args.subheaderrowclass
	end
	local subheadernums = getArgNums('subheader')
	for k, num in ipairs(subheadernums) do
		addSubheaderRow({
			data = args['subheader' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> .infobox-subheader
			datastyle = args.subheaderstyle,
			rowcellstyle = args['subheaderstyle' .. tostring(num)],
			class = args.subheaderclass,
			rowclass = args['subheaderrowclass' .. tostring(num)]
		})
	end
end

local function addImageRow(imageArgs)

	if imageArgs.data and
		imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then

		has_rows = true
		has_list_class({ imageArgs.rowclass, imageArgs.class })
		
		local row = root:tag('tr')
		row:addClass(imageArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-image')
			:addClass(imageArgs.class)
			:cssText(imageArgs.datastyle)
			:wikitext(fixChildBoxes(imageArgs.data, 'td'))
	else
		table.insert(empty_row_categories, imageArgs.data or '')
	end
end

local function renderImages()
	if args.image then
		args.image1 = args.image
	end
	if args.caption then
		args.caption1 = args.caption
	end
	local imagenums = getArgNums('image')
	for k, num in ipairs(imagenums) do
		local caption = args['caption' .. tostring(num)]
		local data = mw.html.create():wikitext(args['image' .. tostring(num)])
		if caption then
			data
				:tag('div')
					:addClass('infobox-caption')
					-- @deprecated next; target .infobox-<name> .infobox-caption
					:cssText(args.captionstyle)
					:wikitext(caption)
		end
		addImageRow({
			data = tostring(data),
			-- @deprecated next; target .infobox-<name> .infobox-image
			datastyle = args.imagestyle,
			class = args.imageclass,
			rowclass = args['imagerowclass' .. tostring(num)]
		})
	end
end

-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
	if not args.autoheaders then return end
	
	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	local lastheader
	for k, num in ipairs(rownums) do
		if args['header' .. tostring(num)] then
			if lastheader then
				args['header' .. tostring(lastheader)] = nil
			end
			lastheader = num
		elseif args['data' .. tostring(num)] and
			args['data' .. tostring(num)]:gsub(
				category_in_empty_row_pattern, ''
			):match('^%S') then
			local data = args['data' .. tostring(num)]
			if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
				lastheader = nil
			end
		end
	end
	if lastheader then
		args['header' .. tostring(lastheader)] = nil
	end
end

-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()

	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	for k, num in ipairs(rownums) do
		addRow({
			header = args['header' .. tostring(num)],
			label = args['label' .. tostring(num)],
			data = args['data' .. tostring(num)],
			datastyle = args.datastyle,
			class = args['class' .. tostring(num)],
			rowclass = args['rowclass' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> rowclass
			rowstyle = args['rowstyle' .. tostring(num)],
			rowcellstyle = args['rowcellstyle' .. tostring(num)]
		})
	end
end

local function renderNavBar()
	if not args.name then return end

	has_rows = true
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-navbar')
				:wikitext(require('Module:Navbar')._navbar{
					args.name,
					mini = 1,
				})
end

local function renderItalicTitle()
	local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
	if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
		root:wikitext(require('Module:Italic title')._main({}))
	end
end

-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
	for _, s in ipairs(empty_row_categories) do
		root:wikitext(s)
	end
end

-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
	if args.decat == 'yes' then return end
	if args.child == 'yes' then
		if args.title then
			root:wikitext(
				'[[Kategorija:Strani, ki vsebujejo gnezdeno infopolje s parametrom title]]'
			)
		end
	elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
		root:wikitext('[[Kategorija:?lanki, ki uporabljajo infopolja brez podatkovnih vrstic]]')
	end
end

--[=[
Loads the templatestyles for the infobox.

TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.

]=]
local function loadTemplateStyles()
	local frame = mw.getCurrentFrame()
	
	local hlist_templatestyles = ''
	if lists.hlist_t.found then
		hlist_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = lists.hlist_t.styles }
		}
	end
	
	local plainlist_templatestyles = ''
	if lists.plainlist_t.found then
		plainlist_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = lists.plainlist_t.styles }
		}
	end
	
	-- See function description
	local base_templatestyles = frame:extensionTag{
		name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
	}

	local templatestyles = ''
	if args['templatestyles'] then
		templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['templatestyles'] }
		}
	end
	
	local child_templatestyles = ''
	if args['child templatestyles'] then
		child_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['child templatestyles'] }
		}
	end
	
	local grandchild_templatestyles = ''
	if args['grandchild templatestyles'] then
		grandchild_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
		}
	end
	
	return table.concat({
		-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
		-- this ordering is not a guarantee because the rows of interest invoking
		-- each class may not be on a specific page
		hlist_templatestyles,
		plainlist_templatestyles,
		base_templatestyles,
		templatestyles,
		child_templatestyles,
		grandchild_templatestyles
	})
end

-- common functions between the child and non child cases
local function structure_infobox_common()
	renderSubheaders()
	renderImages()
	preprocessRows()
	renderRows()
	renderBelowRow()
	renderNavBar()
	renderItalicTitle()
	renderEmptyRowCategories()
	renderTrackingCategories()
	cleanInfobox()
end

-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
	if args.child ~= 'yes' then
		root = mw.html.create('table')

		root
			:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
			:addClass(args.bodyclass)
			-- @deprecated next; target .infobox-<name>
			:cssText(args.bodystyle)
		
		has_list_class({ args.bodyclass })

		renderTitle()
		renderAboveRow()
	else
		root = mw.html.create()

		root
			:wikitext(args.title)
	end
	structure_infobox_common()
	
	return loadTemplateStyles() .. root
end

-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
	if origArgs[argName] and origArgs[argName] ~= '' then
		args[argName] = origArgs[argName]
	end
end

-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
	if type(prefixTable) ~= 'table' then
		error("Non-table value detected for the prefix table", 2)
	end
	if type(step) ~= 'number' then
		error("Invalid step value detected", 2)
	end

	-- Get arguments without a number suffix, and check for bad input.
	for i,v in ipairs(prefixTable) do
		if type(v) ~= 'table' or type(v.prefix) ~= "string" or
			(v.depend and type(v.depend) ~= 'table') then
			error('Invalid input detected to preprocessArgs prefix table', 2)
		end
		preprocessSingleArg(v.prefix)
		-- Only parse the depend parameter if the prefix parameter is present
		-- and not blank.
		if args[v.prefix] and v.depend then
			for j, dependValue in ipairs(v.depend) do
				if type(dependValue) ~= 'string' then
					error('Invalid "depend" parameter value detected in preprocessArgs')
				end
				preprocessSingleArg(dependValue)
			end
		end
	end

	-- Get arguments with number suffixes.
	local a = 1 -- Counter variable.
	local moreArgumentsExist = true
	while moreArgumentsExist == true do
		moreArgumentsExist = false
		for i = a, a + step - 1 do
			for j,v in ipairs(prefixTable) do
				local prefixArgName = v.prefix .. tostring(i)
				if origArgs[prefixArgName] then
					-- Do another loop if any arguments are found, even blank ones.
					moreArgumentsExist = true
					preprocessSingleArg(prefixArgName)
				end
				-- Process the depend table if the prefix argument is present
				-- and not blank, or we are processing "prefix1" and "prefix" is
				-- present and not blank, and if the depend table is present.
				if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
					for j,dependValue in ipairs(v.depend) do
						local dependArgName = dependValue .. tostring(i)
						preprocessSingleArg(dependArgName)
					end
				end
			end
		end
		a = a + step
	end
end

-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()

	preprocessSingleArg('autoheaders')
	preprocessSingleArg('child')
	preprocessSingleArg('bodyclass')
	preprocessSingleArg('subbox')
	preprocessSingleArg('bodystyle')
	preprocessSingleArg('title')
	preprocessSingleArg('titleclass')
	preprocessSingleArg('titlestyle')
	preprocessSingleArg('above')
	preprocessSingleArg('aboveclass')
	preprocessSingleArg('abovestyle')
	preprocessArgs({
		{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
	}, 10)
	preprocessSingleArg('subheaderstyle')
	preprocessSingleArg('subheaderclass')
	preprocessArgs({
		{prefix = 'image', depend = {'caption', 'imagerowclass'}}
	}, 10)
	preprocessSingleArg('captionstyle')
	preprocessSingleArg('imagestyle')
	preprocessSingleArg('imageclass')
	preprocessArgs({
		{prefix = 'header'},
		{prefix = 'data', depend = {'label'}},
		{prefix = 'rowclass'},
		{prefix = 'rowstyle'},
		{prefix = 'rowcellstyle'},
		{prefix = 'class'}
	}, 50)
	preprocessSingleArg('headerclass')
	preprocessSingleArg('headerstyle')
	preprocessSingleArg('labelstyle')
	preprocessSingleArg('datastyle')
	preprocessSingleArg('below')
	preprocessSingleArg('belowclass')
	preprocessSingleArg('belowstyle')
	preprocessSingleArg('name')
	-- different behaviour for italics if blank or absent
	args['italic title'] = origArgs['italic title']
	preprocessSingleArg('decat')
	preprocessSingleArg('templatestyles')
	preprocessSingleArg('child templatestyles')
	preprocessSingleArg('grandchild templatestyles')
end

-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
	if frame == mw.getCurrentFrame() then
		origArgs = frame:getParent().args
	else
		origArgs = frame
	end
	
	parseDataParameters()
	
	return _infobox()
end

-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
	origArgs = {}
	for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
	
	parseDataParameters()
	
	return _infobox()
end
return p
全价猫粮是什么意思 玖姿女装属于什么档次 神经酰胺是什么 阿司匹林不能和什么药一起吃 钳子什么牌子好
小孩突然抽搐失去意识是什么原因 乳腺导管扩张是什么意思严重吗 胆摘除对身体有什么影响 sodium是什么意思 香蕉和什么一起吃能减肥
没有奶水怎么办吃什么能下奶 挛缩是什么意思 农历八月十五是什么节日 含义是什么意思 art是什么意思
耳呜吃什么药最好 失焦是什么意思 一个虫一个合读什么 otc是什么药 教师的职责是什么
石榴是什么生肖hcv9jop6ns7r.cn 腿麻是什么原因hcv9jop3ns8r.cn 心肌缺血是什么原因hcv8jop2ns8r.cn csv文件用什么打开hcv7jop9ns7r.cn 兴风作浪什么意思hcv9jop5ns3r.cn
众星捧月是什么意思hcv8jop0ns2r.cn 政协是什么hcv8jop8ns0r.cn 红加黄是什么颜色hcv9jop1ns1r.cn 世界上最深的湖泊是什么hcv8jop2ns3r.cn 菠萝蜜和什么不能一起吃hcv8jop7ns8r.cn
苏字五行属什么hcv8jop8ns9r.cn 硝化细菌是什么hcv8jop0ns9r.cn 发烧是什么症状hcv7jop9ns3r.cn 检查妇科清洁度三是什么意思hcv9jop1ns6r.cn 什么水果能马上通便gangsutong.com
尿妊娠试验是检查什么0735v.com 脂肪瘤吃什么药可以消除hcv9jop4ns2r.cn 芝士是什么做的hcv8jop6ns1r.cn 2月22日什么星座96micro.com gf是什么意思hcv9jop1ns4r.cn
百度