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