From 1e4aaa774a93f8d9e2947b1259ba9670e0dc18cb Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Fri, 17 May 2013 14:34:51 +0000 Subject: WebAdmin: The plugin list is sorted alphabetically and if they are enabled or disabled. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1488 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/web_manageplugins.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Core/web_manageplugins.lua b/MCServer/Plugins/Core/web_manageplugins.lua index cd785ec53..bf1f04ff5 100644 --- a/MCServer/Plugins/Core/web_manageplugins.lua +++ b/MCServer/Plugins/Core/web_manageplugins.lua @@ -122,13 +122,27 @@ function HandleRequest_ManagePlugins( Request ) Content = Content .. "

Currently installed plugins

" Content = Content .. "" + ActivePluginsName = {} + ActivePluginVersion = {} + InactivePlugins = {} for k, Plugin in pairs(PluginList) do - Content = Content .. "" - if( Plugin ) then - Content = Content .. "" + if( Plugin ) then + table.insert( ActivePluginsName, k ) + table.insert( ActivePluginVersion, Plugin:GetVersion() ) else - Content = Content .. "" + table.insert( InactivePlugins, k ) end + end + table.sort( ActivePluginsName ) + table.sort( InactivePlugins ) + for i = 1, #ActivePluginsName do + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + end + for i = 1, #InactivePlugins do + Content = Content .. "" + Content = Content .. "" Content = Content .. "" end Content = Content .. "
".. k .."" .. Plugin:GetName() .. " V. " .. Plugin:GetVersion() .. "" .. Button_DisablePlugin(k) .. "" .. Button_EnablePlugin(k) .. "
".. ActivePluginsName[i] .."" .. ActivePluginsName[i] .. " V. " .. ActivePluginVersion[i] .. "" .. Button_DisablePlugin(ActivePluginsName[i]) .. "
".. InactivePlugins[i] .."" .. Button_EnablePlugin(InactivePlugins[i]) .. "
" -- cgit v1.2.3