Модуль:External links

Материал из Викитеки — свободной библиотеки
Документация Документация

Модуль используется в шаблоне {{Внешние ссылки}}.

local moduleLanguages = require('Module:Languages')
local moduleNavbox = require('Module:Navbox')

local linksPrefix = ':w:ru:'
local project = 'Викитека'
-- local categoryTemplateEmpty = project .. ':Шаблон «Внешние ссылки» пуст'

function categoryAuthorityControl( code )
	return 'Статьи, содержащие ' .. code .. ' код'
end
function categoryExternalLink( code )
	return 'Статьи с внешними ссылками:' .. code
end

local p = {}

function allocineFilmLink( id )
	return 'http://www.allocine.fr/film/fichefilm_gen_cfilm=' .. id .. '.html'
end

function allocinePersonneLink( id )
	return 'http://www.allocine.fr/personne/fichepersonne_gen_cpersonne=' .. id .. '.html'
end

function allocineSeriesLink( id )
	return 'http://www.allocine.fr/series/ficheserie_gen_cserie=' .. id .. '.html'
end

function bavLink( id )
    return 'http://viaf.org/processed/BAV%7C' .. id
end

function bibsysLink( id )
    return 'http://ask.bibsys.no/ask/action/result?cmd=&kilde=biblio&cql=bs.autid+%3D+' .. id .. '&feltselect=bs.autid'
end

function bloggerLink( id )
    return 'http://' .. id .. '.blogspot.com'
end

function bncLink( id )
    return 'http://cantic.bnc.cat/registres/CUCId/' .. id
end

function bneLink( id )
    return 'http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id=' .. id 
end

function bnfLink( id )
    return 'http://catalogue.bnf.fr/ark:/12148/cb' .. id 
end

function boxofficemojoLink( id )
	return 'https://www.boxofficemojo.com/?id=' .. id .. '.htm'
end

function bpnLink( id )
    return 'http://www.biografischportaal.nl/persoon/' .. id
end

function breLink( id )
    return 'https://bigenc.ru/text/' .. id
end

function calisLink( id )
    return 'http://opac.calis.edu.cn/aopac/ajsp/detail.jsp?actionfrom=1&actl=CAL++' .. id
end

function duduLink( id )
    return 'http://dudu.com/' .. id
end

function egaxaLink( id )
    return 'http://viaf.org/processed/EGAXA%7Cvtls' .. id
end

function facebookLink( id )
	return 'https://www.facebook.com/' .. id
end

function fantlab_workLink( id )
	return 'https://fantlab.ru/work' .. id
end

function fantlab_authorLink( id )
	return 'https://fantlab.ru/autor' .. id
end

function fantlab_translatorLink( id )
	return 'https://fantlab.ru/translator' .. id
end

function fantlab_publisherLink( id )
	return 'https://fantlab.ru/publisher' .. id
end

function flickrLink( id )
	return 'https://www.flickr.com/' .. id
end

function findagraveLink( id )
	return 'http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=' .. id
end

function genealogyAsmLink( id )
    return 'http://www.genealogy.ams.org/id.php?id=' .. id
end

function gndLink( id )
    return 'http://d-nb.info/gnd/' .. id
end

function hlsLink( id )
    return 'http://www.hls-dhs-dss.ch/textes/f/F' .. id .. '.php'
end

function ibdbPersonLink( id )
	return 'http://www.ibdb.com/person.php?id=' .. id
end
function ibdbProductionLink( id )
	return 'http://www.ibdb.com/production.php?id=' .. id
end
function ibdbShowLink( id )
	return 'http://www.ibdb.com/show.php?id=' .. id
end
function ibdbVenueLink( id )
	return 'http://www.ibdb.com/venue.php?id=' .. id
end

function isfdbAuthorLink( id )
	return 'http://www.isfdb.org/cgi-bin/ea.cgi?' .. id
end
function isfdbPublicationLink( id )
	return 'http://www.isfdb.org/cgi-bin/pl.cgi?' .. id
