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

            var channelId = (int)e.Item.DataItem;
            var nodeInfo  = ChannelManager.GetChannelInfo(SiteId, channelId);

            if (nodeInfo == null)
            {
                e.Item.Visible = false;
                return;
            }

            var ltlItemChannelName  = (Literal)e.Item.FindControl("ltlItemChannelName");
            var ltlItemChannelIndex = (Literal)e.Item.FindControl("ltlItemChannelIndex");
            var ltlItemAddDate      = (Literal)e.Item.FindControl("ltlItemAddDate");

            ltlItemChannelName.Text  = ChannelManager.GetChannelNameNavigation(SiteId, channelId);
            ltlItemChannelIndex.Text = nodeInfo.IndexName;
            ltlItemAddDate.Text      = DateUtils.GetDateString(nodeInfo.AddDate);

            if (IsOwningChannelId(channelId))
            {
                if (HasChannelPermissions(nodeInfo.Id, ConfigManager.ChannelPermissions.ChannelEdit))
                {
                    ltlItemChannelName.Text = $@"<a href=""javascript:;"" onclick=""{ModalChannelEdit.GetOpenWindowString(nodeInfo.SiteId, nodeInfo.Id, GetRedirectUrl(nodeInfo.SiteId, _nodeGroupName))}"">{ltlItemChannelName.Text}</a>";
                }
            }
        }
        private string GetTitle(NodeInfo nodeInfo, bool enabled)
        {
            var showPopWinString = ModalChannelEdit.GetOpenWindowString(PublishmentSystemId, nodeInfo.NodeId, GetRedirectUrl(PublishmentSystemId));

            var hasChildren = nodeInfo.ChildrenCount > 0;

            var nodeTreeItem = NodeNaviTreeItem.CreateNodeTreeItem(true, true, nodeInfo.ParentsCount, hasChildren, nodeInfo.NodeName, string.Empty, showPopWinString, string.Empty, enabled, false, PublishmentSystemId, nodeInfo.NodeId, nodeInfo.ContentNum);

            return(nodeTreeItem.GetItemHtml());
        }