-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update FeatureController with data form Oqtane
- Loading branch information
Showing
3 changed files
with
46 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Oqtane.Repository; | ||
using System.Linq; | ||
|
||
namespace ToSic.Sxc.Oqt.Server.Run | ||
{ | ||
public class OqtModuleHelper | ||
{ | ||
private readonly IModuleRepository _moduleRepository; | ||
private readonly IModuleDefinitionRepository _moduleDefinitionRepository; | ||
|
||
public OqtModuleHelper(IModuleRepository moduleRepository, IModuleDefinitionRepository moduleDefinitionRepository) | ||
{ | ||
_moduleRepository = moduleRepository; | ||
_moduleDefinitionRepository = moduleDefinitionRepository; | ||
} | ||
|
||
/// <summary> | ||
/// Detect is 2sxc Content app | ||
/// </summary> | ||
/// <param name="moduleId">module id</param> | ||
/// <returns>bool</returns> | ||
|
||
public bool IsContentApp(int moduleId) | ||
{ | ||
var module = _moduleRepository.GetModule(moduleId); | ||
var moduleDefinition = _moduleDefinitionRepository.GetModuleDefinitions(module.SiteId).ToList().Find(item => item.ModuleDefinitionName == module.ModuleDefinitionName); | ||
return moduleDefinition?.Name == "Content"; | ||
} | ||
} | ||
} |
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