Merge pull request #1847 from mc-server/DumpInfoFix
Fixed DumpInfo plugin
This commit is contained in:
commit
773ac22c30
@ -28,17 +28,18 @@ function HandleDumpPluginRequest(a_Request)
|
|||||||
|
|
||||||
Content = Content .. [[
|
Content = Content .. [[
|
||||||
<table>
|
<table>
|
||||||
<th colspan="2">DumpInfo</th>]]
|
<tr>
|
||||||
|
<th colspan="2">DumpInfo</th>
|
||||||
|
</tr>]]
|
||||||
|
|
||||||
-- Loop through each plugin that is found.
|
-- Loop through each plugin that is found.
|
||||||
for PluginName, k in pairs(cPluginManager:Get():GetAllPlugins()) do
|
for PluginName, k in pairs(cPluginManager:Get():GetAllPlugins()) do
|
||||||
|
|
||||||
-- Check if there is a file called 'Info.lua' or 'info.lua'
|
-- Check if there is a file called 'Info.lua' or 'info.lua'
|
||||||
if (cFile:Exists("Plugins/" .. PluginName .. "/Info.lua")) then
|
if (cFile:Exists("Plugins/" .. PluginName .. "/Info.lua")) then
|
||||||
Content = Content .. "<tr>"
|
Content = Content .. "\n<tr>\n"
|
||||||
Content = Content .. "<td>" .. PluginName .. "</td>"
|
Content = Content .. "\t<td>" .. PluginName .. "</td>\n"
|
||||||
Content = Content .. "<td> <form method='POST'> <input type='hidden' value='" .. PluginName .. "' name='DumpInfo'> <input type='submit' value='DumpInfo'> </form>"
|
Content = Content .. "\t<td><form method='POST'> <input type='hidden' value='" .. PluginName .. "' name='DumpInfo'> <input type='submit' value='DumpInfo'></form></td>\n"
|
||||||
Content = Content .. "</td>"
|
Content = Content .. "</tr>\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,6 +18,13 @@ only that one plugin's documentation. This mode of operation doesn't require Lua
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- If this file is called using the loadfile function the arg variable isn't filled. We have to do it manualy then.
|
||||||
|
local arg = arg or {...}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Check Lua version. We use 5.1-specific construct when loading the plugin info, 5.2 is not compatible!
|
-- Check Lua version. We use 5.1-specific construct when loading the plugin info, 5.2 is not compatible!
|
||||||
if (_VERSION ~= "Lua 5.1") then
|
if (_VERSION ~= "Lua 5.1") then
|
||||||
print("Unsupported Lua version. This script requires Lua version 5.1, this Lua is version " .. (_VERSION or "<nil>"))
|
print("Unsupported Lua version. This script requires Lua version 5.1, this Lua is version " .. (_VERSION or "<nil>"))
|
||||||
|
Loading…
Reference in New Issue
Block a user