public static string GetSelectText(PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo, bool[] isLastNodeArray, bool isShowContentNum, bool isShowContentModel) { var retval = string.Empty; if (nodeInfo.NodeId == nodeInfo.PublishmentSystemId) { nodeInfo.IsLastNode = true; } if (nodeInfo.IsLastNode == false) { isLastNodeArray[nodeInfo.ParentsCount] = false; } else { isLastNodeArray[nodeInfo.ParentsCount] = true; } for (var i = 0; i < nodeInfo.ParentsCount; i++) { retval = string.Concat(retval, isLastNodeArray[i] ? " " : "│"); } retval = string.Concat(retval, nodeInfo.IsLastNode ? "└" : "├"); retval = string.Concat(retval, nodeInfo.NodeName); if (isShowContentNum) { retval = string.Concat(retval, " (", nodeInfo.ContentNum, ")"); } if (isShowContentModel) { retval = string.Concat(retval, " - ", ContentModelManager.GetContentModelInfo(publishmentSystemInfo, nodeInfo.ContentModelId).ModelName); } return(retval); }
public static ETableStyle GetTableStyle(PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo) { var modelInfo = ContentModelManager.GetContentModelInfo(publishmentSystemInfo, nodeInfo.ContentModelId); if (!string.IsNullOrEmpty(modelInfo?.TableName)) { return(EAuxiliaryTableTypeUtils.GetTableStyle(modelInfo.TableType)); } var tableStyle = ETableStyle.BackgroundContent; if (EContentModelTypeUtils.Equals(EContentModelType.GovPublic, nodeInfo.ContentModelId)) { tableStyle = ETableStyle.GovPublicContent; } else if (EContentModelTypeUtils.Equals(EContentModelType.GovInteract, nodeInfo.ContentModelId)) { tableStyle = ETableStyle.GovInteractContent; } else if (EContentModelTypeUtils.Equals(EContentModelType.Vote, nodeInfo.ContentModelId)) { tableStyle = ETableStyle.VoteContent; } else if (EContentModelTypeUtils.Equals(EContentModelType.Job, nodeInfo.ContentModelId)) { tableStyle = ETableStyle.JobContent; } else if (EContentModelTypeUtils.Equals(EContentModelType.UserDefined, nodeInfo.ContentModelId)) { tableStyle = ETableStyle.UserDefined; } return(tableStyle); }
public static string GetTableName(PublishmentSystemInfo publishmentSystemInfo, string contentModelId) { var modelInfo = ContentModelManager.GetContentModelInfo(publishmentSystemInfo, contentModelId); if (modelInfo != null && !string.IsNullOrEmpty(modelInfo.TableName)) { return(modelInfo.TableName); } var tableName = publishmentSystemInfo.AuxiliaryTableForContent; if (EContentModelTypeUtils.Equals(EContentModelType.GovPublic, contentModelId)) { tableName = publishmentSystemInfo.AuxiliaryTableForGovPublic; } else if (EContentModelTypeUtils.Equals(EContentModelType.GovInteract, contentModelId)) { tableName = publishmentSystemInfo.AuxiliaryTableForGovInteract; } else if (EContentModelTypeUtils.Equals(EContentModelType.Vote, contentModelId)) { tableName = publishmentSystemInfo.AuxiliaryTableForVote; } else if (EContentModelTypeUtils.Equals(EContentModelType.Job, contentModelId)) { tableName = publishmentSystemInfo.AuxiliaryTableForJob; } else if (EContentModelTypeUtils.Equals(EContentModelType.TeacherLib, contentModelId)) { tableName = "siteserver_teacherlibrary"; } return(tableName); }
public static string GetNodeTreeLastImageHtml(PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo) { var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree"); var imageHtml = string.Empty; if (nodeInfo.NodeType == ENodeType.BackgroundPublishNode) { if (publishmentSystemInfo.IsHeadquarters == false) { imageHtml = $@"<img align=""absmiddle"" alt=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl, "site.gif")}"" /></a>"; } else { imageHtml = $@"<img align=""absmiddle"" alt=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl, "siteHQ.gif")}"" />"; } } else { if (string.IsNullOrEmpty(nodeInfo.ContentModelId)) { return(imageHtml); } var modelInfo = ContentModelManager.GetContentModelInfo(publishmentSystemInfo, nodeInfo.ContentModelId); if (!string.IsNullOrEmpty(modelInfo.IconUrl)) { imageHtml += $@" <img align=""absmiddle"" alt=""{modelInfo.ModelName}"" border=""0"" src=""{PageUtils .Combine(treeDirectoryUrl, modelInfo.IconUrl)}"" /></a>"; } } return(imageHtml); }