-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cs
40 lines (36 loc) · 1.1 KB
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace scLabs.PreProdPreview
{
using System;
using System.Collections.Generic;
using System.Linq;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Data;
public static class Config
{
public static string FilteredWorkflowStates
{
get
{
return Settings.GetSetting("PreProdPreview.FilteredWorkflowStates");
}
}
public static IEnumerable<ID> WorkflowStatesToFilter
{
get
{
var stateIds = MainUtil.RemoveEmptyStrings(FilteredWorkflowStates.ToLower().Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
return from stateId in stateIds where ID.IsID(stateId) select ID.Parse(stateId);
}
}
public static bool FilterByWorkflowEnabled
{
get
{
return Context.Site != null &&
Context.Site.SiteInfo.Properties["filterByWorkflow"] != null &&
Context.Site.SiteInfo.Properties["filterByWorkflow"].Equals("true", StringComparison.InvariantCultureIgnoreCase);
}
}
}
}