private static void SpecialSelectXml(XTreeCollection xTreeList)
 {
     if (DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"]) <= 0)
     {
         foreach (SpecialCategoryInfo info in Special.GetSpecialCategoryList())
         {
             string str  = "javascript:category();";
             string str2 = "";
             if (Special.ExistsSpecialCategoryIdInSpecials(info.SpecialCategoryId))
             {
                 str2 = "SpecialSelectTreeXml.aspx?Action=SpecialSelect&SpecialCategoryID=" + info.SpecialCategoryId;
             }
             XTreeItem item = new XTreeItem();
             item.Text         = "[专题类别]" + info.SpecialCategoryName;
             item.ArrModelId   = "1";
             item.ArrModelName = "";
             item.Icon         = "Container";
             item.NodeId       = info.SpecialCategoryId.ToString();
             item.Target       = "";
             item.Expand       = "0";
             item.AnchorType   = "1";
             item.XmlSrc       = str2;
             item.Action       = str;
             xTreeList.Add(item);
         }
     }
     else
     {
         foreach (SpecialInfo info2 in Special.GetSpecialList(DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"])))
         {
             string    str3  = "javascript:going(" + info2.SpecialId.ToString() + ");";
             XTreeItem item2 = new XTreeItem();
             item2.Text         = info2.SpecialName;
             item2.ArrModelId   = "0";
             item2.ArrModelName = "";
             item2.NodeId       = info2.SpecialId.ToString();
             item2.Icon         = "Container";
             item2.Target       = "";
             item2.Expand       = "0";
             if (!PEContext.Current.Admin.IsSuperAdmin)
             {
                 if (RolePermissions.AccessCheckSpecialPermission(OperateCode.SpecialContentInput, info2.SpecialId))
                 {
                     item2.AnchorType = "1";
                 }
                 else
                 {
                     item2.AnchorType = "0";
                 }
             }
             else
             {
                 item2.AnchorType = "1";
             }
             item2.XmlSrc = "";
             item2.Action = str3;
             xTreeList.Add(item2);
         }
     }
 }
 private static void SpecialXml(XTreeCollection xTreeList)
 {
     if (DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"]) <= 0)
     {
         foreach (SpecialCategoryInfo info in Special.GetSpecialCategoryList())
         {
             string str  = "SpecialManage.aspx?SpecialCategoryID=" + info.SpecialCategoryId;
             string str2 = "";
             string str3 = "2";
             if (Special.ExistsSpecialCategoryIdInSpecials(info.SpecialCategoryId))
             {
                 str3 = "1";
                 str2 = "SpecialTreeXml.aspx?SpecialCategoryID=" + info.SpecialCategoryId;
             }
             XTreeItem item = new XTreeItem();
             item.Text         = info.SpecialCategoryName;
             item.ArrModelId   = str3;
             item.ArrModelName = "";
             item.Icon         = "Container";
             item.NodeId       = info.SpecialCategoryId.ToString();
             item.Target       = "main_right";
             item.Expand       = "0";
             item.AnchorType   = "2";
             item.XmlSrc       = str2;
             item.Action       = str;
             item.Title        = "小贴士:您可以在节点名称上点击鼠标右键,从弹出菜单中选择相关操作。";
             xTreeList.Add(item);
         }
     }
     else
     {
         foreach (SpecialInfo info2 in Special.GetSpecialList(DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"])))
         {
             string    str4  = "Special.aspx?Action=Modify&amp;SpecialID=" + info2.SpecialId;
             XTreeItem item2 = new XTreeItem();
             item2.Text         = info2.SpecialName;
             item2.ArrModelId   = "0";
             item2.ArrModelName = "";
             item2.NodeId       = info2.SpecialId.ToString();
             item2.Icon         = "Container";
             item2.Target       = "main_right";
             item2.Expand       = "0";
             item2.AnchorType   = "2";
             item2.XmlSrc       = "";
             item2.Action       = str4;
             item2.Title        = "小贴士:您可以在节点名称上点击鼠标右键,从弹出菜单中选择相关操作。";
             xTreeList.Add(item2);
         }
     }
 }
Example #3
0
        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 trees     = new XTreeCollection();
            string          uploadDir = SiteConfig.SiteOption.UploadDir;
            string          str2      = base.Request["Dir"];

            str2 = uploadDir + str2 + "/";
            DirectoryInfo info = new DirectoryInfo(base.Request.PhysicalApplicationPath + str2);

            foreach (DirectoryInfo info2 in info.GetDirectories())
            {
                string    str3 = "fileManage.aspx?Dir=" + base.Server.UrlEncode(base.Request.QueryString["Dir"] + "/" + info2.Name);
                XTreeItem item = new XTreeItem();
                item.Text         = info2.Name;
                item.ArrModelId   = "";
                item.ArrModelName = "";
                item.Icon         = "";
                item.NodeId       = "";
                item.Target       = "main_right";
                item.Expand       = "0";
                item.Enable       = "1";
                if (info2.GetDirectories().Length > 0)
                {
                    item.XmlSrc = "UploadDirectoriesXML.aspx?Dir=" + base.Server.UrlEncode(base.Request["Dir"] + "/" + info2.Name);
                }
                item.Action = str3;
                trees.Add(item);
            }
            base.Response.Write(trees.ToString());
            base.Response.End();
        }
Example #4
0
        private void TemplateSelect(XTreeCollection xTreeList)
        {
            string str         = base.BasePath + SiteConfig.SiteOption.ManageDir;
            string templateDir = SiteConfig.SiteOption.TemplateDir;
            string str3        = base.Request["Dir"];

            str3 = templateDir + str3 + "/";
            DirectoryInfo info = new DirectoryInfo(base.Request.PhysicalApplicationPath + str3);

            foreach (DirectoryInfo info2 in info.GetDirectories())
            {
                if ((info2.Name != "标签库") && (info2.Name != "分页标签库"))
                {
                    string    str4 = str + "/Accessories/ShowTemplates.aspx?FilesDir=" + base.Server.UrlEncode(base.Request.QueryString["Dir"] + "/" + info2.Name);
                    XTreeItem item = new XTreeItem();
                    item.Text         = info2.Name;
                    item.ArrModelId   = "";
                    item.ArrModelName = "";
                    item.Icon         = "";
                    item.NodeId       = "";
                    item.Target       = "main_right";
                    item.Expand       = "0";
                    item.AnchorType   = "1";
                    if (info2.GetDirectories().Length > 0)
                    {
                        item.XmlSrc = str + "/Template/TemplateDirectoriesXML.aspx?Action=TemplateSelect&Dir=" + base.Server.UrlEncode(base.Request["Dir"] + "/" + info2.Name);
                    }
                    item.Action = str4;
                    xTreeList.Add(item);
                }
            }
        }
 public static void SpecialInfoXml(XTreeCollection xTreeList)
 {
     if (DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"]) <= 0)
     {
         foreach (SpecialCategoryInfo info in Special.GetSpecialCategoryList())
         {
             XTreeItem item = new XTreeItem();
             string    str  = "";
             if (Special.ExistsSpecialCategoryIdInSpecials(info.SpecialCategoryId))
             {
                 str = "SpecialInfoTreeXml.aspx?SpecialCategoryID=" + info.SpecialCategoryId;
             }
             item.Text         = info.SpecialCategoryName;
             item.ArrModelId   = "1";
             item.ArrModelName = "";
             item.Icon         = "Container";
             item.NodeId       = info.SpecialCategoryId.ToString();
             item.Target       = "main_right";
             item.Expand       = "0";
             item.AnchorType   = "2";
             item.XmlSrc       = str;
             item.Action       = "SpecialInfosManage.aspx?SpecialCategoryID=" + info.SpecialCategoryId;
             xTreeList.Add(item);
         }
     }
     else
     {
         foreach (SpecialInfo info2 in Special.GetSpecialList(DataConverter.CLng(HttpContext.Current.Request.QueryString["SpecialCategoryID"])))
         {
             XTreeItem item2 = new XTreeItem();
             item2.Text         = info2.SpecialName;
             item2.ArrModelId   = "0";
             item2.ArrModelName = "";
             item2.NodeId       = info2.SpecialId.ToString();
             item2.Icon         = "Container";
             item2.Target       = "main_right";
             item2.Expand       = "0";
             item2.AnchorType   = "2";
             item2.XmlSrc       = "";
             item2.Action       = string.Concat(new object[] { "SpecialInfosManage.aspx?SpecialCategoryID=", info2.SpecialCategoryId, "&SpecialID=", info2.SpecialId, "&SpecialName=", HttpContext.Current.Server.UrlEncode(info2.SpecialName) });
             xTreeList.Add(item2);
         }
     }
 }
Example #6
0
        private void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo)
        {
            XTreeItem item = new XTreeItem();

            item.NodeId       = nodeInfo.NodeId.ToString();
            item.Text         = nodeInfo.NodeName;
            item.ArrModelId   = "";
            item.ArrModelName = "";
            item.Target       = "main_right";
            item.Expand       = "0";
            item.Action       = string.Concat(new object[] { "CommentManage.aspx?NodeID=", nodeInfo.NodeId, "&NodeName=", base.Server.UrlEncode(nodeInfo.NodeName) });
            string str  = "";
            string str2 = "";

            switch (nodeInfo.PurviewType)
            {
            case 0:
                str = "Container";
                break;

            case 1:
                str = "HalfOpen";
                break;

            case 2:
                str = "Purview";
                break;

            default:
                str = "Container";
                break;
            }
            str2            = "2";
            item.Icon       = str;
            item.AnchorType = str2;
            if (nodeInfo.Child > 0)
            {
                item.XmlSrc = "CommentXml.aspx?NodeID=" + nodeInfo.NodeId;
            }
            xTreeList.Add(item);
        }
        private static void CategoryXml(XTreeCollection xTreeList)
        {
            IList <NodeInfo> nodesListByParentId = Nodes.GetNodesListByParentId(DataConverter.CLng(HttpContext.Current.Request.QueryString["NodeID"]));

            action = HttpContext.Current.Request.QueryString["Action"];
            foreach (NodeInfo info in nodesListByParentId)
            {
                bool   isShow = true;
                bool   isCurrentNodesManage  = true;
                bool   isChildNodesManage    = true;
                string arrCurrentNodesManage = "";
                string str2 = "";
                CheckPurview(info, ref isShow, ref isCurrentNodesManage, ref isChildNodesManage, ref arrCurrentNodesManage);
                if (!isShow && !isCurrentNodesManage)
                {
                    continue;
                }
                XTreeItem item = new XTreeItem();
                string    str3 = "";
                if (info.Child > 0)
                {
                    str3 = "child";
                }
                string str4 = AddRight(isCurrentNodesManage, isChildNodesManage);
                item.Text         = info.NodeName;
                item.ArrModelId   = "";
                item.ArrModelName = str3;
                item.NodeId       = info.NodeId.ToString();
                item.ArrPurview   = str4;
                item.Target       = "main_right";
                item.Expand       = "1";
                item.NodeType     = info.NodeType.ToString();
                if (string.Compare(action, "Order", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    item.Title = "小贴士:如果您想对某个栏目的子栏目进行排序,请点击左侧栏目树中的对应节点,然后在右边的栏目列表中排序并保存。";
                }
                else
                {
                    item.Title = "小贴士:您可以在节点名称上点击鼠标右键,从弹出菜单中选择相关操作。";
                }
                if (info.Child > 0)
                {
                    if (string.Compare(action, "Order", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        item.XmlSrc = "NodeTreeXml.aspx?Action=Order&NodeID=" + info.NodeId;
                    }
                    else
                    {
                        item.XmlSrc = "NodeTreeXml.aspx?NodeID=" + info.NodeId;
                    }
                }
                if (string.Compare(action, "Order", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    item.Action = "CategoryOrder.aspx?Action=Order&NodeID=" + info.NodeId;
                }
                else
                {
                    item.Action = "Category.aspx?Action=Modify&NodeID=" + info.NodeId;
                }
                switch (info.NodeType)
                {
                case NodeType.Container:
                    if (!isCurrentNodesManage)
                    {
                        goto Label_025B;
                    }
                    switch (info.PurviewType)
                    {
                    case 1:
                        goto Label_0234;

                    case 2:
                        goto Label_023D;
                    }
                    goto Label_0246;

                case NodeType.Single:
                    str2 = "Single";
                    goto Label_0280;

                case NodeType.Link:
                    str2 = "Link";
                    goto Label_0280;

                default:
                    goto Label_0280;
                }
                str2 = "Container";
                goto Label_024D;
Label_0234:
                str2 = "HalfOpen";
                goto Label_024D;
Label_023D:
                str2 = "Purview";
                goto Label_024D;
Label_0246:
                str2 = "Container";
Label_024D:
                item.AnchorType = "2";
                goto Label_0280;
Label_025B:
                str2            = "Forbid";
                item.AnchorType = "0";
Label_0280:
                item.Icon = str2;
                xTreeList.Add(item);
            }
        }
Example #8
0
        private void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo)
        {
            this.CheckPermissions(nodeInfo);
            if ((this.m_IsShow || this.m_IsNodeShow) || (this.m_IsNodeInput || this.m_IsNodeManage))
            {
                XTreeItem item = new XTreeItem();
                item.Text = nodeInfo.NodeName;
                bool          flag = false;
                StringBuilder sb   = new StringBuilder();
                string        str  = "";
                string        str2 = "";
                string        str3 = string.Concat(new object[] { "ContentManage.aspx?NodeID=", nodeInfo.NodeId, "&NodeName=", HttpContext.Current.Server.UrlEncode(DataSecurity.XmlEncode(nodeInfo.NodeName)) });
                foreach (DataRow row in ModelManager.GetContentModelListByNodeId(nodeInfo.NodeId, true).Rows)
                {
                    if (this.m_IsNodeInput || this.m_IsNodeManage)
                    {
                        StringHelper.AppendString(sb, row["ModelId"].ToString());
                        if (string.IsNullOrEmpty(str))
                        {
                            str = "添加" + row["ItemName"].ToString() + "||" + row["IsEshop"].ToString() + "||" + row["AddInfoFilePath"].ToString();
                            str = str + "||管理" + row["ItemName"].ToString() + "||" + row["IsEshop"].ToString() + "||" + row["ManageInfoFilePath"].ToString();
                        }
                        else
                        {
                            str = str + "$$$添加" + row["ItemName"].ToString() + "||" + row["IsEshop"].ToString() + "||" + row["AddInfoFilePath"].ToString();
                            str = str + "||管理" + row["ItemName"].ToString() + "||" + row["IsEshop"].ToString() + "||" + row["ManageInfoFilePath"].ToString();
                        }
                        if (this.m_IsCurrentNodesManage)
                        {
                            str2 = "1";
                        }
                    }
                    flag = true;
                }
                item.ArrModelId   = sb.ToString();
                item.ArrModelName = str;
                item.ArrPurview   = str2;
                item.Title        = "小贴士:您可以在节点名称上点击鼠标右键,从弹出菜单中选择相关操作。";
                item.Action       = str3;
                item.NodeId       = nodeInfo.NodeId.ToString();
                item.Target       = "main_right";
                item.Expand       = "0";
                if (nodeInfo.Child > 0)
                {
                    item.XmlSrc = "ContentTreeXml.aspx?NodeID=" + nodeInfo.NodeId;
                }
                string str4 = "";
                switch (nodeInfo.PurviewType)
                {
                case 0:
                    str4 = "Container";
                    break;

                case 1:
                    str4 = "HalfOpen";
                    break;

                case 2:
                    str4 = "Purview";
                    break;

                default:
                    str4 = "Container";
                    break;
                }
                if (this.m_IsCurrentNodesManage)
                {
                    item.ArrPurview = "AllowSetNode";
                }
                else
                {
                    item.ArrPurview = "NoAllowSetNode";
                }
                if (!flag)
                {
                    str4 = "Forbid";
                    if (this.Administrator || this.m_IsCurrentNodesManage)
                    {
                        item.AnchorType = "3";
                        item.Title      = "该节点没有绑定内容模型,请在右键弹出菜单中选择[设置节点]绑定内容模型";
                    }
                    else
                    {
                        item.AnchorType = "0";
                        item.Title      = "您没有该节点的管理权限。";
                    }
                }
                else if ((this.m_IsNodeShow || this.m_IsNodeInput) || this.m_IsNodeManage)
                {
                    item.AnchorType = "2";
                }
                else
                {
                    str4 = "Forbid";
                    if (this.m_IsCurrentNodesManage)
                    {
                        item.AnchorType = "3";
                        item.Title      = "该节点没有绑定内容模型,请在右键弹出菜单中选择[设置节点]绑定内容模型";
                    }
                    else
                    {
                        item.AnchorType = "0";
                        item.Title      = "您没有该节点的管理权限。";
                    }
                }
                item.Icon = str4;
                xTreeList.Add(item);
            }
        }
Example #9
0
        private static void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo)
        {
            s_IsShow   = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId);
            s_IsInput  = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId);
            s_IsManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId);
            string str = "";

            if (!s_IsAdministrator)
            {
                if (nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0)
                {
                    foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId))
                    {
                        s_IsChildNodePurview = (RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, info.NodeId) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, info.NodeId)) || RolePermissions.AccessCheckNodePermission(OperateCode.ContentManage, info.NodeId);
                        if (s_IsChildNodePurview)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    s_EnableAddWhenHasChild = true;
                }
            }
            if (ModelManager.GetNodesModelTemplateRelationShip(nodeInfo.NodeId, DataConverter.CLng(HttpContext.Current.Request["ModelId"])).IsNull)
            {
                s_IsInput  = false;
                s_IsManage = false;
            }
            if ((s_IsShow || s_IsInput) || (s_IsManage || s_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 (!s_IsInput && !s_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 (!s_EnableAddWhenHasChild)
                    {
                        str             = "Forbid";
                        item.AnchorType = "0";
                    }
                }
                item.Icon = str;
                xTreeList.Add(item);
            }
        }
        private void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo)
        {
            bool flag  = false;
            bool flag2 = false;

            if (nodeInfo.NodeType == NodeType.Container)
            {
                flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, nodeInfo.NodeId);
                if (!Administrator && (nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0))
                {
                    foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId))
                    {
                        if (RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, info.NodeId))
                        {
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (flag2 || flag)
            {
                XTreeItem item = new XTreeItem();
                item.NodeId       = nodeInfo.NodeId.ToString();
                item.Text         = nodeInfo.NodeName;
                item.ArrModelId   = "";
                item.ArrModelName = "";
                item.Target       = "main_right";
                item.Expand       = "0";
                item.Action       = string.Concat(new object[] { "CommentManage.aspx?NodeID=", nodeInfo.NodeId, "&NodeName=", base.Server.UrlEncode(nodeInfo.NodeName) });
                string str  = "";
                string str2 = "";
                if (!flag2)
                {
                    str  = "Forbid";
                    str2 = "0";
                }
                else
                {
                    switch (nodeInfo.PurviewType)
                    {
                    case 0:
                        str = "Container";
                        break;

                    case 1:
                        str = "HalfOpen";
                        break;

                    case 2:
                        str = "Purview";
                        break;

                    default:
                        str = "Container";
                        break;
                    }
                    str2 = "2";
                }
                item.Icon       = str;
                item.AnchorType = str2;
                if (nodeInfo.Child > 0)
                {
                    item.XmlSrc = "CommentTreeXml.aspx?NodeID=" + nodeInfo.NodeId;
                }
                xTreeList.Add(item);
            }
        }