From 12906c026d414c752d3c0ba9481f425b24b29c67 Mon Sep 17 00:00:00 2001 From: faketruth Date: Mon, 20 Aug 2012 12:20:20 +0000 Subject: Moved files used by MCServer to a special MCServer folder git-svn-id: http://mc-server.googlecode.com/svn/trunk@763 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/Core/web_manageplugins.lua | 93 -------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 Plugins/Core/web_manageplugins.lua (limited to 'Plugins/Core/web_manageplugins.lua') diff --git a/Plugins/Core/web_manageplugins.lua b/Plugins/Core/web_manageplugins.lua deleted file mode 100644 index 3030efc7a..000000000 --- a/Plugins/Core/web_manageplugins.lua +++ /dev/null @@ -1,93 +0,0 @@ -local function Button_RemovePlugin( Name, Index ) - return "
" -end - -local function HandlePluginListChanges( Request, SettingsIni ) - local Content = "" - if( Request.PostParams["RemovePlugin"] ~= nil - and Request.PostParams["PluginName"] ~= nil - and Request.PostParams["PluginIndex"] ~= nil ) then -- Removing a plugin - - local KeyIdx = SettingsIni:FindKey("Plugins") - local PluginIdx = Request.PostParams["PluginIndex"] - - local PluginName = SettingsIni:GetValue( KeyIdx, PluginIdx ) - if( (PluginName == Request.PostParams["PluginName"]) and (SettingsIni:DeleteValueByID( KeyIdx, PluginIdx ) == true) ) then - SettingsIni:WriteFile() - Content = "Removed plugin '" .. PluginName .. "'" - else - Content = "Whoops! Something went wrong!" - end - - - elseif( Request.PostParams["AddPlugin"] ~= nil - and Request.PostParams["PluginName"] ~= nil ) then -- Add a plugin - - SettingsIni:SetValue("Plugins", "NewPlugin", Request.PostParams["PluginName"], true ) - SettingsIni:WriteFile() - - Content = "Added plugin '".. Request.PostParams["PluginName"] .."'" - - end - - if( #Content > 0 ) then - return "

INFO: " .. Content .. "

" - else - return "" - end -end - -function HandleRequest_ManagePlugins( Request ) - local Content = "" - - if( Request.PostParams["reload"] ~= nil ) then - Content = Content .. "" - Content = Content .. "

Reloading plugins... This can take a while depending on the plugins you're using.

" - cRoot:Get():GetPluginManager():ReloadPlugins() - return Content - end - - local PluginManager = cRoot:Get():GetPluginManager() - local PluginList = PluginManager:GetAllPlugins() - - Content = Content .. "

Currently active plugins

" - Content = Content .. "" - for k, Plugin in pairs(PluginList) do - Content = Content .. "" - end - Content = Content .. "
" .. Plugin:GetName() .. " V. " .. Plugin:GetVersion() .. "
" - - local SettingsIni = cIniFile("settings.ini") - if( SettingsIni:ReadFile() == true ) then - Content = Content .. "

Plugins according to settings.ini

" - - Content = Content .. HandlePluginListChanges( Request, SettingsIni ) - - Content = Content .. "" - - local KeyIdx = SettingsIni:FindKey("Plugins") - local NumValues = SettingsIni:GetNumValues( KeyIdx ) - for i = 0, NumValues-1 do - local ValueName = SettingsIni:GetValueName(KeyIdx, i ) - local PluginName = SettingsIni:GetValue(KeyIdx, i) - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - end - Content = Content .. "
" .. ValueName .. ": " .. PluginName .. "" .. Button_RemovePlugin( PluginName, i ) .. "
" - end - - Content = Content .. "

Add plugin to settings.ini

" - Content = Content .. "
" - Content = Content .. "" - Content = Content .. "
" - - Content = Content .. "

Reload

" - Content = Content .. "
" - Content = Content .. "

Click the reload button to reload all plugins!
" - Content = Content .. "

" - Content = Content .. "
" - - return Content -end \ No newline at end of file -- cgit v1.2.3