Module:MemberIcon

local p = {}

local function is_protected(member) if member.MemberCategory == "Property" then return member.Security and (           member.Security.Read and member.Security.Read ~= "" and member.Security.Read ~= "None"            or            member.Security.Write and member.Security.Write ~= "" and member.Security.Write ~= "None"        ) elseif member.MemberCategory == "Function" or member.MemberCategory == "Event" or member.MemberCategory == "Callback" then return member.Security and member.Security ~= "" and member.Security ~= "None" else return error("Unknown member category: " .. member.MemberCategory) end end

function p.make_member_icon(member) local icon_file_name = "" if member.MemberCategory == "Property" then if is_protected(member) then icon_file_name = "Protfield.gif" else icon_file_name = "Pubfield.gif" end elseif member.MemberCategory == "Function" then if is_protected(member) then icon_file_name = "Protmethod.gif" else icon_file_name = "Pubmethod.gif" end elseif member.MemberCategory == "Event" then if is_protected(member) then icon_file_name = "Protevent.gif" else icon_file_name = "Pubevent.gif" end elseif member.MemberCategory == "Callback" then icon_file_name = "Callback icon.png" else return error("Unknown member category: " .. member.MemberCategory) end return "" end

return p