示例#1
0
    private void ContentMenuItem_StoreCultureChanged(object sender, CultureEventArgs e)
    {
        Culture culture = DataAccessContext.CultureRepository.GetOne("1");

        Vevo.Domain.Contents.ContentMenuItem contentMenuItem = DataAccessContext.ContentMenuItemRepository.GetOne(
            culture, ContentMenuItemID);

        string newURL = UrlManager.GetContentMenuUrl(ContentMenuItemID, contentMenuItem.UrlName);

        Response.Redirect(newURL);
    }
    private void PopulateControls()
    {
        uxContentMenuNavList.Items.Clear();
        uxContentMenuNavListTop.Items.Clear();
        uxContentMenuNavListTop.MaximumDynamicDisplayLevels = _maxNode;
        uxContentMenuNavList.MaximumDynamicDisplayLevels    = _maxNode;

        IList <ContentMenuItem> list = DataAccessContext.ContentMenuItemRepository.GetByContentMenuID(
            StoreContext.Culture, _rootID, "SortOrder", BoolFilter.ShowTrue);

        if (_rootID == DataAccessContext.Configurations.GetValue("TopContentMenu"))
        {
            uxContentMenuNavList.Visible    = false;
            uxContentMenuNavListTop.Visible = true;

            ContentMenuItem rootItem = DataAccessContext.ContentMenuItemRepository.GetOne(
                StoreContext.Culture, ContentMenuItem.RootMenuItemID);

            MenuItem rootMenu = new MenuItem();
            rootMenu.Text        = ContentMenuItem.RootMenuItemName;
            rootMenu.NavigateUrl = UrlManager.GetContentMenuUrl(rootItem.ContentMenuItemID,
                                                                rootItem.UrlName);

            foreach (ContentMenuItem contentMenuItem in list)
            {
                rootMenu.ChildItems.Add(CreateMenuItemWithChildren(0, contentMenuItem));
            }
            uxContentMenuNavListTop.Items.Add(rootMenu);
            uxContentMenuNavListTop.Orientation = Orientation.Horizontal;

            foreach (MenuItem mi in uxContentMenuNavListTop.Items)
            {
                SetSelectedContentMenuItem(mi, CurrentContentMenuItemID, CurrentContentMenuItemName);
            }
        }
        else
        {
            uxContentMenuNavListTop.Visible = false;
            foreach (ContentMenuItem contentMenuItem in list)
            {
                uxContentMenuNavList.Items.Add(CreateMenuItemWithChildren(0, contentMenuItem));
            }
            uxContentMenuNavList.Orientation = Orientation.Vertical;
            foreach (MenuItem mi in uxContentMenuNavList.Items)
            {
                SetSelectedContentMenuItem(mi, CurrentContentMenuItemID, CurrentContentMenuItemName);
            }
        }
    }
示例#3
0
    private void PopulateControls()
    {
        IList <ContentMenuItem> originalList = DataAccessContext.ContentMenuItemRepository.GetByContentMenuID(
            StoreContext.Culture, RootID, "SortOrder", BoolFilter.ShowTrue);
        IList <ContentMenuItem> list = ListUtilities <ContentMenuItem> .CopyListDeep(originalList);

        foreach (ContentMenuItem item in list)
        {
            if (!item.LinksToContent())
            {
                item.Name = item.Name + "...";
            }
        }

        if (_rootID == DataAccessContext.Configurations.GetValue("TopContentMenu"))
        {
            uxList.Visible = false;
            uxContentMenuListTop.Visible = true;
            uxContentMenuListTop.Items.Clear();

            if (DataAccessContext.Configurations.GetBoolValue("RestrictAccessToShop") && !Page.User.Identity.IsAuthenticated)
            {
                return;
            }

            Culture         culture  = DataAccessContext.CultureRepository.GetOne("1");
            ContentMenuItem rootItem = DataAccessContext.ContentMenuItemRepository.GetOne(
                culture, ContentMenuItem.RootMenuItemID);

            MenuItem rootMenu = new MenuItem();
            rootMenu.Text        = ContentMenuItem.RootMenuItemName;
            rootMenu.NavigateUrl = UrlManager.GetContentMenuUrl(rootItem.ContentMenuItemID,
                                                                rootItem.UrlName);

            foreach (ContentMenuItem contentMenuItem in list)
            {
                rootMenu.ChildItems.Add(CreateMenuItemWithChildren(0, contentMenuItem));
            }
            uxContentMenuListTop.Items.Add(rootMenu);
            uxContentMenuListTop.Orientation = Orientation.Horizontal;
        }
        else
        {
            uxContentMenuListTop.Visible = false;
            uxList.Visible    = true;
            uxList.DataSource = list;
            uxList.DataBind();
        }
    }
示例#4
0
 protected string GetLink(string id)
 {
     Vevo.Domain.Contents.ContentMenuItem item = DataAccessContext.ContentMenuItemRepository.GetOne(
         StoreContext.Culture, id);
     if (item.ReferringMenuID != "0")
     {
         return(UrlManager.GetContentMenuUrl(item.ContentMenuItemID, item.UrlName));
     }
     else
     {
         Vevo.Domain.Contents.Content contentitem = DataAccessContext.ContentRepository.GetOne(
             StoreContext.Culture, item.ContentID);
         return(UrlManager.GetContentUrl(contentitem.ContentID, contentitem.UrlName));
     }
 }
示例#5
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));
        }
    }
示例#6
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);
    }