public string GetLoadingChannels(int siteId, string contentModelPluginId, int parentId, string loadingType, string additional, RequestImpl request) { var list = new List <string>(); var eLoadingType = ELoadingTypeUtils.GetEnumType(loadingType); var channelIdList = ChannelManager.GetChannelIdList( ChannelManager.GetChannelInfo(siteId, parentId == 0 ? siteId : parentId), EScopeType.Children, string.Empty, string.Empty, string.Empty); var siteInfo = SiteManager.GetSiteInfo(siteId); var nameValueCollection = TranslateUtils.ToNameValueCollection(TranslateUtils.DecryptStringBySecretKey(additional)); foreach (var channelId in channelIdList) { var channelInfo = ChannelManager.GetChannelInfo(siteId, channelId); var enabled = request.AdminPermissionsImpl.IsOwningChannelId(channelId); if (!string.IsNullOrEmpty(contentModelPluginId) && !StringUtils.EqualsIgnoreCase(channelInfo.ContentModelPluginId, contentModelPluginId)) { enabled = false; } if (!enabled) { if (!request.AdminPermissionsImpl.IsDescendantOwningChannelId(siteId, channelId)) { continue; } if (!IsDesendantContentModelPluginIdExists(channelInfo, contentModelPluginId)) { continue; } } list.Add(ChannelLoading.GetChannelRowHtml(siteInfo, channelInfo, enabled, eLoadingType, nameValueCollection, request.AdminPermissionsImpl)); } //arraylist.Reverse(); var builder = new StringBuilder(); foreach (var html in list) { builder.Append(html); } return(builder.ToString()); }
public string GetLoadingChannels(int siteId, int parentId, string loadingType, string additional, Request request) { var list = new List <string>(); var eLoadingType = ELoadingTypeUtils.GetEnumType(loadingType); var channelIdList = DataProvider.ChannelDao.GetIdListByParentId(siteId, parentId); var siteInfo = SiteManager.GetSiteInfo(siteId); var nameValueCollection = TranslateUtils.ToNameValueCollection(TranslateUtils.DecryptStringBySecretKey(additional)); foreach (var channelId in channelIdList) { var enabled = AdminUtility.IsOwningChannelId(request.AdminName, channelId); if (!enabled) { if (!AdminUtility.IsHasChildOwningChannelId(request.AdminName, channelId)) { continue; } } var nodeInfo = ChannelManager.GetChannelInfo(siteId, channelId); list.Add(ChannelLoading.GetChannelRowHtml(siteInfo, nodeInfo, enabled, eLoadingType, nameValueCollection, request.AdminName)); } //arraylist.Reverse(); var builder = new StringBuilder(); foreach (var html in list) { builder.Append(html); } return(builder.ToString()); }
public string GetLoadingChannels(int publishmentSystemId, int parentId, string loadingType, string additional, RequestBody body) { var arraylist = new ArrayList(); var eLoadingType = ELoadingTypeUtils.GetEnumType(loadingType); var nodeIdList = DataProvider.NodeDao.GetNodeIdListByParentId(publishmentSystemId, parentId); var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); var nameValueCollection = TranslateUtils.ToNameValueCollection(TranslateUtils.DecryptStringBySecretKey(additional)); foreach (int nodeId in nodeIdList) { var enabled = AdminUtility.IsOwningNodeId(body.AdministratorName, nodeId); if (!enabled) { if (!AdminUtility.IsHasChildOwningNodeId(body.AdministratorName, nodeId)) { continue; } } var nodeInfo = NodeManager.GetNodeInfo(publishmentSystemId, nodeId); arraylist.Add(ChannelLoading.GetChannelRowHtml(publishmentSystemInfo, nodeInfo, enabled, eLoadingType, nameValueCollection, body.AdministratorName)); } //arraylist.Reverse(); var builder = new StringBuilder(); foreach (string html in arraylist) { builder.Append(html); } return(builder.ToString()); }