public static UserSelections ( IRegistryCore registry, UUID userID ) : object>>.List |
||
registry | IRegistryCore | Registry. |
userID | UUID | User identifier. |
return | object>>.List |
public Dictionary <string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest, OSHttpResponse httpResponse, Dictionary <string, object> requestParameters, ITranslator translator, out string response) { response = null; var vars = new Dictionary <string, object> (); var estateConnector = Framework.Utilities.DataManager.RequestPlugin <IEstateConnector> (); string estate; if (httpRequest.Query.ContainsKey("EstateID")) { estate = httpRequest.Query ["EstateID"].ToString(); } else { if (requestParameters.ContainsKey("EstateID")) { estate = requestParameters ["EstateID"].ToString(); } else { response = "<h3>Estate details not supplied, redirecting to main page</h3>" + "<script>" + "setTimeout(function() {window.location.href = \"/?page=estate_manager\";}, 1000);" + "</script>"; return(null); } } var estateid = -1; int.TryParse(estate, out estateid); if (requestParameters.ContainsKey("Delete")) { //var estateID = httpRequest.Query ["delete"].ToString (); //if (estateConnector.DeleteEstate (estateID)) // response = "<h3>Estate details have been deleted</h3>" + // "<script>" + // "setTimeout(function() {window.location.href = \"/?page=estate_manager\";}, 1000);" + // "</script>"; //else response = "Estate details would have been deleted (but not yet)."; return(null); } if (requestParameters.ContainsKey("Submit")) { var estateSettings = new EstateSettings(); if (estateid >= 0) { estateSettings = estateConnector.GetEstateIDSettings(estateid); } var estateOwner = requestParameters ["EstateOwner"].ToString(); estateSettings.EstateName = requestParameters ["EstateName"].ToString(); estateSettings.EstateOwner = UUID.Parse(estateOwner); estateSettings.PricePerMeter = int.Parse(requestParameters ["PricePerMeter"].ToString()); estateSettings.PublicAccess = requestParameters ["PublicAccess"].ToString() == "1"; estateSettings.TaxFree = requestParameters ["TaxFree"].ToString() == "1"; estateSettings.AllowVoice = requestParameters ["AllowVoice"].ToString() == "1"; estateSettings.AllowDirectTeleport = requestParameters ["AllowDirectTeleport"].ToString() == "1"; estateConnector.SaveEstateSettings(estateSettings); response = "Estate details have been updated." + "<script>" + "setTimeout(function() {window.location.href = \"/?page=estate_manager\";}, 1000);" + "</script>"; return(null); } if (requestParameters.ContainsKey("NewEstate")) { // blank details for new estate vars.Add("EstateID", "-1"); vars.Add("EstateName", ""); vars.Add("UserList", WebHelpers.UserSelections(webInterface.Registry, UUID.Zero)); vars.Add("PricePerMeter", ""); vars.Add("PublicAccess", WebHelpers.YesNoSelection(translator, true)); vars.Add("AllowVoice", WebHelpers.YesNoSelection(translator, true)); vars.Add("TaxFree", WebHelpers.YesNoSelection(translator, true)); vars.Add("AllowDirectTeleport", WebHelpers.YesNoSelection(translator, true)); vars.Add("Submit", translator.GetTranslatedString("AddEstateText")); } else { // get selected estate details var estateSettings = estateConnector.GetEstateIDSettings(estateid); if (estateSettings != null) { vars.Add("EstateID", estateSettings.EstateID.ToString()); vars.Add("EstateName", estateSettings.EstateName); vars.Add("UserList", WebHelpers.UserSelections(webInterface.Registry, estateSettings.EstateOwner)); vars.Add("PricePerMeter", estateSettings.PricePerMeter.ToString()); vars.Add("PublicAccess", WebHelpers.YesNoSelection(translator, estateSettings.PublicAccess)); vars.Add("AllowVoice", WebHelpers.YesNoSelection(translator, estateSettings.AllowVoice)); vars.Add("TaxFree", WebHelpers.YesNoSelection(translator, estateSettings.TaxFree)); vars.Add("AllowDirectTeleport", WebHelpers.YesNoSelection(translator, estateSettings.AllowDirectTeleport)); vars.Add("Submit", translator.GetTranslatedString("SaveUpdates")); } } // labels vars.Add("EstateManagerText", translator.GetTranslatedString("MenuEstateManager")); vars.Add("EstateNameText", translator.GetTranslatedString("EstateText")); vars.Add("EstateOwnerText", translator.GetTranslatedString("MenuOwnerTitle")); vars.Add("PricePerMeterText", translator.GetTranslatedString("PricePerMeterText")); vars.Add("PublicAccessText", translator.GetTranslatedString("PublicAccessText")); vars.Add("AllowVoiceText", translator.GetTranslatedString("AllowVoiceText")); vars.Add("TaxFreeText", translator.GetTranslatedString("TaxFreeText")); vars.Add("AllowDirectTeleportText", translator.GetTranslatedString("AllowDirectTeleportText")); vars.Add("Cancel", translator.GetTranslatedString("Cancel")); vars.Add("InfoMessage", ""); return(vars); }