end
function isfdbSeriesLink( id )
	return 'http://www.isfdb.org/cgi-bin/pe.cgi?' .. id
end
function isfdbPublisherLink( id )
	return 'http://www.isfdb.org/cgi-bin/publisher.cgi?' .. id
end

function imslpLink( id )
	return 'http://imslp.org/wiki/' .. id
end

function imdbLink( id )
    if string.match( id, '^ch' ) then
		return 'http://www.imdb.com/Name?' .. id
    end
    if string.match( id, '^co' ) then
		return 'http://www.imdb.com/company/' .. id
    end
    if string.match( id, '^nm' ) then
		return 'http://www.imdb.com/name/' .. id
    end
    if string.match( id, '^tt' ) then
		return 'http://www.imdb.com/title/' .. id
    end

	return false
end

function isniLink( id )
	id = id:gsub( '[ %-]', '' ):upper()
    return 'http://isni-url.oclc.nl/isni/' .. id
end

function lccnLink( id )
    return 'http://id.loc.gov/authorities/names/' .. id
end

function lastfmLink( id )
	return 'http://www.lastfm.ru/music/' .. id
end

function lirLink( id )
    if not string.match( id, '^%d+$' ) then
        return false
    end
    return 'http://www.e-lir.ch/e-LIR___Lexicon.' .. id .. '.450.0.html'
end

function liveJournalLink( id )
	return 'http://' .. id .. '.livejournal.com/'
end

function iccuLink( id )
	return 'https://opac.sbn.it/nome/' .. id
end

function instagramLink( id )
	return 'http://instagram.com/' .. id
end

function myspaceLink( id )
	return 'https://myspace.com/' .. id
end

function myMailRuLink( id )
	return 'http://my.mail.ru/mail/' .. id
end

function musicBrainsLink( id )
	return 'https://musicbrainz.org/artist/' .. id
end

function ndlLink( id )
	return 'http://id.ndl.go.jp/auth/ndlna/' .. id
end

function nlsLink( id )
    return false
end

function nliLink( id )
	return 'http://a20.libnet.ac.il/F?func=find-b&REQUEST=' .. id .. '&find_code=SYS&local_base=NNL10'
end
 
function nkcLink( id )
	return 'http://aut.nkp.cz/' .. id
end
 
function nlaLink( id )
	return 'http://nla.gov.au/anbd.aut-an' .. id
end

function ntaLink( id )
	return 'http://opc4.kb.nl/PPN?PPN=' .. id
end

function nukatLink( id )
	return 'http://viaf.org/processed/NUKAT%7C' .. id
end

function okLink( id )
	return 'http://www.odnoklassniki' .. '.ru/profile/' .. id
end

function orcidLink( id )
	id = id:gsub( '[ %-]', '' ):upper()
    return 'http://orcid.org/' .. id
end

function plusGoogleLink( id )
	return 'https://plus.google.com/' .. id .. '/posts'
end

function projectGutenbergLink( id )
	return 'http://www.gutenberg.org/ebooks/author/' .. id
end

function promodjLink( id )
    return 'http://promodj.com/' .. id
end

function ptbnpLink( id )
	return 'http://viaf.org/processed/PTBNP%7C' .. id
end

function ridLink( id )
    return 'http://www.researcherid.com/rid/' .. id
end

function rodovidLink( id )
	return 'http://ru.rodovid.org/wk/Person:' .. id
end

function rottentomatoesLink( id )
	return 'http://www.rottentomatoes.com/' .. id
end

function rslLink( id )
    return 'http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request=' .. id
end

function scopusLink( id )
	return 'http://www.scopus.com/authid/detail.url?authorId=' .. id
end

function selibrLink( id )
    return 'http://libris.kb.se/auth/' .. id
end

function soundcloudLink( id )
	return 'http://soundcloud.com/' .. id .. '/'
end

function sudocLink( id )
    return 'http://www.idref.fr/' .. id
end

function tumblrLink( id )
	return 'https://' .. id .. '.tumblr.com/'
