Changed modpol.orgs.list_all to return table not string
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
modpol.dashboard = function(user)
|
||||
local output = ""
|
||||
-- Org status
|
||||
output = output .. "Orgs:\n" .. modpol.orgs.list_all()
|
||||
output = output .. "Orgs:\n" ..
|
||||
table.concat(modpol.orgs.list_all(),"\n")
|
||||
-- Process status (ongoing processes)
|
||||
output = output .. "\nProcesses:\n" .. table.concat(modpol.processes)
|
||||
-- Command list (should be redone to be org-specific)
|
||||
|
||||
+12
-12
@@ -23,19 +23,19 @@ function modpol.orgs.get_org(arg)
|
||||
end
|
||||
|
||||
-- ===============================================
|
||||
-- returns a string list of all orgs
|
||||
-- returns a table list of all org names
|
||||
function modpol.orgs.list_all()
|
||||
local str
|
||||
for k, v in ipairs(modpol.orgs.array) do
|
||||
if type(v) == 'table' then
|
||||
if str then
|
||||
str = str .. '\n' .. v.name
|
||||
else
|
||||
str = v.name
|
||||
end
|
||||
end
|
||||
end
|
||||
return str
|
||||
local org_table
|
||||
for k, v in ipairs(modpol.orgs.array) do
|
||||
if type(v) == 'table' then
|
||||
if org_table then
|
||||
table.insert(org_table, v.name)
|
||||
else
|
||||
org_table = {v.name}
|
||||
end
|
||||
end
|
||||
end
|
||||
return org_table
|
||||
end
|
||||
|
||||
-- ===========================================
|
||||
|
||||
Reference in New Issue
Block a user