Skip to content

Commit

Permalink
Merge pull request #636 from Orckestra/dev
Browse files Browse the repository at this point in the history
C1 CMS 6.6 updates from dev
  • Loading branch information
Marcus Wendt authored Dec 4, 2018
2 parents c5bfaf0 + 38935d9 commit 66e1af9
Show file tree
Hide file tree
Showing 81 changed files with 2,145 additions and 1,071 deletions.
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,26 @@
selenium-debug.log
/Website/test/e2e/reports/

GitCommitInfo.cs
GitCommitInfo.cs

/Website/Composite/content/misc/editors/visualeditor/tinymce/plugins/autolink/plugin.min.js
/Website/Composite/content/misc/editors/visualeditor/tinymce/plugins/lists/plugin.min.js
/Website/Composite/content/misc/editors/visualeditor/tinymce/plugins/paste/plugin.min.js
/Website/Composite/content/misc/editors/visualeditor/tinymce/plugins/table/plugin.min.js
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce.woff
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce.ttf
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce.svg
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce.eot
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce-small.woff
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce-small.ttf
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce-small.svg
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/fonts/tinymce-small.eot
/Website/Composite/content/misc/editors/visualeditor/tinymce/tinymce.min.js
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/skin.min.css
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/skin.ie7.min.css
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/img/trans.gif
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/img/object.gif
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/img/loader.gif
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/img/anchor.gif
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/content.min.css
/Website/Composite/content/misc/editors/visualeditor/tinymce/skins/lightgray/content.inline.min.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
Expand Down Expand Up @@ -577,8 +577,8 @@ private void ValidateSave(object sender, ConditionalEventArgs e)
TrimFieldValues(selectedPage);

if (!FieldHasValidLength(selectedPage.Title, nameof(IPage.Title), 255)
|| !FieldHasValidLength(selectedPage.MenuTitle, nameof(IPage.MenuTitle), 64)
|| !FieldHasValidLength(selectedPage.UrlTitle, nameof(IPage.UrlTitle), 64)
|| !FieldHasValidLength(selectedPage.MenuTitle, nameof(IPage.MenuTitle), 192)
|| !FieldHasValidLength(selectedPage.UrlTitle, nameof(IPage.UrlTitle), 192)
|| !FieldHasValidLength(selectedPage.FriendlyUrl, nameof(IPage.FriendlyUrl), 64))
{
e.Result = false;
Expand Down
59 changes: 21 additions & 38 deletions Composite/AspNet/CmsPageSiteMapNode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Web;
using Composite.Core.Routing;
Expand All @@ -10,30 +10,20 @@ namespace Composite.AspNet
/// <summary>
/// Represents an <see cref="IPage"/> instance in a sitemap.
/// </summary>
public class CmsPageSiteMapNode: SiteMapNode
public class CmsPageSiteMapNode : SiteMapNode, ICmsSiteMapNode, ISchemaOrgSiteMapNode
{
private int? _depth;

/// <summary>
/// Gets or sets the culture.
/// </summary>
/// <value>
/// The culture.
/// </value>
public CultureInfo Culture { get; protected set; }
/// <inheritdoc />
public CultureInfo Culture { get; }

/// <summary>
/// Gets or sets the priority.
/// </summary>
/// <value>
/// The priority.
/// </value>
/// <inheritdoc />
public int? Priority { get; protected set; }

/// <summary>
/// Gets the current page.
/// </summary>
public IPage Page { get; protected set; }
public IPage Page { get; }

/// <summary>
/// Gets or sets the depth.
Expand All @@ -47,17 +37,19 @@ public int Depth
{
if (_depth == null)
{
int depth = 0;
Guid id = Page.Id;
var depth = 0;
var id = Page.Id;

const int maxDepth = 1000;

using (new DataScope(Page.DataSourceId.PublicationScope, Page.DataSourceId.LocaleScope))
{
while (id != Guid.Empty && depth < maxDepth)
{
depth++;
id = PageManager.GetParentId(id);
}

if (depth == maxDepth)
{
throw new InvalidOperationException("Endless page loop");
Expand All @@ -66,25 +58,17 @@ public int Depth

_depth = depth;
}

return _depth.Value;
}
protected set { _depth = value; }

protected set => _depth = value;
}

/// <summary>
/// Gets or sets the last modified.
/// </summary>
/// <value>
/// The last modified.
/// </value>
public DateTime LastModified { get; protected set; }
/// <inheritdoc />
public DateTime LastModified { get; }

/// <summary>
/// Gets or sets the change frequency.
/// </summary>
/// <value>
/// The change frequency.
/// </value>
/// <inheritdoc />
public SiteMapNodeChangeFrequency? ChangeFrequency { get; protected set; }

/// <summary>
Expand All @@ -93,7 +77,7 @@ public int Depth
/// <value>
/// The document title.
/// </value>
public string DocumentTitle { get; protected set; }
public string DocumentTitle { get; }

/// <summary>
/// Initializes a new instance of the <see cref="CmsPageSiteMapNode"/> class.
Expand All @@ -111,32 +95,31 @@ public CmsPageSiteMapNode(SiteMapProvider provider, IPage page)
Culture = page.DataSourceId.LocaleScope;
}


/// <exclude />
public bool Equals(CmsPageSiteMapNode obj)
{
return Key == obj.Key && Culture.Equals(obj.Culture);
}

/// <exclude />
/// <inheritdoc />
public override bool Equals(object obj)
{
var pageSiteMapNode = obj as CmsPageSiteMapNode;
if (pageSiteMapNode != null)
{
return Equals(pageSiteMapNode);
}

return base.Equals(obj);
}

/// <exclude />
/// <inheritdoc />
public override SiteMapNode Clone()
{
return new CmsPageSiteMapNode(this.Provider, Page);
}

/// <exclude />
/// <inheritdoc />
public override int GetHashCode()
{
return Key.GetHashCode() ^ Culture.GetHashCode();
Expand Down
Loading

0 comments on commit 66e1af9

Please sign in to comment.