/// <summary> /// 得到栏目,并且不对(栏目是否可添加内容)进行判断 /// 提供给触发器页面使用 /// 使用场景:其他栏目的内容变动之后,设置某个栏目(此栏目不能添加内容)触发生成 /// </summary> public static void AddListItemsForCreateChannel(ListItemCollection listItemCollection, PublishmentSystemInfo publishmentSystemInfo, bool isSeeOwning, string administratorName) { var list = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(publishmentSystemInfo.PublishmentSystemId); var nodeCount = list.Count; var isLastNodeArray = new bool[nodeCount]; foreach (var nodeId in list) { var enabled = true; if (isSeeOwning) { enabled = AdminUtility.IsOwningNodeId(administratorName, nodeId); } var nodeInfo = GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, nodeId); if (!enabled) { continue; } var listitem = new ListItem(GetSelectText(publishmentSystemInfo, nodeInfo, isLastNodeArray, true, false), nodeInfo.NodeId.ToString()); listItemCollection.Add(listitem); } }
public static void AddListItems(ListItemCollection listItemCollection, PublishmentSystemInfo publishmentSystemInfo, bool isSeeOwning, bool isShowContentNum, bool isShowContentModel, EContentModelType contentModel, string administratorName) { var list = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(publishmentSystemInfo.PublishmentSystemId); var nodeCount = list.Count; var isLastNodeArray = new bool[nodeCount]; foreach (var nodeId in list) { var enabled = true; if (isSeeOwning) { enabled = AdminUtility.IsOwningNodeId(administratorName, nodeId); if (!enabled) { if (!AdminUtility.IsHasChildOwningNodeId(administratorName, nodeId)) { continue; } } } var nodeInfo = GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, nodeId); var listitem = new ListItem(GetSelectText(publishmentSystemInfo, nodeInfo, isLastNodeArray, isShowContentNum, isShowContentModel), nodeInfo.NodeId.ToString()); if (!enabled) { listitem.Attributes.Add("style", "color:gray;"); } if (nodeInfo.ContentModelId != contentModel.ToString()) { listitem.Attributes.Add("disabled", "disabled"); } listItemCollection.Add(listitem); } }
protected override void Render(HtmlTextWriter writer) { var builder = new StringBuilder(); var body = new RequestBody(); var publishmentSystemId = int.Parse(Page.Request.QueryString["PublishmentSystemID"]); _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); var scripts = ChannelLoading.GetScript(_publishmentSystemInfo, ELoadingType.ContentTree, null); builder.Append(scripts); if (Page.Request.QueryString["PublishmentSystemID"] != null) { try { var nodeIdList = DataProvider.NodeDao.GetNodeIdListByParentId(_publishmentSystemInfo.PublishmentSystemId, 0); foreach (var nodeId in nodeIdList) { var nodeInfo = NodeManager.GetNodeInfo(_publishmentSystemInfo.PublishmentSystemId, nodeId); var enabled = AdminUtility.IsOwningNodeId(body.AdministratorName, nodeInfo.NodeId); //var enabled2 = AdminUtility.IsOwningNodeIdByPublishmentSystem(body.AdministratorName, nodeInfo.NodeId); if (!enabled) { if (!AdminUtility.IsHasChildOwningNodeId(body.AdministratorName, nodeInfo.NodeId)) { continue; } } //if (nodeId == 1) //{ // builder.Append( // @"<a href="" /siteserver/loading.aspx?RedirectType=Loading&RedirectUrl=cms/pageContentMain.aspx?PublishmentSystemID=1""target=""right""onclick=""openFolderByA(this); ""istreelink=""true"" style=""padding-left:20px;font-size:30px;"">ÄÚÈݹÜÀí</a>"); //} //else //{ builder.Append(ChannelLoading.GetChannelRowHtml(_publishmentSystemInfo, nodeInfo, enabled, ELoadingType.ContentTree, null, body.AdministratorName)); //} } } catch (Exception ex) { PageUtils.RedirectToErrorPage(ex.Message); } } writer.Write(builder); }
protected override void Render(HtmlTextWriter writer) { var builder = new StringBuilder(); var body = new RequestBody(); var publishmentSystemId = int.Parse(Page.Request.QueryString["PublishmentSystemID"]); _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId); var scripts = ChannelLoading.GetScript(_publishmentSystemInfo, ELoadingType.ContentTree, null); builder.Append(scripts); if (Page.Request.QueryString["PublishmentSystemID"] != null) { try { var nodeIdList = DataProvider.NodeDao.GetNodeIdListByParentId(_publishmentSystemInfo.PublishmentSystemId, 0); foreach (var nodeId in nodeIdList) { var nodeInfo = NodeManager.GetNodeInfo(_publishmentSystemInfo.PublishmentSystemId, nodeId); var enabled = AdminUtility.IsOwningNodeId(body.AdministratorName, nodeInfo.NodeId); if (!enabled) { if (!AdminUtility.IsHasChildOwningNodeId(body.AdministratorName, nodeInfo.NodeId)) { continue; } } builder.Append(ChannelLoading.GetChannelRowHtml(_publishmentSystemInfo, nodeInfo, enabled, ELoadingType.ContentTree, null, body.AdministratorName)); } } catch (Exception ex) { PageUtils.RedirectToErrorPage(ex.Message); } } writer.Write(builder); }
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()); }
public bool IsOwningNodeId(int nodeId) { return(AdminUtility.IsOwningNodeId(Body.AdministratorName, nodeId)); }