private string GetNodeTreeHtml()
        {
            var htmlBuilder = new StringBuilder();
            var systemPermissionsInfoList = Session[PageRoleAdd.SystemPermissionsInfoListKey] as List <SystemPermissionsInfo>;

            if (systemPermissionsInfoList == null)
            {
                PageUtils.RedirectToErrorPage("超出时间范围,请重新进入!");
                return(string.Empty);
            }
            var nodeIdList = new List <int>();

            foreach (var systemPermissionsInfo in systemPermissionsInfoList)
            {
                nodeIdList.AddRange(TranslateUtils.StringCollectionToIntList(systemPermissionsInfo.NodeIdCollection));
            }

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            htmlBuilder.Append("<span id='ChannelSelectControl'>");
            var theNodeIdList   = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(PublishmentSystemId);
            var isLastNodeArray = new bool[theNodeIdList.Count];

            foreach (var theNodeId in theNodeIdList)
            {
                var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, theNodeId);
                htmlBuilder.Append(GetTitle(nodeInfo, treeDirectoryUrl, isLastNodeArray, nodeIdList));
                htmlBuilder.Append("<br/>");
            }
            htmlBuilder.Append("</span>");
            return(htmlBuilder.ToString());
        }
Example #2
0
        private ChannelTreeItem(SiteInfo siteInfo, ChannelInfo channelInfo, bool enabled, PermissionManager permissionManager)
        {
            _siteInfo          = siteInfo;
            _channelInfo       = channelInfo;
            _enabled           = enabled;
            _permissionManager = permissionManager;

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            //为后台栏目树中的首页和外链栏目添加图标
            if (_channelInfo.ParentId == 0)
            {
                _contentModelIconClass = "ion-ios-home";
            }
            else if (_channelInfo.LinkUrl.Length != 0)
            {
                _contentModelIconClass = "ion-link";
            }
            else
            {
                _contentModelIconClass = "ion-folder";
            }

            _iconEmptyUrl = PageUtils.Combine(treeDirectoryUrl, "empty.gif");
            _iconMinusUrl = PageUtils.Combine(treeDirectoryUrl, "minus.png");
            _iconPlusUrl  = PageUtils.Combine(treeDirectoryUrl, "plus.png");
        }
Example #3
0
        private ChannelTreeItem(SiteInfo siteInfo, ChannelInfo channelInfo, bool enabled, PermissionManager permissionManager)
        {
            _siteInfo          = siteInfo;
            _channelInfo       = channelInfo;
            _enabled           = enabled;
            _permissionManager = permissionManager;

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            _contentModelIconUrl = PageUtils.Combine(treeDirectoryUrl, "folder.gif");
            _iconEmptyUrl        = PageUtils.Combine(treeDirectoryUrl, "empty.gif");
            _iconMinusUrl        = PageUtils.Combine(treeDirectoryUrl, "minus.png");
            _iconPlusUrl         = PageUtils.Combine(treeDirectoryUrl, "plus.png");

            if (!string.IsNullOrEmpty(channelInfo.ContentModelPluginId))
            {
                _contentModelIconClass = PluginMenuManager.GetPluginIconClass(channelInfo.ContentModelPluginId);
                if (string.IsNullOrEmpty(_contentModelIconClass))
                {
                    var iconUrl = PluginManager.GetPluginIconUrl(channelInfo.ContentModelPluginId);
                    if (!string.IsNullOrEmpty(iconUrl))
                    {
                        _contentModelIconUrl = iconUrl;
                    }
                }
            }
        }
        private string GetNodeTreeHtml()
        {
            var htmlBuilder = new StringBuilder();
            var systemPermissionsInfoList = Session[PageAdminRoleAdd.SystemPermissionsInfoListKey] as List <SitePermissionsInfo>;

            if (systemPermissionsInfoList == null)
            {
                PageUtils.RedirectToErrorPage("超出时间范围,请重新进入!");
                return(string.Empty);
            }
            var channelIdList = new List <int>();

            foreach (var systemPermissionsInfo in systemPermissionsInfoList)
            {
                channelIdList.AddRange(TranslateUtils.StringCollectionToIntList(systemPermissionsInfo.ChannelIdCollection));
            }

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            htmlBuilder.Append("<span id='ChannelSelectControl'>");
            var theChannelIdList = ChannelManager.GetChannelIdList(SiteId);

            foreach (var theChannelId in theChannelIdList)
            {
                var channelInfo = ChannelManager.GetChannelInfo(SiteId, theChannelId);
                htmlBuilder.Append(GetTitle(channelInfo, treeDirectoryUrl, channelIdList));
                htmlBuilder.Append("<br />");
            }
            htmlBuilder.Append("</span>");
            return(htmlBuilder.ToString());
        }
