public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdCreate, AppManager.Cms.LeftMenu.Create.IdConfigurationCreate, "页面生成触发器", AppManager.Cms.Permission.WebSite.Create);

                ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.ConfigurationCreateDetails, null));

                if (Body.IsQueryExists("CurrentNodeID"))
                {
                    _currentNodeId = Body.GetQueryInt("CurrentNodeID");
                    var onLoadScript = ChannelLoading.GetScriptOnLoad(PublishmentSystemId, _currentNodeId);
                    if (!string.IsNullOrEmpty(onLoadScript))
                    {
                        ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                    }
                }

                BindGrid();
            }
        }
예제 #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (IsPostBack)
            {
                return;
            }

            LtlCategoryChannel.Text = string.Format($@"<a href='{PageContent.GetRedirectUrl(PublishmentSystemId, PublishmentSystemInfo.Additional.GovPublicNodeId)}' isLink='true' onclick='fontWeightLink(this)' target='content'>主题分类</a>");

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.GovPublicChannelTree, null));

            var additional = new NameValueCollection
            {
                { "PublishmentSystemID", PublishmentSystemId.ToString() },
                {
                    "DepartmentIDCollection",
                    TranslateUtils.ObjectCollectionToString(
                        GovPublicManager.GetFirstDepartmentIdList(PublishmentSystemInfo))
                }
            };

            ClientScriptRegisterClientScriptBlock("DepartmentTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.ContentTree, additional));

            var categoryClassInfoArrayList = DataProvider.GovPublicCategoryClassDao.GetCategoryClassInfoArrayList(PublishmentSystemId, ETriState.False, ETriState.True);

            foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList)
            {
                ClientScriptRegisterClientScriptBlock("CategoryTreeScript_" + categoryClassInfo.ClassCode, GovPublicCategoryTreeItem.GetScript(categoryClassInfo.ClassCode, PublishmentSystemId, EGovPublicCategoryLoadingType.Tree, null));
            }

            BindGrid(categoryClassInfoArrayList);
        }
예제 #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCrossSiteTrans, null));

            if (AuthRequest.IsQueryExists("CurrentChannelId"))
            {
                _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId");
                var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                if (!string.IsNullOrEmpty(onLoadScript))
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                }
            }

            EBooleanUtils.AddListItems(RblIsCrossSiteTransChecked, "无需审核", "需要审核");
            ControlUtils.SelectSingleItem(RblIsCrossSiteTransChecked, SiteInfo.Additional.IsCrossSiteTransChecked.ToString());
        }
예제 #4
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (!IsPostBack)
            {
                VerifySitePermissions(ConfigManager.WebSitePermissions.Create);

                ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCreateDetails, null));

                if (AuthRequest.IsQueryExists("CurrentChannelId"))
                {
                    _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId");
                    var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                    if (!string.IsNullOrEmpty(onLoadScript))
                    {
                        ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                    }
                }

                BindGrid();
            }
        }
예제 #5
0
        protected override void Render(HtmlTextWriter writer)
        {
            var builder = new StringBuilder();

            var request = new Request();

            var siteId = int.Parse(Page.Request.QueryString["SiteId"]);

            _siteInfo = SiteManager.GetSiteInfo(siteId);
            var scripts = ChannelLoading.GetScript(_siteInfo, ELoadingType.ContentTree, null);

            builder.Append(scripts);
            if (Page.Request.QueryString["SiteId"] != null)
            {
                var channelIdList = DataProvider.ChannelDao.GetIdListByParentId(_siteInfo.Id, 0);
                foreach (var channelId in channelIdList)
                {
                    var nodeInfo = ChannelManager.GetChannelInfo(_siteInfo.Id, channelId);
                    var enabled  = AdminUtility.IsOwningChannelId(request.AdminName, nodeInfo.Id);
                    if (!enabled)
                    {
                        if (!AdminUtility.IsHasChildOwningChannelId(request.AdminName, nodeInfo.Id))
                        {
                            continue;
                        }
                    }

                    builder.Append(ChannelLoading.GetChannelRowHtml(_siteInfo, nodeInfo, enabled, ELoadingType.ContentTree, null, request.AdminName));
                }
            }
            writer.Write(builder);
        }
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, "跨站转发设置", AppManager.Cms.Permission.WebSite.Configration);

                ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.ConfigurationCrossSiteTrans, null));

                if (Body.IsQueryExists("CurrentNodeID"))
                {
                    _currentNodeId = Body.GetQueryInt("CurrentNodeID");
                    var onLoadScript = ChannelLoading.GetScriptOnLoad(PublishmentSystemId, _currentNodeId);
                    if (!string.IsNullOrEmpty(onLoadScript))
                    {
                        ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                    }
                }

                BindGrid();

                EBooleanUtils.AddListItems(IsCrossSiteTransChecked, "无需审核", "需要审核");
                ControlUtils.SelectListItems(IsCrossSiteTransChecked, PublishmentSystemInfo.Additional.IsCrossSiteTransChecked.ToString());
            }
        }
