Difference between revisions of "Module:Extension"
Jump to navigation
Jump to search
initial test. Implement needs db update from extension.json
>Kghbln (adapt to spdx v3.1 of 2014-04-14) |
>Bawolff (initial test. Implement needs db update from extension.json) |
||
Line 226: | Line 226: | ||
function p.getFormattedLicense( frame ) | function p.getFormattedLicense( frame ) | ||
return getFormattedLicense( frame.args[1] ) | return getFormattedLicense( frame.args[1] ) | ||
end | |||
-- Return if the extension does schema updates | |||
-- Only answer yes. For now be silent on no or unknown, as its unclear | |||
-- if this info should be in infobox if the answer is not yes. | |||
function p.getNeedsUpdates( frame ) | |||
local data = mw.loadData( 'Module:ExtensionJson' ) | |||
local pg = mw.title.getCurrentTitle().rootPageTitle:partialUrl() -- need to get rid of translation subpage. | |||
if data[pg] ~= nil and data[pg].Hooks ~= nil and data[pg].Hooks.LoadExtensionSchemaUpdates ~= nil then | |||
return 'yes' | |||
end | |||
return '' | |||
end | end | ||
return p | return p |