Difference between revisions of "Module:Extension"

Jump to navigation Jump to search
254 bytes added ,  15:06, 18 May 2019
no edit summary
>Shirayuki
m (Undid revision 3123378 by Shirayuki (talk))
>BWolff (WMF)
Line 226: Line 226:
function p.getFormattedLicense( frame )
function p.getFormattedLicense( frame )
return getFormattedLicense( frame.args[1] )
return getFormattedLicense( frame.args[1] )
end
function getExtData()
local pg = mw.title.getCurrentTitle().rootPageTitle:partialUrl() -- need to get rid of translation subpage.
return mw.loadData( 'Module:ExtensionJson' )[pg]
end
end


Line 232: Line 237:
-- if this info should be in infobox if the answer is not yes.
-- if this info should be in infobox if the answer is not yes.
function p.getNeedsUpdates( frame )
function p.getNeedsUpdates( frame )
local data = mw.loadData( 'Module:ExtensionJson' )
local data = getExtData()
local pg = mw.title.getCurrentTitle().rootPageTitle:partialUrl() -- need to get rid of translation subpage.
if data ~= nil and data.Hooks ~= nil and data.Hooks.LoadExtensionSchemaUpdates ~= nil then
if data[pg] ~= nil and data[pg].Hooks ~= nil and data[pg].Hooks.LoadExtensionSchemaUpdates ~= nil then
return 'yes'
return 'yes'
end
end
return ''
return ''
end
function p.getVersion( frame )
    if frame.args[1] ~= nil then
    return frame.args[1]
    end
    local data = getExtData()
    if data.version ~= nil then
    return data.version
    end
    return ''
end
end


return p
return p
Anonymous user

Navigation menu