end

function twitterLink( id )
	return 'https://twitter.com/' .. id
end

function ulanLink( id )
    return 'http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=' .. id
end

function vkLink( id )
	return 'https://vk.com/' .. id
end

function vkrugudruzeiLink( id )
	return 'http://' .. id .. '.vkrugudruzei.ru/'
end

function vimeoLink( id )
	return 'https://vimeo.com/' .. id
end

function viafLink( id )
    return 'http://viaf.org/viaf/' .. id
end

function yaRuLink( id )
	return 'http://' .. id .. '.ya.ru/'
end

function youtubeLink( id )
	return 'https://youtube.com/' .. id
end

local socialNetworkProperties = {
    { 'ВКонтакте',   	'Q116933',	vkLink,				categoryExternalLink( 'ВКонтакте' ) },
    { 'В кругу друзей',	'Q4101720',	vkrugudruzeiLink,	categoryExternalLink( 'В кругу друзей' ) },
    { 'Живой журнал',	'Q219523',	liveJournalLink,	categoryExternalLink( 'Живой журнал' ) },
    { 'Мой мир',		'Q4299858',	myMailRuLink,		categoryExternalLink( 'Мой мир' ) },
    { 'Одноклассники',	'Q1123836',	okLink,				categoryExternalLink( 'Одноклассники' ) },
    { 'Я.ру',			'Q798490',	yaRuLink,			categoryExternalLink( 'Я.ру' ) },
    { 'Blogger',   		'Q171186',	bloggerLink,		categoryExternalLink( 'Blogger' ) },
    { 'Dudu',    		'Q4037665',	duduLink,			categoryExternalLink( 'Dudu' ) },
    { 'Facebook',    	'Q355',		facebookLink,		categoryExternalLink( 'Facebook' ) },
    { 'Google+',		'Q356',		plusGoogleLink,		categoryExternalLink( 'Google+' ) },
    { 'MySpace',		'Q40629',	myspaceLink,		categoryExternalLink( 'MySpace' ) },
    { 'Tumblr',			'Q384060',	tumblrLink,			categoryExternalLink( 'Tumblr' ) },
    { 'Twitter',		'Q918',		twitterLink,		categoryExternalLink( 'Twitter' ) },
}

local contentHostingProperties = {
    { 'Flickr',		'Q103204',		flickrLink,		categoryExternalLink( 'Flickr' ) },
    { 'Instagram',	'Q209330',		instagramLink,	categoryExternalLink( 'Instagram' ) },
    { 'Last.fm',	'Q183718',		lastfmLink,		categoryExternalLink( 'Last.fm' ) },
    { 'PROMODJ',	'Q17117201',	promodjLink,	categoryExternalLink( 'PROMODJ' ) },
    { 'SoundCloud',	'Q568769',		soundcloudLink,	categoryExternalLink( 'SoundCloud' ) },
    { 'Vimeo',		'Q156376',		vimeoLink,		categoryExternalLink( 'Vimeo' ) },
    { 'YouTube',	'Q866',			youtubeLink,	categoryExternalLink( 'YouTube' ) },
}

local dictionaryProperties = {
    { 'Исторический словарь Швейцарии',	'P886',	lirLink },
}

