Renames Control to DashboardControl so it has some meaning.

This commit is contained in:
Shannon
2013-10-03 17:59:23 +10:00
parent 1730005a58
commit 3d3be5ecbc
4 changed files with 39 additions and 38 deletions

View File

@@ -30,7 +30,7 @@ namespace Umbraco.Web.Editors
public class DashboardController : UmbracoAuthorizedJsonController
{
public IEnumerable<Tab<Control>> GetDashboard(string section)
public IEnumerable<Tab<DashboardControl>> GetDashboard(string section)
{
return GetDashboardFromXml(section);
@@ -38,13 +38,13 @@ namespace Umbraco.Web.Editors
}
//TODO migrate this into a more managed class
private IEnumerable<Tab<Control>> GetDashboardFromXml(string section)
private IEnumerable<Tab<DashboardControl>> GetDashboardFromXml(string section)
{
XmlDocument dashBoardXml = new XmlDocument();
dashBoardXml.Load(IOHelper.MapPath(SystemFiles.DashboardConfig));
var user = UmbracoContext.Security.CurrentUser;
var tabs = new List<Tab<Control>>();
var tabs = new List<Tab<DashboardControl>>();
// test for new tab interface
foreach (XmlNode dashboard in dashBoardXml.DocumentElement.SelectNodes("//section [areas/area = '" + section.ToLower() + "']"))
@@ -60,9 +60,9 @@ namespace Umbraco.Web.Editors
{
i++;
Tab<Control> tab = new Tab<Control>();
Tab<DashboardControl> tab = new Tab<DashboardControl>();
tab.Label = entry.Attributes.GetNamedItem("caption").Value;
var props = new List<Control>();
var props = new List<DashboardControl>();
tab.Id = i;
tab.Alias = tab.Label.ToLower().Replace(" ", "_");
tab.IsActive = i == 1;
@@ -71,7 +71,7 @@ namespace Umbraco.Web.Editors
{
if (ValidateAccess(uc, user))
{
Control ctrl = new Control();
DashboardControl ctrl = new DashboardControl();
string control = Core.XmlHelper.GetNodeValue(uc).Trim(' ', '\r', '\n');
ctrl.Path = IOHelper.FindFile(control);

View File

@@ -1,28 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Web.Models.ContentEditing
{
[DataContract(Name = "control", Namespace = "")]
public class Control
{
[DataMember(Name = "showOnce")]
public bool ShowOnce { get; set; }
[DataMember(Name = "addPanel")]
public bool AddPanel { get; set; }
[DataMember(Name = "serverSide")]
public bool ServerSide { get; set; }
[DataMember(Name = "path")]
public string Path { get; set; }
[DataMember(Name = "caption")]
public string Caption { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Web.Models.ContentEditing
{
[DataContract(Name = "control", Namespace = "")]
public class DashboardControl
{
[DataMember(Name = "showOnce")]
public bool ShowOnce { get; set; }
[DataMember(Name = "addPanel")]
public bool AddPanel { get; set; }
[DataMember(Name = "serverSide")]
public bool ServerSide { get; set; }
[DataMember(Name = "path")]
public string Path { get; set; }
[DataMember(Name = "caption")]
public string Caption { get; set; }
}
}

View File

@@ -333,7 +333,7 @@
<Compile Include="Editors\MemberController.cs" />
<Compile Include="Editors\UserController.cs" />
<Compile Include="Install\Steps\MajorUpgradeReport.cs" />
<Compile Include="Models\ContentEditing\Control.cs" />
<Compile Include="Models\ContentEditing\DashboardControl.cs" />
<Compile Include="Models\ContentEditing\DataTypeDisplay.cs" />
<Compile Include="Models\ContentEditing\DataTypeSave.cs" />
<Compile Include="Models\ContentEditing\EntityBasic.cs" />

View File

@@ -1,5 +1,6 @@
using System;
using System.Xml;
using Umbraco.Core;
using Umbraco.Core.IO;
namespace umbraco.cms.businesslogic.packager.standardPackageActions
@@ -46,11 +47,11 @@ namespace umbraco.cms.businesslogic.packager.standardPackageActions
string dbConfig = SystemFiles.DashboardConfig;
XmlNode section = xmlData.SelectSingleNode("./section");
XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig);
XmlDocument dashboardFile = XmlHelper.OpenAsXmlDocument(dbConfig);
XmlNode importedSection = dashboardFile.ImportNode(section, true);
XmlAttribute alias = xmlHelper.addAttribute(dashboardFile, "alias", sectionAlias);
XmlAttribute alias = XmlHelper.AddAttribute(dashboardFile, "alias", sectionAlias);
importedSection.Attributes.Append(alias);
dashboardFile.DocumentElement.AppendChild(importedSection);
@@ -74,7 +75,7 @@ namespace umbraco.cms.businesslogic.packager.standardPackageActions
string sectionAlias = xmlData.Attributes["dashboardAlias"].Value;
string dbConfig = SystemFiles.DashboardConfig;
XmlDocument dashboardFile = xmlHelper.OpenAsXmlDocument(dbConfig);
XmlDocument dashboardFile = XmlHelper.OpenAsXmlDocument(dbConfig);
XmlNode section = dashboardFile.SelectSingleNode("//section [@alias = '" + sectionAlias + "']");