From 23324539745848f28308f3de28aa0278b662e1b5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 4 May 2013 00:45:27 +0200 Subject: Add RegionManager level and the ability to use literal XML to the dynamic floater module --- .../Region/Framework/Interfaces/IDynamicFloaterModule.cs | 1 + OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs | 1 + .../OptionalModules/ViewerSupport/DynamicFloaterModule.cs | 13 ++++++++++--- .../OptionalModules/ViewerSupport/DynamicMenuModule.cs | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs index 5e633e6..65c42ff 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -39,6 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces public abstract int Channel { get; } public abstract string FloaterName { get; } public virtual string XmlName { get; set; } + public virtual string XmlText { get; set; } public virtual HandlerDelegate Handler { get; set; } } diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs index 08b71e4..4d000b6 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs @@ -43,6 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces public enum UserMode : int { Normal = 0, + RegionManager = 2, God = 3 } diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs index 7919fef..4524a05 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs @@ -125,10 +125,17 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport m_floaters[agentID].Add(dialogData.Channel, dialogData); string xml; - using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) + if (dialogData.XmlText != null && dialogData.XmlText != String.Empty) { - using (StreamReader sr = new StreamReader(fs)) - xml = sr.ReadToEnd().Replace("\n", ""); + xml = dialogData.XmlText; + } + else + { + using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) + { + using (StreamReader sr = new StreamReader(fs)) + xml = sr.ReadToEnd().Replace("\n", ""); + } } List xparts = new List(); diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs index 917911f..c68fe99 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs @@ -110,8 +110,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport { foreach (MenuItemData d in m_menuItems[UUID.Zero]) { - if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) - continue; + if (!m_scene.Permissions.IsGod(agentID)) + { + if (d.Mode == UserMode.RegionManager && (!m_scene.Permissions.IsAdministrator(agentID))) + continue; + } OSDMap loc = null; switch (d.Location) -- cgit v1.1