示例#1
0
    private void PopulateControls()
    {
        if (CurrentID != null && int.Parse(CurrentID) >= 0)
        {
            ContentMenuItem contentMenuItem = DataAccessContext.ContentMenuItemRepository.GetOne(uxLanguageControl.CurrentCulture, CurrentID);

            uxContentMenuItemNameText.Text        = contentMenuItem.Name;
            uxContentMenuItemDescriptionText.Text = contentMenuItem.Description;

            if (!contentMenuItem.LinksToContent())
            {
                uxContentMenuItemTypeDrop.SelectedValue = "0";
                OriginalReferring = "0";
                IList <ContentMenuItem> list = DataAccessContext.ContentMenuItemRepository.GetByContentMenuID(uxLanguageControl.CurrentCulture, contentMenuItem.ReferringMenuID, "", BoolFilter.ShowAll);
                if (list.Count > 0)
                {
                    uxContentMenuItemTypeDrop.Enabled = false;
                }
                uxContentListPanel.Visible = false;
            }
            else
            {
                uxContentMenuItemTypeDrop.SelectedValue = "1";
                OriginalReferring = "1";
                PopulateContentList();
                uxContentListDrop.SelectedValue = contentMenuItem.ContentID.ToString();
            }
            uxParentDrop.SelectedValueItem        = contentMenuItem.ContentMenuID;
            ParentContentMenuItemID               = contentMenuItem.ContentMenuID;
            uxContentMenuItemEnabledCheck.Checked = contentMenuItem.IsEnabled;
            uxOther1Text.Text = contentMenuItem.Other1;
            uxOther2Text.Text = contentMenuItem.Other2;
            uxOther3Text.Text = contentMenuItem.Other3;
        }
    }
示例#2
0
    protected string GetNavUrl(object item)
    {
        ContentMenuItem currentItem = DataAccessContext.ContentMenuItemRepository.GetOne(
            StoreContext.Culture, ((ContentMenuItem)item).ContentMenuItemID);

        if (!currentItem.LinksToContent())
        {
            return(UrlManager.GetContentMenuUrl(currentItem.ContentMenuItemID, currentItem.UrlName));
        }
        else
        {
            Vevo.Domain.Contents.Content content = DataAccessContext.ContentRepository.GetOne(
                StoreContext.Culture, ((ContentMenuItem)item).ContentID.ToString());
            return(UrlManager.GetContentUrl(content.ContentID, content.UrlName));
        }
    }
示例#3
0
    private void GenerateBreadcrumb(DataListItem item)
    {
        Panel  panel               = (Panel)item.FindControl("uxBreadcrumbPanel");
        string name                = DataBinder.Eval(item.DataItem, "Name").ToString();
        string contentMenuItemID   = DataBinder.Eval(item.DataItem, "ContentMenuItemID").ToString();
        string urlName             = DataBinder.Eval(item.DataItem, "UrlName").ToString();
        string parentContentMenuID = DataBinder.Eval(item.DataItem, "ContentMenuID").ToString();

        HyperLink link = new HyperLink();

        if (contentMenuItemID != "0")
        {
            ContentMenuItem currntItem = DataAccessContext.ContentMenuItemRepository.GetOne(
                StoreContext.Culture, contentMenuItemID);
            IList <ContentMenuItem> parentList = new List <ContentMenuItem>();

            if (currntItem.MenuPosition == ContentMenuItem.MenuPositionType.Root)
            {
                parentList.Add(currntItem);
                link      = new HyperLink();
                link.Text = parentList[0].Name;
                //link.Text = "Information";
                link.CssClass = "SiteMapParent";
                panel.Controls.Add(link);

                if (!currntItem.LinksToContent())
                {
                    link.NavigateUrl = UrlManager.GetContentMenuUrl(contentMenuItemID, urlName);
                }
                else
                {
                    Vevo.Domain.Contents.Content content = DataAccessContext.ContentRepository.GetOne(
                        StoreContext.Culture, currntItem.ContentID.ToString());
                    link.NavigateUrl = UrlManager.GetContentUrl(content.ContentID, content.UrlName);
                }
            }
            else
            {
                parentList    = currntItem.GetParentMenuItemList(StoreContext.Culture);
                link          = new HyperLink();
                link.Text     = parentList[0].Name;
                link.CssClass = "SiteMapParent";


                if (!currntItem.LinksToContent())
                {
                    link.NavigateUrl = UrlManager.GetContentMenuUrl(contentMenuItemID, urlName);
                }
                else
                {
                    Vevo.Domain.Contents.Content content = DataAccessContext.ContentRepository.GetOne(
                        StoreContext.Culture, currntItem.ContentID.ToString());
                    link.NavigateUrl = UrlManager.GetContentUrl(content.ContentID, content.UrlName);
                }

                panel.Controls.Add(link);

                for (int i = 1; i < parentList.Count; i++)
                {
                    Label label = new Label();
                    label.Text     = " >> ";
                    label.CssClass = "SiteMapSeparate";
                    panel.Controls.Add(label);

                    link             = new HyperLink();
                    link.Text        = parentList[i].Name;
                    link.CssClass    = "SiteMapParent";
                    link.NavigateUrl = UrlManager.GetContentMenuUrl(
                        parentList[i].ContentMenuItemID, parentList[i].UrlName);

                    panel.Controls.Add(link);
                }
            }
        }
        else
        {
            link          = new HyperLink();
            link.Text     = name;
            link.CssClass = "SiteMapParent";
            panel.Controls.Add(link);
        }
        GenerateContent(item, contentMenuItemID);
    }