local themeProfilesProperties = {
	{ 'Лаборатория Фантастики',						'P7439',	fantlab_workLink,		categoryExternalLink( 'ФантЛаб/Произведения' ) },
    { 'Лаборатория Фантастики',						'P7433',	fantlab_authorLink,		categoryExternalLink( 'ФантЛаб/Авторы' ) },
    { 'Лаборатория Фантастики',						'P12009',	fantlab_translatorLink,	categoryExternalLink( 'ФантЛаб/Переводчики' ) },
    { 'Лаборатория Фантастики',						'P7438',	fantlab_publisherLink,	categoryExternalLink( 'ФантЛаб/Издатели' ) },
	-- common
    { 'Родовод',									'P1185',	rodovidLink,			categoryExternalLink( 'Родовод' ) },
    -- science
    { 'Математическая генеалогия',					'P549',		genealogyAsmLink,		categoryExternalLink( 'Математическая генеалогия' ) },
    { 'ORCID',										'P496',		orcidLink,				categoryExternalLink( 'ORCID' ) },
    { 'ResearcherID',								'P1053',	ridLink,				categoryExternalLink( 'ResearcherID' ) },
    { 'Scopus',										'P1153',	scopusLink,				categoryExternalLink( 'Scopus' ) },
    -- audio and video
    -- { 'AlloCiné',									'P1265',	allocineFilmLink,		categoryExternalLink( 'AlloCiné' ) },
    { 'AlloCiné',									'P1266',	allocinePersonneLink,	categoryExternalLink( 'AlloCiné' ) },
    -- { 'AlloCiné',									'P1267',	allocineSeriesLink,		categoryExternalLink( 'AlloCiné' ) },
    -- { 'Box Office Mojo',							'P1237',	boxofficemojoLink,		categoryExternalLink( 'AlloCiné' ) },
    -- { 'Internet Broadway Database',					'P1217',	ibdbVenueLink,			categoryExternalLink( 'IBDb' ) },
    -- { 'Internet Broadway Database',					'P1218',	ibdbProductionLink,		categoryExternalLink( 'IBDb' ) },
    { 'Internet Broadway Database',					'P1219',	ibdbShowLink,			categoryExternalLink( 'IBDb' ) },
    { 'Internet Broadway Database',					'P1220',	ibdbPersonLink,			categoryExternalLink( 'IBDb' ) },
    { 'Internet Movie Database',					'P345',		imdbLink,				categoryExternalLink( 'IMDb' ) },
    { 'International Music Score Library Project',	'P839',		imslpLink,				categoryExternalLink( 'IMSLP' ) },
    { 'MusicBrains',								'P434',		musicBrainsLink,		categoryExternalLink( 'MusicBrains' ) },
    { 'Rotten Tomatoes',							'P1258',	rottentomatoesLink,		categoryExternalLink( 'Rotten Tomatoes' ) },
    -- literature
    { 'Internet Speculative Fiction Database',		'P1233',	isfdbAuthorLink,		categoryExternalLink( 'ISFDb' ) },
    { 'Internet Speculative Fiction Database',		'P1234',	isfdbPublicationLink,	categoryExternalLink( 'ISFDb' ) },
    { 'Internet Speculative Fiction Database',		'P1235',	isfdbSeriesLink,		categoryExternalLink( 'ISFDb' ) },
    { 'Internet Speculative Fiction Database',		'P1239',	isfdbPublisherLink,		categoryExternalLink( 'ISFDb' ) },
    { 'Project Gutenberg',							'P1938',	projectGutenbergLink,	categoryExternalLink( 'Project Gutenberg' ) },
    { 'ULAN',										'P245',		ulanLink,				categoryExternalLink( 'ULAN' ) },
	-- common
    { 'Find a Grave',								'P535',		findagraveLink,			categoryExternalLink( 'Find a Grave' ) },
}

function getLabelWithLink( id, title, label )
	local link = mw.wikibase.sitelink( id );
	if ( link ~= nil ) then
		return '[[' .. link .. '|' .. label .. ']]';
	end
	--local title = mw.wikibase.label( id ) or defaultTitle;
	return '<span title="' .. title .. '" style="border-bottom: 1px dotted; cursor: help;">' .. label .. '</span>'
end

