public static string GetChannelRowHtml(PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo, string target, bool isShowTreeLine, bool isShowContentNum, string currentFormatString, int topNodeID, int topParantsCount, int currentNodeID) { var nodeTreeItem = new StlTreeItemAjax(publishmentSystemInfo, nodeInfo, target, isShowTreeLine, isShowContentNum, currentFormatString, topNodeID, topParantsCount, currentNodeID); var title = nodeTreeItem.GetItemHtml(); string rowHtml = $@" <tr treeItemLevel=""{nodeInfo.ParentsCount + 1}""> <td nowrap> {title} </td> </tr> "; return(rowHtml); }
private static string ParseImplAjax(PageInfo pageInfo, ContextInfo contextInfo, string channelIndex, string channelName, int upLevel, int topLevel, string groupChannel, string groupChannelNot, string title, bool isShowContentNum, bool isShowTreeLine, string currentFormatString) { pageInfo.AddPageScriptsIfNotExists(PageInfo.Components.Jquery); var channelID = StlDataUtility.GetNodeIdByLevel(pageInfo.PublishmentSystemId, contextInfo.ChannelID, upLevel, topLevel); channelID = StlCacheManager.NodeId.GetNodeIdByChannelIdOrChannelIndexOrChannelName(pageInfo.PublishmentSystemId, channelID, channelIndex, channelName); var channel = NodeManager.GetNodeInfo(pageInfo.PublishmentSystemId, channelID); var target = ""; var htmlBuilder = new StringBuilder(); htmlBuilder.Append(@"<table border=""0"" cellpadding=""0"" cellspacing=""0"" style=""width:100%;"">"); var theNodeIdList = DataProvider.NodeDao.GetNodeIdListByScopeType(channel, EScopeType.SelfAndChildren, groupChannel, groupChannelNot); var nodeIDArrayList = new List <int>(); var currentNodeInfo = NodeManager.GetNodeInfo(pageInfo.PublishmentSystemId, pageInfo.PageNodeId); if (currentNodeInfo != null) { nodeIDArrayList = TranslateUtils.StringCollectionToIntList(currentNodeInfo.ParentsPath); nodeIDArrayList.Add(currentNodeInfo.NodeId); } foreach (int theNodeID in theNodeIdList) { var theNodeInfo = NodeManager.GetNodeInfo(pageInfo.PublishmentSystemId, theNodeID); var nodeInfo = new NodeInfo(theNodeInfo); if (theNodeID == pageInfo.PublishmentSystemId && !string.IsNullOrEmpty(title)) { nodeInfo.NodeName = title; } var rowHtml = GetChannelRowHtml(pageInfo.PublishmentSystemInfo, nodeInfo, target, isShowTreeLine, isShowContentNum, currentFormatString, channelID, channel.ParentsCount, pageInfo.PageNodeId); htmlBuilder.Append(rowHtml); } htmlBuilder.Append("</table>"); pageInfo.AddPageScriptsIfNotExists(PageInfo.JsAgStlTreeAjax, StlTreeItemAjax.GetScript(pageInfo, target, isShowTreeLine, isShowContentNum, currentFormatString, channelID, channel.ParentsCount, pageInfo.PageNodeId)); return(htmlBuilder.ToString()); }
private static string ParseImplAjax(PageInfo pageInfo, ContextInfo contextInfo, string channelIndex, string channelName, int upLevel, int topLevel, string groupChannel, string groupChannelNot, string title, bool isShowContentNum, bool isShowTreeLine, string currentFormatString, bool isLocal) { pageInfo.AddPageBodyCodeIfNotExists(PageInfo.Const.Jquery); var channelId = StlDataUtility.GetChannelIdByLevel(pageInfo.SiteId, contextInfo.ChannelId, upLevel, topLevel); channelId = StlDataUtility.GetChannelIdByChannelIdOrChannelIndexOrChannelName(pageInfo.SiteId, channelId, channelIndex, channelName); var channel = ChannelManager.GetChannelInfo(pageInfo.SiteId, channelId); var target = ""; var htmlBuilder = new StringBuilder(); htmlBuilder.Append(@"<table border=""0"" cellpadding=""0"" cellspacing=""0"" style=""width:100%;"">"); //var theChannelIdList = DataProvider.ChannelDao.GetIdListByScopeType(channel.ChannelId, channel.ChildrenCount, EScopeType.SelfAndChildren, groupChannel, groupChannelNot); var theChannelIdList = ChannelManager.GetChannelIdList(channel, EScopeType.SelfAndChildren, groupChannel, groupChannelNot, string.Empty); foreach (var theChannelId in theChannelIdList) { var theChannelInfo = ChannelManager.GetChannelInfo(pageInfo.SiteId, theChannelId); var nodeInfo = new ChannelInfo(theChannelInfo); if (theChannelId == pageInfo.SiteId && !string.IsNullOrEmpty(title)) { nodeInfo.ChannelName = title; } var rowHtml = GetChannelRowHtml(pageInfo.SiteInfo, nodeInfo, target, isShowTreeLine, isShowContentNum, currentFormatString, channelId, channel.ParentsCount, pageInfo.PageChannelId, isLocal); htmlBuilder.Append(rowHtml); } htmlBuilder.Append("</table>"); if (!pageInfo.BodyCodes.ContainsKey(PageInfo.Const.JsAgStlTreeAjax)) { pageInfo.BodyCodes.Add(PageInfo.Const.JsAgStlTreeAjax, StlTreeItemAjax.GetScript(pageInfo, target, isShowTreeLine, isShowContentNum, currentFormatString, channelId, channel.ParentsCount, pageInfo.PageChannelId)); } return(htmlBuilder.ToString()); }