Example #1
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var groupInfo = (ChannelGroupInfo)e.Item.DataItem;

            var ltlNodeGroupName = (Literal)e.Item.FindControl("ltlNodeGroupName");
            var ltlDescription   = (Literal)e.Item.FindControl("ltlDescription");
            var hlUp             = (HyperLink)e.Item.FindControl("hlUp");
            var hlDown           = (HyperLink)e.Item.FindControl("hlDown");
            var ltlChannels      = (Literal)e.Item.FindControl("ltlChannels");
            var ltlEdit          = (Literal)e.Item.FindControl("ltlEdit");
            var ltlDelete        = (Literal)e.Item.FindControl("ltlDelete");

            ltlNodeGroupName.Text = groupInfo.GroupName;
            ltlDescription.Text   = groupInfo.Description;

            hlUp.NavigateUrl = PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                { "GroupName", groupInfo.GroupName },
                { "SetTaxis", true.ToString() },
                { "Direction", "UP" }
            });
            hlDown.NavigateUrl = PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                { "GroupName", groupInfo.GroupName },
                { "SetTaxis", true.ToString() },
                { "Direction", "DOWN" }
            });

            ltlChannels.Text =
                $@"<a href=""{PageChannelsGroup.GetRedirectUrl(SiteId, groupInfo.GroupName)}"">查看栏目</a>";

            ltlEdit.Text =
                $@"<a href=""javascript:;"" onClick=""{ModalNodeGroupAdd.GetOpenWindowString(SiteId,
                    groupInfo.GroupName)}"">修改</a>";

            ltlDelete.Text = $@"<a href=""{PageUtils.GetCmsUrl(SiteId, nameof(PageNodeGroup), new NameValueCollection
            {
                {"GroupName", groupInfo.GroupName},
                {"Delete", true.ToString()}
            })}"" onClick=""javascript:return confirm('此操作将删除栏目组“{groupInfo.GroupName}”,确认吗?');"">删除</a>";
        }
Example #2
0
        public string GetChannelHtml(string groupName)
        {
            var publishmentSystemId = PublishmentSystemId;

            return($"<a href=\"{PageChannelsGroup.GetRedirectUrl(publishmentSystemId, groupName)}\">查看栏目</a>");
        }