예제 #7
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.SitePermissions.ConfigCrossSiteTrans);

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ConfigurationCrossSiteTrans, null));

            if (AuthRequest.IsQueryExists("CurrentChannelId"))
            {
                _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId");
                var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                if (!string.IsNullOrEmpty(onLoadScript))
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                }
            }

            var channelIdList = ChannelManager.GetChannelIdList(ChannelManager.GetChannelInfo(SiteId, SiteId), EScopeType.SelfAndChildren, string.Empty, string.Empty, string.Empty);

            RptContents.DataSource     = channelIdList;
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();
        }
예제 #8
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            _additional = new NameValueCollection();

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdCreate, AppManager.Cms.LeftMenu.Create.IdConfigurationCreate, "页面命名规则", AppManager.Cms.Permission.WebSite.Create);

                ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.TemplateFilePathRule, _additional));

                if (Body.IsQueryExists("CurrentNodeID"))
                {
                    _currentNodeId = Body.GetQueryInt("CurrentNodeID");
                    var onLoadScript = ChannelLoading.GetScriptOnLoad(PublishmentSystemId, _currentNodeId);
                    if (!string.IsNullOrEmpty(onLoadScript))
                    {
                        ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                    }
                }

                rptContents.DataSource     = DataProvider.NodeDao.GetNodeIdListByParentId(PublishmentSystemId, 0);
                rptContents.ItemDataBound += rptContents_ItemDataBound;
                rptContents.DataBind();
            }
        }
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.Permissions.WebSite.Configration);

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, ELoadingType.ConfigurationCrossSiteTrans, null));

            if (Body.IsQueryExists("CurrentChannelId"))
            {
                _currentChannelId = Body.GetQueryInt("CurrentChannelId");
                var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                if (!string.IsNullOrEmpty(onLoadScript))
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                }
            }

            RptContents.DataSource     = DataProvider.ChannelDao.GetIdListByParentId(SiteId, 0);
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();
        }
예제 #10
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (string.IsNullOrEmpty(AuthRequest.GetQueryString("StartDate")))
            {
                _begin = DateTime.Now.AddMonths(-1);
                _end   = DateTime.Now;
            }
            else
            {
                _begin = TranslateUtils.ToDateTime(AuthRequest.GetQueryString("StartDate"));
                _end   = TranslateUtils.ToDateTime(AuthRequest.GetQueryString("EndDate"));
            }

            if (IsPostBack)
            {
                return;
            }

            VerifyAdministratorPermissions(ConfigManager.SettingsPermissions.Chart);

            DdlSiteId.Items.Add(new ListItem("<<全部站点>>", "0"));
            var siteIdList = SiteManager.GetSiteIdListOrderByLevel();

            foreach (var siteId in siteIdList)
            {
                var siteInfo = SiteManager.GetSiteInfo(siteId);
                DdlSiteId.Items.Add(new ListItem(siteInfo.SiteName, siteId.ToString()));
            }
            ControlUtils.SelectSingleItem(DdlSiteId, SiteId.ToString());

            TbStartDate.Text = DateUtils.GetDateAndTimeString(_begin);
            TbEndDate.Text   = DateUtils.GetDateAndTimeString(_end);

            _additional = new NameValueCollection
            {
                ["StartDate"] = TbStartDate.Text,
                ["EndDate"]   = TbEndDate.Text
            };

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.SiteAnalysis, _additional));

            BindGrid();

            foreach (var key in _siteIdList)
            {
                var yValueNew    = GetYHashtable(key, YTypeNew);
                var yValueUpdate = GetYHashtable(key, YTypeUpdate);

                StrArray1 += $@"
xArrayNew.push('{GetXHashtable(key)}');
yArrayNew.push('{yValueNew}');
yArrayUpdate.push('{yValueUpdate}');";
            }
        }
