From 9aa41dde2f1f7f4e3c4d9e90a0c9b93c597a6d50 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 21 Aug 2012 13:18:23 +0000 Subject: Using multi line strings for Core's WebAdmin interface git-svn-id: http://mc-server.googlecode.com/svn/trunk@769 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/web_serversettings.lua | 103 ++++++++++++++------------- 1 file changed, 52 insertions(+), 51 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Core/web_serversettings.lua b/MCServer/Plugins/Core/web_serversettings.lua index 057fa3e89..3056d7e8b 100644 --- a/MCServer/Plugins/Core/web_serversettings.lua +++ b/MCServer/Plugins/Core/web_serversettings.lua @@ -1,19 +1,17 @@ -- Some HTML helper functions local function HTML_Option( value, text, selected ) if( selected == true ) then - return "" + return [[]] else - return "" + return [["]] end end local function HTML_Select_On_Off( name, defaultValue ) - local Content = "" - Content = Content .. "" - return Content + return [[]] end @@ -39,37 +37,39 @@ local function ShowGeneralSettings( Request ) SettingsIni:SetValue("Authentication", "Authenticate", Request.PostParams["Authentication_Authenticate"], false ) end if( SettingsIni:WriteFile() == false ) then - InfoMsg = "ERROR: Could not write to settings.ini!" + InfoMsg = [[ERROR: Could not write to settings.ini!]] else - InfoMsg = "INFO: Successfully saved changes to settings.ini" + InfoMsg = [[INFO: Successfully saved changes to settings.ini]] end end - Content = Content .. "
" + Content = Content .. [[ + +

General Settings

]] - Content = Content .. "

General Settings

" if( InfoMsg ~= nil ) then Content = Content .. "

" .. InfoMsg .. "

" end - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "
Server
Description:
Max Players:
Port:

" - - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "
Authentication
Authenticate:" .. HTML_Select_On_Off("Authentication_Authenticate", SettingsIni:GetValueI("Authentication", "Authenticate") ) .. "

" - - Content = Content .. " WARNING: Any changes made here might require a server restart in order to be applied!" - Content = Content .. "
" + Content = Content .. [[ + + + + + + + + +
Server
Description:
Max Players:
Port:

+ + + + + +
Authentication
Authenticate:]] .. HTML_Select_On_Off("Authentication_Authenticate", SettingsIni:GetValueI("Authentication", "Authenticate") ) .. [[

+ + WARNING: Any changes made here might require a server restart in order to be applied! + ]] return Content end @@ -108,18 +108,18 @@ local function ShowMonstersSettings( Request ) Content = Content .. "

" .. InfoMsg .. "

" end - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "
Monsters
Animals On:" .. HTML_Select_On_Off("Monsters_AnimalsOn", SettingsIni:GetValueI("Monsters", "AnimalsOn") ) .. "
Animal Spawn Interval:
Monster Types:

" - - Content = Content .. " WARNING: Any changes made here might require a server restart in order to be applied!" - Content = Content .. "" + Content = Content .. [[ + + + + + + + + +
Monsters
Animals On:]] .. HTML_Select_On_Off("Monsters_AnimalsOn", SettingsIni:GetValueI("Monsters", "AnimalsOn") ) .. [[
Animal Spawn Interval:
Monster Types:

+ WARNING: Any changes made here might require a server restart in order to be applied! + ]] return Content end @@ -131,15 +131,16 @@ end function HandleRequest_ServerSettings( Request ) local Content = "" - Content = Content .. "

Server Settings

" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "" - Content = Content .. "
GeneralMonstersWorlds
" - Content = Content .. "
" + Content = Content .. [[ +

Server Settings

+ + + + + + +
GeneralMonstersWorlds
+
]] if( Request.Params["tab"] == "Monsters" ) then Content = Content .. ShowMonstersSettings( Request ) -- cgit v1.2.3