Documentation for this module may be created at Module:DocSidebar/doc
local CspFunctions = require('Module:CspFunctions')
local p = {}
--[[
function p.GetVariables(frame)
frame args:
1 (text) content of the url parameter veaction
2 (text) content of the url parameter action
3 (text) content of the url parameter version
{{#invoke:DocSidebar|GetVariables|{{#urlget:veaction}}|{{#urlget:action}}|{{#urlget:selected-version}}}}
=p.GetVariables(mw.getCurrentFrame():newChild{args={"1", "2", "3", "DevOps:Doc/FlexForm/2.1/input/file/examples"}})
]]
function p.GetVariables(frame)
local urlVEAction = frame.args[1]
local urlAction = frame.args[2]
local urlVersion = frame.args[3]
local results = {}
local title
if frame.args[4] == nil or frame.args[4] == "" then
title = mw.title.getCurrentTitle().fullText
else
title = frame.args[4] -- defined for debug purposes
end
local baseSlots = CspFunctions.getSlotData(title, "ws-base-props")
local classSlots = CspFunctions.getSlotData(title, "ws-class-props")
mw.logObject(baseSlots)
results.allowSidebarEdit = AllowSidebarLogic(frame)
results.logo = GetLogo(classSlots)
return mw.af.export(results)
end
function AllowSidebarLogic(frame)
local isUser = frame:preprocess("{{#ifingroup:user|yes|no}}")
if isUser == "yes" and (frame.args[1] == nil or frame.args[1] == "") and (frame.args[2] == nil or frame.args[2] == "") then
return "yes"
else
return ""
end
end
function GetLogo(classSlots)
end
return p