local authorityControl = {
    { getLabelWithLink( 'Q213678', 'Bibliotheca Apostolica Vaticana', 'BAV'),				'P1017',	bavLink,	categoryAuthorityControl( 'BAV' ) },
    { getLabelWithLink( 'Q4584301', '', 'BIBSYS'),											'P1015', 	bibsysLink,	categoryAuthorityControl( 'BIBSYS' ) },
    { getLabelWithLink( 'Q1200925', 'Biblioteca de Catalunya', 'BNC'),						'P1273',	bncLink,	categoryAuthorityControl( 'BNC' ) },
    { getLabelWithLink( 'Q750403', 'Biblioteca Nacional de España', 'BNE'),					'P950', 	bneLink,	categoryAuthorityControl( 'BNE' ) },
    { getLabelWithLink( 'Q193563', 'Bibliothèque nationale de France', 'BNF'), 				'P268', 	bnfLink,	categoryAuthorityControl( 'BNF' ) },
    { getLabelWithLink( 'Q1868372', 'Biografisch Portaal', 'BPN'),							'P651',		bpnLink,	categoryAuthorityControl( 'BPN' ) },
    { getLabelWithLink( 'Q1768199', 'Большая российская энциклопедия онлайн', 'BRE'),		'P2924',	breLink,	categoryAuthorityControl( 'BRE' ) },
    { getLabelWithLink( 'Q9384291', '中国高等教育文献保障系统', 'CALIS'),					'P270', 	calisLink,	categoryAuthorityControl( 'CALIS' ) },
    { getLabelWithLink( 'Q501851', 'مكتبة الإسكندرية الجديدة', 'EGAXA'),					'P1309', 	egaxaLink,	categoryAuthorityControl( 'EGAXA' ) },
    { getLabelWithLink( 'Q36578', 'Gemeinsame Normdatei', 'GND'),							'P227', 	gndLink,	categoryAuthorityControl( 'GND' ) },
    { getLabelWithLink( 'Q642074', 'Lexicon istoric retic', 'HLS'),							'P902', 	hlsLink,	categoryAuthorityControl( 'HLS' ) },
    { getLabelWithLink( 'Q3803707', 'Istituto Centrale per il Catalogo Unico', 'ICCU'),		'P396', 	iccuLink,	categoryAuthorityControl( 'ICCU' ) },
    { getLabelWithLink( 'Q423048', 'International Standard Name Identifier', 'ISNI'),		'P213',		isniLink,	categoryAuthorityControl( 'ISNI' ) },
    { getLabelWithLink( 'Q620946', 'Library of Congress Control Number', 'LCCN'),			'P244',		lccnLink,	categoryAuthorityControl( 'LCCN' ) },
    { getLabelWithLink( 'Q477675', '国立国会図書館', 'NDL'),								'P349',		ndlLink,	categoryAuthorityControl( 'NDL' ) },
    { getLabelWithLink( 'Q732353', '中国国家图书馆', 'NLS'),								'P1213', 	nlsLink,	categoryAuthorityControl( 'NLS' ) },
-- NLI numbers seems unstable
    { getLabelWithLink( 'Q1967876', 'Národní knihovna České republiky', 'NKC'),				'P691',		nkcLink,	categoryAuthorityControl( 'NKC' ) },
    { getLabelWithLink( 'Q623578', 'National Library of Australia', 'NLA'), 				'P409',		nlaLink,	categoryAuthorityControl( 'NLA' ) },
    { getLabelWithLink( 'Q1526131', 'Koninklijke Bibliotheek', 'NTA'),						'P1006',	ntaLink,	categoryAuthorityControl( 'NTA' ) },
    { getLabelWithLink( 'Q11789729', 'Narodowy Uniwersalny Katalog Centralny', 'NUKAT'),	'P1207',	nukatLink,	categoryAuthorityControl( 'NUKAT' ) },
    { getLabelWithLink( 'Q245966', 'Biblioteca Nacional de Portugal', 'PTBNP'),				'P1005',	ptbnpLink,	categoryAuthorityControl( 'PTBNP' ) },
    { getLabelWithLink( 'Q1048694', 'Российская государственная библиотека', 'RSL'),		'P947', 	rslLink,	categoryAuthorityControl( 'RSL' ) },
    { getLabelWithLink( 'Q953058', 'Kungliga biblioteket', 'LIBRIS'),						'P906',		selibrLink,	categoryAuthorityControl( 'SELIBR' ) },
    { getLabelWithLink( 'Q2597810', 'Système universitaire de documentation', 'SUDOC'),		'P269',		sudocLink,	categoryAuthorityControl( 'SUDOC' ) },    
    { getLabelWithLink( 'Q54919', 'Virtual International Authority File', 'VIAF'),			'P214',		viafLink,	categoryAuthorityControl( 'VIAF' ) },
}