Example #5
0
        //public static List<int> GetWritingSiteIdList(PermissionsImpl permissionsImpl)
        //{
        //    var siteIdList = new List<int>();

        //    if (!string.IsNullOrEmpty(permissionsImpl.UserName))
        //    {
        //        if (permissionsImpl.IsConsoleAdministrator || permissionsImpl.IsSystemAdministrator)//如果是超级管理员或站点管理员
        //        {
        //            foreach (var siteId in permissionsImpl.SiteIdList)
        //            {
        //                if (!siteIdList.Contains(siteId))
        //                {
        //                    siteIdList.Add(siteId);
        //                }
        //            }
        //        }
        //        else
        //        {
        //            foreach (var siteId in permissionsImpl.SiteIdList)
        //            {
        //                if (!siteIdList.Contains(siteId))
        //                {
        //                    var channelIdCollection = DataProvider.SitePermissionsDao.GetAllPermissionList(permissionsImpl.Roles, siteId, true);
        //                    if (channelIdCollection.Count > 0)
        //                    {
        //                        siteIdList.Add(siteId);
        //                    }
        //                }
        //            }
        //        }
        //    }

        //    return siteIdList;
        //}

        public static string GetSiteName(SiteInfo siteInfo)
        {
            var padding = string.Empty;

            var    level = GetSiteLevel(siteInfo.Id);
            string psLogo;

            if (siteInfo.IsRoot)
            {
                psLogo = "siteHQ.gif";
            }
            else
            {
                psLogo = "site.gif";
                if (level > 0 && level < 10)
                {
                    psLogo = $"subsite{level + 1}.gif";
                }
            }
            psLogo = SiteServerAssets.GetIconUrl("tree/" + psLogo);

            for (var i = 0; i < level; i++)
            {
                padding += " ";
            }
            if (level > 0)
            {
                padding += "└ ";
            }

            return($"{padding}<img align='absbottom' border='0' src='{psLogo}'/>&nbsp;{siteInfo.SiteName}");
        }
Example #6
0
        private string GetChannelTreeHtml()
        {
            var htmlBuilder = new StringBuilder();

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            htmlBuilder.Append("<span id='ChannelSelectControl'>");
            var channelIdList = DataProvider.ChannelDao.GetIdListBySiteId(SiteId);
            var isLastNodeArray = new bool[channelIdList.Count];
            foreach (var channelId in channelIdList)
            {
                var nodeInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
                htmlBuilder.Append(GetTitle(nodeInfo, treeDirectoryUrl, isLastNodeArray));
                htmlBuilder.Append("<br/>");
            }
            htmlBuilder.Append("</span>");
            return htmlBuilder.ToString();
        }
Example #7
0
        public static string GetNodeTreeLastImageHtml(SiteInfo siteInfo, ChannelInfo nodeInfo)
        {
            var imageHtml = string.Empty;

            if (nodeInfo.ParentId == 0)
            {
                var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");
                if (siteInfo.IsRoot == false)
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" title=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "site.gif")}"" />&nbsp;";
                }
                else
                {
                    imageHtml =
                        $@"<img align=""absmiddle"" title=""站点"" border=""0"" src=""{PageUtils.Combine(treeDirectoryUrl,
                            "siteHQ.gif")}"" />&nbsp;";
                }
            }
            if (!string.IsNullOrEmpty(nodeInfo.ContentRelatedPluginIds))
            {
                foreach (var service in PluginContentManager.GetContentPlugins(nodeInfo, false))
                {
                    var iconClass = PluginMenuManager.GetPluginIconClass(service.PluginId);
                    if (!string.IsNullOrEmpty(iconClass))
                    {
                        imageHtml +=
                            $@"<i class=""{iconClass}"" title=""{service.Metadata.Title}"" style=""color: #00b19d;display: inline-block;font-size: 18px;vertical-align: middle;width: 16px;""></i>";
                    }
                    else
                    {
                        imageHtml +=
                            $@"<img align=""absmiddle"" title=""{service.Metadata.Title}"" border=""0"" src=""{PluginManager.GetPluginIconUrl(service)}"" width=""18"" height=""18"" />";
                    }
                }
            }
            return(imageHtml);
        }