Módulo:BibRules: mudanças entre as edições

sem sumário de edição
imported>Jaideraf
Sem resumo de edição
imported>Jaideraf
Sem resumo de edição
function p.BibRules( frame )
-- Define o alvo
local target = frame.args[1] or frame:getParent().args[1]
if target == '' or target == nil then
target = mw.uri.decode( frame:callParserFunction( '#urlget', 'fullpagename' ) )
-- Campo 005
local queryResult = mw.smw.ask( '[[' .. target '' ']]|?Creation date#-F[l, d \d\e F \d\e Y]|headers=hide|mainlabel=-' )
local myResult = ""
if type( queryResult ) == "table" then
for num, row in pairs( queryResult ) do
myResult = myResult .. '* This is result #' .. num .. '\n'
for property, data in pairs( row ) do
local dataOutput = data
if type( data ) == 'table' then
dataOutput = mw.text.listToText( data, ', ', ' and ')
end
myResult = myResult .. '** ' .. property .. ': ' .. dataOutput .. '\n'
end
end
end
 
info = "* O registro foi criado em: " .. myResult
table.insert(infos, info)
 
end -- end if 245
return target, table.concat( infos, '\n' )
 
end
Usuário anônimo