Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1941 from 2sic/develop
about to release 10.24
- Loading branch information
Showing
51 changed files
with
637 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using ToSic.Eav.Documentation; | ||
using ToSic.Eav.Logging; | ||
using ToSic.Sxc.Blocks; | ||
using ToSic.Sxc.Dnn.Run; | ||
using ToSic.Sxc.Dnn.Web; | ||
|
||
namespace ToSic.Sxc.Dnn.Code | ||
{ | ||
public class DnnDynamicCode : Sxc.Code.DynamicCodeRoot, IDnnDynamicCode | ||
{ | ||
[PrivateApi] | ||
public new ICmsBlock CmsBlock => base.CmsBlock; | ||
|
||
/// <summary> | ||
/// Standard constructor | ||
/// </summary> | ||
/// <param name="cmsBlock">The CMS Block which is used in this code.</param> | ||
/// <param name="parentLog">parent logger for logging what's happening</param> | ||
public DnnDynamicCode(ICmsBlock cmsBlock, int compatibility, ILog parentLog = null): base(cmsBlock, new DnnTenant(null), compatibility, parentLog) | ||
{ | ||
//CmsBlock = cmsBlock; | ||
// Init things than require module-info or similar, but not 2sxc | ||
var instance = cmsBlock?.Container; | ||
Dnn = new DnnContext(instance); | ||
Link = new DnnLinkHelper(Dnn); | ||
} | ||
|
||
#region IHasDnnContext | ||
|
||
/// <summary> | ||
/// Dnn context with module, page, portal etc. | ||
/// </summary> | ||
public IDnnContext Dnn { get; } | ||
|
||
#endregion | ||
|
||
|
||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...yContent/2sxc Dnn/Dnn/Web/IDynamicCode.cs → ...tent/2sxc Dnn/Dnn/Code/IDnnDynamicCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
using ToSic.Eav.Logging; | ||
using ToSic.Sxc.Blocks; | ||
using ToSic.Eav.Documentation; | ||
using ToSic.Sxc.Code; | ||
using ToSic.Sxc.Dnn.Run; | ||
using ToSic.Sxc.Dnn.Web; | ||
using IDynamicCode = ToSic.Sxc.Code.IDynamicCode; | ||
|
||
namespace ToSic.Sxc.Dnn | ||
{ | ||
public class DynamicCode : Sxc.Web.DynamicCode, IDynamicCode | ||
// ReSharper disable once UnusedMember.Global | ||
/// <summary> | ||
/// This is a base class for custom code files with context. <br/> | ||
/// If you create a class file for dynamic use and inherit from this, then the compiler will automatically add objects like Link, Dnn, etc. | ||
/// The class then also has AsDynamic(...) and AsList(...) commands like a normal razor page. | ||
/// </summary> | ||
[PublicApi] | ||
public abstract class DynamicCode : Sxc.Code.DynamicCode, Code.IDnnDynamicCode | ||
{ | ||
public ICmsBlock CmsBlock; | ||
public IDnnContext Dnn { get; private set; } | ||
|
||
public DynamicCode(ICmsBlock cmsBlock, ILog parentLog = null): base(cmsBlock, new DnnTenant(null), parentLog) | ||
internal override void InitShared(IDynamicCode parent) | ||
{ | ||
CmsBlock = cmsBlock; | ||
// Init things than require module-info or similar, but not 2sxc | ||
var instance = cmsBlock?.Container; | ||
Dnn = new DnnContext(instance); | ||
Link = new DnnLinkHelper(Dnn); | ||
} | ||
|
||
#region IHasDnnContext | ||
|
||
/// <summary> | ||
/// Dnn context with module, page, portal etc. | ||
/// </summary> | ||
public IDnnContext Dnn { get; } | ||
|
||
#endregion | ||
|
||
if (parent is Code.IDnnDynamicCode withDnn) Dnn = withDnn.Dnn; | ||
|
||
base.InitShared(parent); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.