예제 #11
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _isProtocol = Body.GetQueryBool("isProtocol");
            _jsMethod   = Body.GetQueryString("jsMethod");
            _itemIndex  = Body.GetQueryInt("itemIndex");

            _additional.Add("isProtocol", _isProtocol.ToString());
            _additional.Add("jsMethod", _jsMethod);
            _additional.Add("itemIndex", _itemIndex.ToString());

            if (!IsPostBack)
            {
                if (Body.IsQueryExists("NodeID"))
                {
                    var nodeId    = Body.GetQueryInt("NodeID");
                    var nodeNames = NodeManager.GetNodeNameNavigation(PublishmentSystemId, nodeId);

                    if (!string.IsNullOrEmpty(_jsMethod))
                    {
                        string scripts = $"window.parent.{_jsMethod}({_itemIndex}, '{nodeNames}', {nodeId});";
                        PageUtils.CloseModalPageWithoutRefresh(Page, scripts);
                    }
                    else
                    {
                        var pageUrl = PageUtility.GetChannelUrl(PublishmentSystemInfo, NodeManager.GetNodeInfo(PublishmentSystemId, nodeId));
                        if (_isProtocol)
                        {
                            pageUrl = PageUtils.AddProtocolToUrl(pageUrl);
                        }

                        string scripts = $"window.parent.selectChannel('{nodeNames}', '{nodeId}', '{pageUrl}');";
                        PageUtils.CloseModalPageWithoutRefresh(Page, scripts);
                    }
                }
                else
                {
                    var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, PublishmentSystemId);

                    var linkUrl = PageUtils.GetCmsUrl(nameof(ModalChannelSelect), new NameValueCollection
                    {
                        { "PublishmentSystemID", PublishmentSystemId.ToString() },
                        { "NodeID", nodeInfo.NodeId.ToString() },
                        { "isProtocol", _isProtocol.ToString() },
                        { "jsMethod", _jsMethod },
                        { "itemIndex", _itemIndex.ToString() }
                    });
                    ltlPublishmentSystem.Text = $"<a href='{linkUrl}'>{nodeInfo.NodeName}</a>";
                    ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.ChannelSelect, null));
                    BindGrid();
                }
            }
        }
예제 #12
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _isProtocol = AuthRequest.GetQueryBool("isProtocol");
            _jsMethod   = AuthRequest.GetQueryString("jsMethod");
            _itemIndex  = AuthRequest.GetQueryInt("itemIndex");

            _additional.Add("isProtocol", _isProtocol.ToString());
            _additional.Add("jsMethod", _jsMethod);
            _additional.Add("itemIndex", _itemIndex.ToString());

            if (!IsPostBack)
            {
                if (AuthRequest.IsQueryExists("channelId"))
                {
                    var channelId = AuthRequest.GetQueryInt("channelId");
                    var nodeNames = ChannelManager.GetChannelNameNavigation(SiteId, channelId);

                    if (!string.IsNullOrEmpty(_jsMethod))
                    {
                        string scripts = $"window.parent.{_jsMethod}({_itemIndex}, '{nodeNames}', {channelId});";
                        LayerUtils.CloseWithoutRefresh(Page, scripts);
                    }
                    else
                    {
                        var pageUrl = PageUtility.GetChannelUrl(SiteInfo, ChannelManager.GetChannelInfo(SiteId, channelId), false);
                        if (_isProtocol)
                        {
                            pageUrl = PageUtils.AddProtocolToUrl(pageUrl);
                        }

                        string scripts = $"window.parent.selectChannel('{nodeNames}', '{channelId}', '{pageUrl}');";
                        LayerUtils.CloseWithoutRefresh(Page, scripts);
                    }
                }
                else
                {
                    var nodeInfo = ChannelManager.GetChannelInfo(SiteId, SiteId);

                    var linkUrl = PageUtils.GetCmsUrl(SiteId, nameof(ModalChannelSelect), new NameValueCollection
                    {
                        { "channelId", nodeInfo.Id.ToString() },
                        { "isProtocol", _isProtocol.ToString() },
                        { "jsMethod", _jsMethod },
                        { "itemIndex", _itemIndex.ToString() }
                    });
                    LtlSite.Text = $"<a href='{linkUrl}'>{nodeInfo.ChannelName}</a>";
                    ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.ChannelSelect, null));
                    BindGrid();
                }
            }
        }
예제 #13
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeId   = (int)e.Item.DataItem;
            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);
            var enabled  = EContentModelTypeUtils.Equals(EContentModelType.GovPublic, nodeInfo.ContentModelId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.GovPublicChannel, null, Body.AdministratorName);
        }
예제 #14
0
        protected override void Render(HtmlTextWriter writer)
        {
            var builder = new StringBuilder();

            var request = new AuthRequest();

            var siteId = TranslateUtils.ToInt(Page.Request.QueryString["siteId"]);
            var contentModelPluginId = Page.Request.QueryString["contentModelPluginId"];
            var linkUrl    = Page.Request.QueryString["linkUrl"];
            var additional = new NameValueCollection();

            if (!string.IsNullOrEmpty(linkUrl))
            {
                additional["linkUrl"] = linkUrl;
            }

            if (siteId > 0)
            {
                var siteInfo = SiteManager.GetSiteInfo(siteId);
                if (siteInfo != null)
                {
                    var scripts = ChannelLoading.GetScript(siteInfo, contentModelPluginId, ELoadingType.ContentTree, additional);
                    builder.Append(scripts);

                    var channelIdList = ChannelManager.GetChannelIdList(ChannelManager.GetChannelInfo(siteInfo.Id, siteInfo.Id), EScopeType.SelfAndChildren, string.Empty, string.Empty, string.Empty);
                    foreach (var channelId in channelIdList)
                    {
                        var channelInfo = ChannelManager.GetChannelInfo(siteInfo.Id, channelId);
                        var enabled     = request.AdminPermissions.IsOwningChannelId(channelInfo.Id);
                        if (!string.IsNullOrEmpty(contentModelPluginId) &&
                            !StringUtils.EqualsIgnoreCase(channelInfo.ContentModelPluginId, contentModelPluginId))
                        {
                            enabled = false;
                        }
                        if (!enabled)
                        {
                            if (!request.AdminPermissions.IsDescendantOwningChannelId(channelInfo.SiteId, channelInfo.Id))
                            {
                                continue;
                            }
                            if (!IsDesendantContentModelPluginIdExists(channelInfo, contentModelPluginId))
                            {
                                continue;
                            }
                        }

                        builder.Append(ChannelLoading.GetChannelRowHtml(siteInfo, channelInfo, enabled, ELoadingType.ContentTree, additional, request.AdminPermissions));
                    }
                }
            }
            writer.Write(builder);
        }
예제 #15
0
        public string GetLoadingChannels(int siteId, string contentModelPluginId, int parentId, string loadingType, string additional, RequestImpl request)
        {
            var list = new List <string>();

            var eLoadingType = ELoadingTypeUtils.GetEnumType(loadingType);

            var channelIdList =
                ChannelManager.GetChannelIdList(
                    ChannelManager.GetChannelInfo(siteId, parentId == 0 ? siteId : parentId), EScopeType.Children,
                    string.Empty, string.Empty, string.Empty);

            var siteInfo = SiteManager.GetSiteInfo(siteId);

            var nameValueCollection = TranslateUtils.ToNameValueCollection(TranslateUtils.DecryptStringBySecretKey(additional));

            foreach (var channelId in channelIdList)
            {
                var channelInfo = ChannelManager.GetChannelInfo(siteId, channelId);

                var enabled = request.AdminPermissionsImpl.IsOwningChannelId(channelId);
                if (!string.IsNullOrEmpty(contentModelPluginId) &&
                    !StringUtils.EqualsIgnoreCase(channelInfo.ContentModelPluginId, contentModelPluginId))
                {
                    enabled = false;
                }
                if (!enabled)
                {
                    if (!request.AdminPermissionsImpl.IsDescendantOwningChannelId(siteId, channelId))
                    {
                        continue;
                    }
                    if (!IsDesendantContentModelPluginIdExists(channelInfo, contentModelPluginId))
                    {
                        continue;
                    }
                }

                list.Add(ChannelLoading.GetChannelRowHtml(siteInfo, channelInfo, enabled, eLoadingType, nameValueCollection, request.AdminPermissionsImpl));
            }

            //arraylist.Reverse();

            var builder = new StringBuilder();

            foreach (var html in list)
            {
                builder.Append(html);
            }
            return(builder.ToString());
        }
예제 #16
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (AuthRequest.IsQueryExists("channelId") && (AuthRequest.IsQueryExists("Subtract") || AuthRequest.IsQueryExists("Add")))
            {
                var channelId = AuthRequest.GetQueryInt("channelId");
                if (SiteId != channelId)
                {
                    var isSubtract = AuthRequest.IsQueryExists("Subtract");
                    DataProvider.ChannelDao.UpdateTaxis(SiteId, channelId, isSubtract);

                    AuthRequest.AddSiteLog(SiteId, channelId, 0, "栏目排序" + (isSubtract ? "上升" : "下降"),
                                           $"栏目:{ChannelManager.GetChannelName(SiteId, channelId)}");

                    PageUtils.Redirect(GetRedirectUrl(SiteId, channelId));
                    return;
                }
            }

            if (IsPostBack)
            {
                return;
            }

            ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(SiteInfo, string.Empty, ELoadingType.Channel, null));

            if (AuthRequest.IsQueryExists("CurrentChannelId"))
            {
                _currentChannelId = AuthRequest.GetQueryInt("CurrentChannelId");
                var onLoadScript = ChannelLoading.GetScriptOnLoad(SiteId, _currentChannelId);
                if (!string.IsNullOrEmpty(onLoadScript))
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                }
            }

            LtlButtonsHead.Text = LtlButtonsFoot.Text = GetButtonsHtml();

            var channelIdList = ChannelManager.GetChannelIdList(ChannelManager.GetChannelInfo(SiteId, SiteId), EScopeType.SelfAndChildren, string.Empty, string.Empty, string.Empty);

            RptContents.DataSource     = channelIdList;
            RptContents.ItemDataBound += RptContents_ItemDataBound;
            RptContents.DataBind();
        }
예제 #17
0
파일: NodeTree.cs 프로젝트: wl147/mycms
        protected override void Render(HtmlTextWriter writer)
        {
            var builder = new StringBuilder();

            var body = new RequestBody();

            var publishmentSystemId = int.Parse(Page.Request.QueryString["PublishmentSystemID"]);

            _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
            var scripts = ChannelLoading.GetScript(_publishmentSystemInfo, ELoadingType.ContentTree, null);

            builder.Append(scripts);
            if (Page.Request.QueryString["PublishmentSystemID"] != null)
            {
                try
                {
                    var nodeIdList = DataProvider.NodeDao.GetNodeIdListByParentId(_publishmentSystemInfo.PublishmentSystemId, 0);
                    foreach (var nodeId in nodeIdList)
                    {
                        var nodeInfo = NodeManager.GetNodeInfo(_publishmentSystemInfo.PublishmentSystemId, nodeId);
                        var enabled  = AdminUtility.IsOwningNodeId(body.AdministratorName, nodeInfo.NodeId);
                        //var enabled2 = AdminUtility.IsOwningNodeIdByPublishmentSystem(body.AdministratorName, nodeInfo.NodeId);
                        if (!enabled)
                        {
                            if (!AdminUtility.IsHasChildOwningNodeId(body.AdministratorName, nodeInfo.NodeId))
                            {
                                continue;
                            }
                        }
                        //if (nodeId == 1)
                        //{
                        //    builder.Append(
                        //        @"<a href="" /siteserver/loading.aspx?RedirectType=Loading&amp;RedirectUrl=cms/pageContentMain.aspx?PublishmentSystemID=1""target=""right""onclick=""openFolderByA(this); ""istreelink=""true"" style=""padding-left:20px;font-size:30px;"">ÄÚÈݹÜÀí</a>");
                        //}
                        //else
                        //{
                        builder.Append(ChannelLoading.GetChannelRowHtml(_publishmentSystemInfo, nodeInfo, enabled, ELoadingType.ContentTree, null, body.AdministratorName));
                        //}
                    }
                }
                catch (Exception ex)
                {
                    PageUtils.RedirectToErrorPage(ex.Message);
                }
            }
            writer.Write(builder);
        }
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeID  = (int)e.Item.DataItem;
            var enabled = (IsOwningNodeId(nodeID)) ? true : false;

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeID))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeID);
            var ltlHtml  = e.Item.FindControl("ltlHtml") as Literal;

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.ConfigurationCrossSiteTrans, null, Body.AdministratorName);
        }
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var channelId = (int)e.Item.DataItem;
            var enabled   = IsOwningChannelId(channelId);

            if (!enabled)
            {
                if (!IsHasChildOwningChannelId(channelId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = ChannelManager.GetChannelInfo(SiteId, channelId);
            var ltlHtml  = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(SiteInfo, nodeInfo, enabled, ELoadingType.ConfigurationCrossSiteTrans, null, Body.AdminName);
        }
예제 #20
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("NodeID") && (Body.IsQueryExists("Subtract") || Body.IsQueryExists("Add")))
            {
                var nodeId = Body.GetQueryInt("NodeID");
                if (PublishmentSystemId != nodeId)
                {
                    var isSubtract = Body.IsQueryExists("Subtract");
                    DataProvider.NodeDao.UpdateTaxis(PublishmentSystemId, nodeId, isSubtract);

                    Body.AddSiteLog(PublishmentSystemId, nodeId, 0, "栏目排序" + (isSubtract ? "上升" : "下降"),
                                    $"栏目:{NodeManager.GetNodeName(PublishmentSystemId, nodeId)}");

                    PageUtils.Redirect(GetRedirectUrl(PublishmentSystemId, nodeId));
                    return;
                }
            }

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "栏目管理", string.Empty);

                ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.Channel, null));

                if (Body.IsQueryExists("CurrentNodeID"))
                {
                    _currentNodeId = Body.GetQueryInt("CurrentNodeID");
                    var onLoadScript = ChannelLoading.GetScriptOnLoad(PublishmentSystemId, _currentNodeId);
                    if (!string.IsNullOrEmpty(onLoadScript))
                    {
                        ClientScriptRegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript);
                    }
                }

                ButtonPreLoad();

                BindGrid();
            }
        }
예제 #21
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var channelId = (int)e.Item.DataItem;
            var enabled   = IsOwningChannelId(channelId);

            if (!enabled)
            {
                if (!IsDescendantOwningChannelId(channelId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = ChannelManager.GetChannelInfo(SiteId, channelId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(SiteInfo, nodeInfo, enabled, ELoadingType.Channel, null, AuthRequest.AdminPermissionsImpl);
        }
예제 #22
0
        private void RptCategoryChannel_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeId  = (int)e.Item.DataItem;
            var enabled = IsOwningNodeId(nodeId);

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.GovPublicChannelTree, null, Body.AdministratorName);
        }
예제 #23
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeId  = (int)e.Item.DataItem;
            var enabled = IsOwningNodeId(nodeId);

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeId))
                {
                    e.Item.Visible = false;
                }
            }

            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.TemplateFilePathRule, _additional, Body.AdministratorName);
        }
예제 #24
0
        protected override void Render(HtmlTextWriter writer)
        {
            var builder = new StringBuilder();

            var body = new RequestBody();

            var publishmentSystemId = int.Parse(Page.Request.QueryString["PublishmentSystemID"]);

            _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
            var scripts = ChannelLoading.GetScript(_publishmentSystemInfo, ELoadingType.ContentTree, null);

            builder.Append(scripts);
            if (Page.Request.QueryString["PublishmentSystemID"] != null)
            {
                try
                {
                    var nodeIdList = DataProvider.NodeDao.GetNodeIdListByParentId(_publishmentSystemInfo.PublishmentSystemId, 0);
                    foreach (var nodeId in nodeIdList)
                    {
                        var nodeInfo = NodeManager.GetNodeInfo(_publishmentSystemInfo.PublishmentSystemId, nodeId);
                        var enabled  = AdminUtility.IsOwningNodeId(body.AdministratorName, nodeInfo.NodeId);
                        if (!enabled)
                        {
                            if (!AdminUtility.IsHasChildOwningNodeId(body.AdministratorName, nodeInfo.NodeId))
                            {
                                continue;
                            }
                        }

                        builder.Append(ChannelLoading.GetChannelRowHtml(_publishmentSystemInfo, nodeInfo, enabled, ELoadingType.ContentTree, null, body.AdministratorName));
                    }
                }
                catch (Exception ex)
                {
                    PageUtils.RedirectToErrorPage(ex.Message);
                }
            }
            writer.Write(builder);
        }
        private void RptChannel_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var channelId = (int)e.Item.DataItem;
            var enabled   = IsOwningChannelId(channelId);

            if (!enabled)
            {
                if (!IsDescendantOwningChannelId(channelId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = ChannelManager.GetChannelInfo(_targetSiteId, channelId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            var additional = new NameValueCollection
            {
                ["linkUrl"] = GetRedirectUrl(_targetSiteId, string.Empty)
            };

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(SiteInfo, nodeInfo, enabled, ELoadingType.ChannelClickSelect, additional, AuthRequest.AdminPermissionsImpl);
        }
예제 #26
0
        private void RptChannel_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var nodeId  = (int)e.Item.DataItem;
            var enabled = IsOwningNodeId(nodeId);

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = NodeManager.GetNodeInfo(_targetPublishmentSystemId, nodeId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            var additional = new NameValueCollection
            {
                ["linkUrl"] = GetRedirectUrl(_targetPublishmentSystemId.ToString(), string.Empty)
            };

            ltlHtml.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.ChannelSelect, additional, Body.AdministratorName);
        }
예제 #27
0
        private void RptChannels_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var nodeId  = (int)e.Item.DataItem;
            var enabled = IsOwningNodeId(nodeId);

            if (!enabled)
            {
                if (!IsHasChildOwningNodeId(nodeId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId);

            var element = (NoTagText)e.Item.FindControl("ElHtml");

            element.Text = ChannelLoading.GetChannelRowHtml(PublishmentSystemInfo, nodeInfo, enabled, ELoadingType.SiteAnalysis, _additional, Body.AdministratorName);
        }
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (!IsPostBack)
            {
                if (Body.IsQueryExists("NodeID"))
                {
                    var    nodeId    = TranslateUtils.ToInt(Request.QueryString["NodeID"]);
                    var    nodeNames = NodeManager.GetNodeNameNavigationByGovPublic(PublishmentSystemId, nodeId);
                    string scripts   = $"window.parent.showCategoryChannel('{nodeNames}', '{nodeId}');";
                    PageUtils.CloseModalPageWithoutRefresh(Page, scripts);
                }
                else
                {
                    ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.GovPublicChannelAdd, null));
                    BindGrid();
                }
            }
        }
예제 #29
0
        private void RptChannels_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var channelId = (int)e.Item.DataItem;
            var enabled   = IsOwningChannelId(channelId);

            if (!enabled)
            {
                if (!IsDescendantOwningChannelId(channelId))
                {
                    e.Item.Visible = false;
                }
            }
            var nodeInfo = ChannelManager.GetChannelInfo(SiteId, channelId);

            var ltlRow = (Literal)e.Item.FindControl("ltlRow");

            ltlRow.Text = ChannelLoading.GetChannelRowHtml(SiteInfo, nodeInfo, enabled, ELoadingType.SiteAnalysis, _additional, AuthRequest.AdminPermissions);
        }
예제 #30
0
        public string GetLoadingChannels(int siteId, int parentId, string loadingType, string additional, Request request)
        {
            var list = new List <string>();

            var eLoadingType = ELoadingTypeUtils.GetEnumType(loadingType);

            var channelIdList = DataProvider.ChannelDao.GetIdListByParentId(siteId, parentId);

            var siteInfo = SiteManager.GetSiteInfo(siteId);

            var nameValueCollection = TranslateUtils.ToNameValueCollection(TranslateUtils.DecryptStringBySecretKey(additional));

            foreach (var channelId in channelIdList)
            {
                var enabled = AdminUtility.IsOwningChannelId(request.AdminName, channelId);
                if (!enabled)
                {
                    if (!AdminUtility.IsHasChildOwningChannelId(request.AdminName, channelId))
                    {
                        continue;
                    }
                }
                var nodeInfo = ChannelManager.GetChannelInfo(siteId, channelId);

                list.Add(ChannelLoading.GetChannelRowHtml(siteInfo, nodeInfo, enabled, eLoadingType, nameValueCollection, request.AdminName));
            }

            //arraylist.Reverse();

            var builder = new StringBuilder();

            foreach (var html in list)
            {
                builder.Append(html);
            }
            return(builder.ToString());
        }