⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contentselecttreexml.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.AccessManage;
    using PowerEasy.Common;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.Enumerations;
    using PowerEasy.Model.Contents;
    using PowerEasy.Web.UI;
    using System;
    using System.Web;
    using System.Web.UI.HtmlControls;

    public class ContentSelectTreeXml : AdminPage
    {
        protected HtmlForm form1;
        private static bool m_EnableAddWhenHasChild;
        private static bool m_IsChildNodePurview;
        private static bool m_IsInput;
        private static bool m_IsManage;
        private static bool m_IsShow;

        private static void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo)
        {
            m_IsShow = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId);
            m_IsInput = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId);
            m_IsManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId);
            string str = "";
            if (!Administrator)
            {
                if (nodeInfo.ArrChildId.IndexOf(",") > 0)
                {
                    foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId))
                    {
                        m_IsChildNodePurview = (RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, info.NodeId) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, info.NodeId)) || RolePermissions.AccessCheckNodePermission(OperateCode.ContentManage, info.NodeId);
                        if (m_IsChildNodePurview)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    m_EnableAddWhenHasChild = true;
                }
            }
            if (ModelManager.GetNodesModelTemplateRelationShip(nodeInfo.NodeId, DataConverter.CLng(HttpContext.Current.Request["ModelId"])).IsNull)
            {
                m_IsInput = false;
                m_IsManage = false;
            }
            if ((m_IsShow || m_IsInput) || (m_IsManage || m_IsChildNodePurview))
            {
                XTreeItem item = new XTreeItem();
                item.Text = nodeInfo.NodeName;
                item.ArrModelId = "0";
                item.ArrModelName = "";
                item.NodeId = nodeInfo.NodeId.ToString();
                item.Target = "";
                item.Expand = "0";
                if (nodeInfo.Child > 0)
                {
                    item.XmlSrc = string.Concat(new object[] { "ContentSelectTreeXml.aspx?NodeID=", nodeInfo.NodeId, "&ModelId=", HttpContext.Current.Request["ModelId"] });
                }
                if (!m_IsInput && !m_IsManage)
                {
                    str = "Forbid";
                    item.AnchorType = "0";
                }
                else
                {
                    switch (nodeInfo.PurviewType)
                    {
                        case 0:
                            str = "Container";
                            break;

                        case 1:
                            str = "HalfOpen";
                            break;

                        case 2:
                            str = "Purview";
                            break;

                        default:
                            str = "Container";
                            break;
                    }
                    item.AnchorType = "2";
                    if (!m_EnableAddWhenHasChild)
                    {
                        str = "Forbid";
                        item.AnchorType = "0";
                    }
                }
                item.Icon = str;
                xTreeList.Add(item);
            }
        }

        private static void ContentXml(XTreeCollection xTreeList)
        {
            foreach (NodeInfo info in Nodes.GetNodesListByParentId(DataConverter.CLng(HttpContext.Current.Request.QueryString["NodeID"])))
            {
                m_IsShow = false;
                m_IsInput = false;
                m_IsManage = false;
                m_IsChildNodePurview = false;
                m_EnableAddWhenHasChild = info.Settings.EnableAddWhenHasChild;
                AddXTreeItem(xTreeList, info);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Clear();
            base.Response.ContentType = "text/xml; charset=UTF-8";
            base.Response.CacheControl = "no-cache";
            XTreeCollection xTreeList = new XTreeCollection();
            ContentXml(xTreeList);
            base.Response.Write(xTreeList.ToString());
            base.Response.End();
        }

        private static bool Administrator
        {
            get
            {
                return PEContext.Current.Admin.IsSuperAdmin;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -