Difference between revisions of "Module:Extension"
Jump to navigation
Jump to search
no edit summary
>Shirayuki |
>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 = | local data = getExtData() | ||
if data ~= nil and data.Hooks ~= nil and data.Hooks.LoadExtensionSchemaUpdates ~= nil then | |||
if data | |||
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 |