function getQualifierSingleValue( statement, qualifierName )
	if (statement ~= nil
		and statement.qualifiers ~= nil
		and statement.qualifiers[qualifierName] ~= nil
		and statement.qualifiers[qualifierName][0] ~= nil
		and statement.qualifiers[qualifierName][0].datavalue ~= nil
		and statement.qualifiers[qualifierName][0].datavalue.type ~= nil
		and statement.qualifiers[qualifierName][0].datavalue.value ~= nil
		) then
			local qualifier = statement.qualifiers[qualifierName][0];
			if ( qualifier.datavalue.type == "string" ) then
				return qualifier.datavalue.value;
			end
			if ( qualifier.datavalue.type == "wikibase-entityid" ) then
				return 'Q' .. qualifier.datavalue.value["numeric-id"];
			end
			mw.log( 'Unknown qualifier type: ' .. qualifier.datavalue.type )
			return qualifier.datavalue.value;
	end
	return nil;
end

function getQualifierValues( statement, qualifierName )
	local result = {}
	if (statement ~= nil
			and statement.qualifiers ~= nil
			and statement.qualifiers[qualifierName] ~= nil) then
		local qualifiers = statement.qualifiers[qualifierName];
		for _, qualifier in pairs( qualifiers ) do
			if (qualifier.datavalue ~= nil
				and qualifier.datavalue.type ~= nil
				and qualifier.datavalue.value ~= nil) then

				if ( qualifier.datavalue.type == "string" ) then
					result[#result+1] = qualifier.datavalue.value;
				elseif ( qualifier.datavalue.type == "wikibase-entityid" ) then
					result[#result+1] = 'Q' .. qualifier.datavalue.value["numeric-id"];
				else 
					mw.log( 'Unknown qualifier type: ' .. qualifier.datavalue.type );
					result[#result+1] = 'Q' .. qualifier.datavalue.value;
				end
			end
		end
	end
	return result;
end

function collectLinks( configuration )
    --Create rows
    local elements = {}
    local data = {}

    local item = mw.wikibase.getEntity()
    if item == nil or item.claims == nil then
    	return elements
    end

	if ( item.claims['P553'] ~= nil ) then
		local claim = item.claims['P553']
		for _, statement in pairs( claim ) do
			if (statement ~= nil) then
				-- profile ID
				local userId = getQualifierSingleValue( statement, 'P554' );
				if (userId ~= nil) then
					-- language
					local languages = getQualifierValues( statement, 'P407' );
					local networkId = 'Q' .. statement.mainsnak.datavalue.value['numeric-id']
					if (data[networkId] == nil) then
						data[networkId] = {};
					end
					table.insert( data[networkId], { userId = userId, languages = languages})
				end
			end
		end
	end

    for _, params in pairs( configuration ) do
    	local networkId = params[2]
   	    local claim = item.claims[ networkId ]
		if ( claim ) then
			for _, statement in pairs( claim ) do
				if statement.mainsnak.snaktype == "value" then
					local userId = statement.mainsnak.datavalue.value
					local languages = getQualifierValues( statement, 'P407' );
					if (data[networkId] == nil) then
						data[networkId] = {};
					end
					table.insert( data[networkId], { userId = userId, languages = languages});
				end
			end
		end
    end

    for _, params in pairs( configuration ) do
		local networkLabel = params[1]
		local firstChar = mw.ustring.sub( networkLabel, 1, 1 );
		local separateDesign = firstChar == '[' or firstChar == '<';

		local networkId = params[2]
		local networkDatas = data[networkId];
		if networkDatas ~= nil then
    		local html = '';
			if ( separateDesign ) then
				html = html .. networkLabel .. ':&nbsp;';
			end
			for index, networkData in pairs(networkDatas) do
				local userId = networkData.userId;
				local languages = networkData.languages;
				local link = params[3] ( userId );
				
				if ( separateDesign ) then
					if ( index ~= 1 ) then
						html = html .. ',&nbsp;'
					end
					if ( link ) then
						html = html .. '[' .. link .. ' ' .. userId .. ']';
					else
						html = html .. userId;
					end
				else
					if ( index ~= 1 ) then
						html = html .. ' · '
					end
					if ( link ) then
						html = html .. '[' .. link .. ' ' .. networkLabel .. ']';
					else
						-- it should not happen
						html = html .. networkLabel .. ':&nbsp;' .. userId;
					end
					if ( languages ~= nil and #languages > 0 ) then
						for langIndex, language in pairs(languages) do
							html = html .. '&nbsp;' .. moduleLanguages.getRefHtml( language )
						end
					end
				end
			end
			if ( #params >= 4 ) then
				html = html .. '[[Category:' .. params[4] .. ']]'
			end
            table.insert( elements, html )
		end
    end

	return elements
end

function p.render( frame )
	local colorArg = '#CCF';
	local nocat = false;
	if ( frame ~= nil ) then
	    local parentArgs = frame:getParent().args
	    colorArg = parentArgs["цвет"] or parentArgs["color"] or '#CCF';
	    nocat = parentArgs["nocat"] ~= nil and parentArgs["nocat"] ~= "";
    end

	local navboxData = {
        name  = 'Внешние ссылки',
        navboxclass = 'navbox ruwikiArticleExternalLinksTable',
        bodyclass = 'hlist',
        groupstyle = 'background: ' .. colorArg .. ';',
    };
   	local rowIndex = 1

	local socialNetworksElements = collectLinks( socialNetworkProperties );
	if ( #socialNetworksElements > 0 ) then
		navboxData['group' .. rowIndex] = '[[' .. linksPrefix .. 'Социальная сеть|В социальных сетях]]'
		navboxData['list' .. rowIndex] = table.concat( socialNetworksElements , ' · ' )
		rowIndex = rowIndex + 1
	end

	local contentHostingElements = collectLinks( contentHostingProperties );
	if ( #contentHostingElements > 0 ) then
		navboxData['group' .. rowIndex] = 'Фото и видеохостинги'
		navboxData['list' .. rowIndex] = table.concat( contentHostingElements , ' · ' )
		rowIndex = rowIndex + 1
	end

	local themeProfilesElements = collectLinks( themeProfilesProperties );
	if ( #themeProfilesElements > 0 ) then
		navboxData['group' .. rowIndex] = 'Профили на тематических сайтах'
		navboxData['list' .. rowIndex] = table.concat( themeProfilesElements , ' · ' )
		rowIndex = rowIndex + 1
	end

	local dictionaryElements = collectLinks( dictionaryProperties );
	if ( #dictionaryElements > 0 ) then
		navboxData['group' .. rowIndex] = 'Словари и энциклопедии'
		navboxData['list' .. rowIndex] = table.concat( dictionaryElements , ' · ' )
		rowIndex = rowIndex + 1
	end

	local authorityControlElements = collectLinks( authorityControl );
	if ( #authorityControlElements > 0 ) then
		navboxData['group' .. rowIndex] = '[[' .. linksPrefix .. 'Нормативный контроль|Нормативный контроль]]'
		navboxData['list' .. rowIndex] = table.concat( authorityControlElements , ' · ' )
		rowIndex = rowIndex + 1
	end

	if ( rowIndex == 1 ) then
	--	if ( mw.title.getCurrentTitle().namespace == 0 and not nocat) then
	--		return '[[Category:' .. categoryTemplateEmpty .. ']]'
	--	else
			return ''
	--	end
	end

    local navbox = moduleNavbox._navbox( navboxData )
    return navbox
end

return p