/// <summary> /// Check for and process an override based on the page Doc Type /// </summary> /// <param name="doctypeAlias">Doc Type to check</param> /// <param name="templateLevel">Optional level to check at</param> /// <returns>True if an override exists</returns> private static bool DocTypeOverride(string doctypeAlias, string templateLevel) { // If a template name was not passed, return false (no override) if (string.IsNullOrEmpty(doctypeAlias)) { return(false); } // Look for the template name in the overrides list var contenttype = ContentTypeList.FirstOrDefault(n => n.Name == doctypeAlias); // If template not found then return false (no override) if (contenttype == null) { return(false); } // If a specific level was not provided, then the override applies at any level if (string.IsNullOrEmpty(templateLevel)) { return(true); } // If the template override applies at a specific level if (contenttype.Level != "*") { return(contenttype.Level == templateLevel); } // Template name found and applies at all levels return(true); }
/// <summary> /// Default private constructor. /// </summary> private App() { _blocks = new AppBlockList(); _fields = new AppFieldList(); _modules = new AppModuleList(); _mediaTypes = new MediaManager(); _serializers = new SerializerManager(); _hooks = new HookManager(); _permissions = new PermissionManager(); _pageTypes = new ContentTypeList <Models.PageType>(); _postTypes = new ContentTypeList <Models.PostType>(); _siteTypes = new ContentTypeList <Models.SiteType>(); }
private App() { this._cacheLevel = 3; base(); this._blocks = new AppBlockList(); this._fields = new AppFieldList(); this._modules = new AppModuleList(); this._mediaTypes = new MediaManager(); this._serializers = new SerializerManager(); this._hooks = new HookManager(); this._permissions = new PermissionManager(); this._pageTypes = new ContentTypeList <PageType>(); this._postTypes = new ContentTypeList <PostType>(); this._siteTypes = new ContentTypeList <SiteType>(); return; }