Exemplo n.º 1
0
        public void InitView()
        {
            MenuBarType view = View.PreloadView;

            if (view == MenuBarType.None)
            {
                view = MenuBarType.GenericCommunity;
            }

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.MenuBarList(view));
            }
            else
            {
                Boolean            allowManage = false;
                ModuleMenu         module      = ModuleMenu.CreatePortalmodule(UserContext.UserTypeID);
                List <MenuBarType> views       = GetAvailableViews(module);
                if (views.Count == 0)
                {
                    View.NoPermission();
                }
                else
                {
                    if (!views.Contains(view))
                    {
                        view = views[0];
                    }
                    View.LoadAvailableViews(views);
                    View.CurrentView = view;

                    switch (view)
                    {
                    case MenuBarType.Portal:
                        allowManage = module.ManagePortalMenubar;
                        break;

                    case MenuBarType.GenericCommunity:
                        allowManage = module.ManageCommunitiesMenubar;
                        break;

                    case MenuBarType.PortalAdministration:
                        allowManage = module.ManageAdministrationMenubar;
                        break;
                    }
                    View.AllowCreate = allowManage;
                    LoadMenubarItems(module, view, 0, View.CurrentPageSize);
                }
            }
        }
Exemplo n.º 2
0
        public void InitView(Int32 idCommunity, MenuBarType menubarType, String baseUrl, String defaultModuleToolTip, String defaultModuleUrl, String defaultModuleText)
        {
            if (idCommunity == -1)
            {
                idCommunity = UserContext.CurrentCommunityID;
            }

            Int32 idOrganization = 0;

            if (idCommunity > 0)
            {
                liteCommunity community = CurrentManager.Get <liteCommunity>(idCommunity);
                if (community == null)
                {
                    idCommunity = 0;
                }
                else
                {
                    idOrganization = community.IdOrganization;
                }
            }
            if (idOrganization == 0)
            {
                idOrganization = CurrentManager.GetUserDefaultIdOrganization(UserContext.CurrentUserID);
            }

            if (idCommunity == 0 && (menubarType != MenuBarType.Portal && menubarType != MenuBarType.PortalAdministration))
            {
                menubarType = MenuBarType.Portal;
                idCommunity = 0;
            }
            else if (idCommunity > 0 && menubarType == MenuBarType.None)
            {
                menubarType = MenuBarType.GenericCommunity;
            }
            if (idCommunity == 0)
            {
                View.DisplayName((menubarType == MenuBarType.Portal) ? View.GetPortalName : View.GetAdministrationName);
            }
            else
            {
                View.DisplayName(CurrentManager.GetCommunityName(idCommunity));
            }

            //Language language = CurrentManager.GetLanguageByIdOrDefault(UserContext.cu)
            View.BindLogo(idCommunity, idOrganization, UserContext.Language.Code);
            View.LoadMenuBar(Service.RenderCachedMenubar(idCommunity, menubarType, baseUrl, defaultModuleToolTip, defaultModuleUrl, defaultModuleText));
            View.MenubarType = menubarType;
        }
Exemplo n.º 3
0
        /// <summary>
        /// A method to extract the appropriate localized string
        /// representing the header name of this menu type
        /// i.e. file -> "_File"
        /// </summary>
        /// <param name="type"></param>
        /// <returns>A localized string used as the menu header</returns>
        internal static string ToDisplayString(this MenuBarType type)
        {
            switch (type)
            {
            case MenuBarType.File: return(Properties.Resources.DynamoViewFileMenu);

            case MenuBarType.Edit: return(Properties.Resources.DynamoViewEditMenu);

            case MenuBarType.View: return(Properties.Resources.DynamoViewViewMenu);

            case MenuBarType.Help: return(Properties.Resources.DynamoViewHelpMenu);

            default: throw new ArgumentOutOfRangeException("type");
            }
        }
Exemplo n.º 4
0
        public void InitView()
        {
            MenuBarType view = View.PreloadType;

            if (view == MenuBarType.None)
            {
                view = MenuBarType.GenericCommunity;
            }

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.CreateMenuBar(view));
            }
            else
            {
                Boolean            allowManage = false;
                ModuleMenu         module      = ModuleMenu.CreatePortalmodule(UserContext.UserTypeID);
                List <MenuBarType> views       = GetAvailableViews(module);
                if (views.Count == 0)
                {
                    View.NoPermission();
                }
                else
                {
                    if (!views.Contains(view))
                    {
                        view = views[0];
                    }
                    View.LoadAvailableTypes(views);

                    allowManage      = module.ManagePortalMenubar || module.ManageAdministrationMenubar || module.ManageCommunitiesMenubar;
                    View.AllowCreate = allowManage;
                    if (allowManage)
                    {
                        View.TopItemsnumber = 5;
                        View.SubItemsnumber = 5;
                        dtoMenubar dto = new dtoMenubar();
                        dto.MenuBarType = view;
                        dto.Name        = View.DefaultMenuName;
                        View.MenuBar    = dto;
                    }
                    else
                    {
                        View.NoPermission();
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void AddItemToMenu(MenuBarType type, Control itemToAdd, int index)
        {
            if (dynamoMenu == null) return;

            var dynamoItem = SearchForMenuItem(type);
            if (dynamoItem == null) return;

            if (index >= 0 && index < dynamoItem.Items.Count)
            {
                dynamoItem.Items.Insert(index, itemToAdd);
            }
            else
            {
                dynamoItem.Items.Add(itemToAdd);
            }
        }
Exemplo n.º 6
0
        private void AddItemToMenu(MenuBarType type, Control itemToAdd, int index)
        {
            if (dynamoMenu == null) return;

            var dynamoItem = SearchForMenuItem(type);
            if (dynamoItem == null) return;

            if (index >= 0 && index < dynamoItem.Items.Count)
            {
                dynamoItem.Items.Insert(index, itemToAdd);
            }
            else
            {
                dynamoItem.Items.Add(itemToAdd);
            }
        }
Exemplo n.º 7
0
        private void LoadMenubarItems(ModuleMenu module, MenuBarType view, int currentPageIndex, int currentPageSize)
        {
            int       itemsCount = (int)Service.GetMenubarListCount(view);
            PagerBase pager      = new PagerBase();

            pager.PageSize  = currentPageSize;  //Me.View.CurrentPageSize
            pager.Count     = itemsCount - 1;
            pager.PageIndex = currentPageIndex; // Me.View.CurrentPageIndex
            View.Pager      = pager;

            if (itemsCount == 0)
            {
                View.LoadItems(new List <dtoMenubarItemPermission>());
            }
            else
            {
                List <dtoMenubar> items = Service.GetMenubarList(view, pager.PageIndex, currentPageSize);
                View.LoadItems(items.Select(m => new dtoMenubarItemPermission(m, module)).ToList());
            }
        }
Exemplo n.º 8
0
 public void SetActiveMenubar(long idMenubar)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout(rootObject.MenuBarList(View.CurrentView));
     }
     else
     {
         ModuleMenu  module      = ModuleMenu.CreatePortalmodule(UserContext.UserTypeID);
         MenuBarType view        = View.CurrentView;
         Boolean     allowManage = (view == MenuBarType.PortalAdministration) ? module.ManagePortalMenubar : (view == MenuBarType.GenericCommunity) ? module.ManageCommunitiesMenubar : (view == MenuBarType.Portal) ? module.ManageAdministrationMenubar : false;
         if (allowManage && Service.SetActiveMenubar(idMenubar))
         {
             View.ReloadPage(idMenubar, view, View.Pager.PageIndex, View.CurrentPageSize);
         }
         else
         {
             LoadMenubarItems(View.Pager.PageIndex, View.CurrentPageSize);
         }
     }
 }
Exemplo n.º 9
0
        public void InitView()
        {
            MenuBarType view = View.PreviousView;

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.EditMenuBar(View.PreloadIdMenubar, view));
            }
            else
            {
                ModuleMenu module      = ModuleMenu.CreatePortalmodule(UserContext.UserTypeID);
                Boolean    allowManage = module.ManagePortalMenubar || module.ManageAdministrationMenubar || module.ManageCommunitiesMenubar;
                View.AllowManage = allowManage;
                if (!allowManage)
                {
                    View.NoPermission();
                }
                else
                {
                    long IdMenubar = View.PreloadIdMenubar;
                    if (!Service.MenubarExist(IdMenubar))
                    {
                        View.MenubarUnknown();
                    }
                    else
                    {
                        View.IdMenubar = IdMenubar;
                        View.AllowEdit = !Service.IsActiveMenubar(IdMenubar);
                        dtoTree tree = Service.MenubarToTree(IdMenubar);
                        View.LoadMenubar(tree, new dtoItem()
                        {
                            Id = tree.Id, Type = MenuItemType.Menubar
                        });
                        View.LoadMenuBarInfo(Service.GetDtoMenubar(tree.Id));
                    }
                }
            }
        }
Exemplo n.º 10
0
 public static String RenderPortal(MenuBarType type, int IdProfileType, int idLanguage)
 {
     return(RenderPortal(type, IdProfileType) + "_" + idLanguage.ToString());
 }
Exemplo n.º 11
0
 public static String RenderPortal(MenuBarType type)
 {
     return("MenuPortal_" + type.ToString());
 }
Exemplo n.º 12
0
 public static String MenuBar(MenuBarType type)
 {
     return("Menubar_" + type.ToString());
 }
Exemplo n.º 13
0
 public void AddSeparator(MenuBarType type, Separator separatorObj, int index = -1)
 {
     AddItemToMenu(type, separatorObj, index);
 }
Exemplo n.º 14
0
 public void AddMenuItem(MenuBarType type, MenuItem menuItem, int index = -1)
 {
     AddItemToMenu(type, menuItem, index);
 }
Exemplo n.º 15
0
        public void SelectItem(dtoItem item)
        {
            MenuBarType menubarType = (item.Type == MenuItemType.Menubar) ? Service.GetMenubarType(item.Id) : Service.GetItemMenubarType(item.Id);

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, menubarType));
            }
            else
            {
                Boolean loadProfileTypes = (menubarType == MenuBarType.Portal || menubarType == MenuBarType.PortalAdministration);
                switch (item.Type)
                {
                case MenuItemType.Menubar:
                    View.LoadMenuBarInfo(Service.GetDtoMenubar(item.Id));
                    break;

                case MenuItemType.ItemColumn:
                    View.LoadColumnItem(Service.GetDtoColumn(item.Id));
                    break;

                case MenuItemType.TopItemMenu:
                    dtoTopMenuItem topItem = Service.GetDtoTopMenuItem(item.Id);
                    if (topItem == null)
                    {
                        View.ItemUnknown();
                    }
                    else if (loadProfileTypes)
                    {
                        View.LoadTopMenuItem(topItem, Service.GetDtoTranslations(item.Id), Service.GetItemProfilesAssignments(item.Id));
                    }
                    else
                    {
                        View.LoadTopMenuItem(topItem, Service.GetDtoTranslations(item.Id));
                    }
                    break;

                case MenuItemType.Separator:
                    dtoMenuItem separator = Service.GetDtoMenuItem(item.Id);
                    if (item == null)
                    {
                        View.ItemUnknown();
                    }
                    else
                    {
                        View.LoadSeparatorItem(separator);
                    }
                    break;

                case MenuItemType.None:
                    View.ItemUnknown();
                    break;

                default:
                    dtoMenuItem menuItem = Service.GetDtoMenuItem(item.Id);
                    if (menuItem == null)
                    {
                        View.ItemUnknown();
                    }
                    else if (loadProfileTypes)
                    {
                        View.LoadMenuItem(menuItem, Service.GetDtoTranslations(menuItem.Id), Service.GetItemProfilesAssignments(menuItem.Id), Service.GetItemAvailableProfileTypes((menuItem)), Service.GetMenuItemAvailableTypes(menuItem), Service.GetAvailableSubTypes(menuItem));
                    }
                    else
                    {
                        View.LoadMenuItem(menuItem, Service.GetDtoTranslations(menuItem.Id), Service.GetMenuItemAvailableTypes(menuItem), Service.GetAvailableSubTypes(menuItem));
                    }
                    break;
                }
            }
        }
Exemplo n.º 16
0
 public void AddSeparator(MenuBarType type, Separator separatorObj, int index = -1)
 {
     AddItemToMenu(type, separatorObj, index);
 }
Exemplo n.º 17
0
 public static String MenuBarList(MenuBarType type)
 {
     return("Modules/Menu/List.aspx?View=" + type.ToString());
 }
Exemplo n.º 18
0
        public IHtmlString MenuBar(string name, string onClickFunction, ItemMenuBar[] items, object attributes, MenuBarType type)
        {
            TagBuilder tb;
            if (type == MenuBarType.Custom)
            {
                tb = new TagBuilder("nav");
                tb.AddCssClass("btn-toolbar text-center well");
            }
            else
            {
                tb = new TagBuilder("div");
                tb.AddCssClass("smallMenuBar row-fluid");
            }

            tb.Attributes.Add("id", name);

            string itemsHtml = string.Empty;
            foreach (ItemMenuBar item in items)
            {
                if (item.MenuBarButtonType != MenuBarButtonType.Custom)
                {
                    switch (item.MenuBarButtonType)
                    {
                        case MenuBarButtonType.New:
                            item.ImgPath = ButtonMenuBarFontConstant.NEW;
                            item.Argument = ButtonMenuBarActionConstant.NEW;
                            item.Value = ButtonMenuBarValueConstant.NEW;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.NEW;
                            break;

                        case MenuBarButtonType.Edit:
                            item.ImgPath = ButtonMenuBarFontConstant.EDIT;
                            item.Argument = ButtonMenuBarActionConstant.EDIT;
                            item.Value = ButtonMenuBarValueConstant.EDIT;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.EDIT;
                            break;

                        case MenuBarButtonType.Copy:
                            item.ImgPath = type == MenuBarType.Custom ? (AppConstante.ENABLED_TBR_IMAGES_PATH + "/copy.png") : ButtonMenuBarFontConstant.COPY;
                            item.Argument = ButtonMenuBarActionConstant.COPY;
                            item.Value = ButtonMenuBarValueConstant.COPY;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.COPY;
                            break;

                        case MenuBarButtonType.Delete:
                            item.ImgPath = ButtonMenuBarFontConstant.DELETE;
                            item.Argument = ButtonMenuBarActionConstant.DELETE;
                            item.Value = ButtonMenuBarValueConstant.DELETE;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.DELETE;
                            break;

                        case MenuBarButtonType.Save:
                            item.ImgPath = ButtonMenuBarFontConstant.SAVE;
                            item.Argument = ButtonMenuBarActionConstant.SAVE;
                            item.Value = ButtonMenuBarValueConstant.SAVE;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.SAVE;
                            break;
                        case MenuBarButtonType.SaveExit:
                            item.ImgPath = type == MenuBarType.Custom ? (AppConstante.ENABLED_TBR_IMAGES_PATH + "/SaveExit.png") : ButtonMenuBarFontConstant.SAVE;
                            item.Argument = ButtonMenuBarActionConstant.SAVEEXIT;
                            item.Value = ButtonMenuBarValueConstant.SAVEEXIT;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.SAVEEXIT;
                            break;

                        case MenuBarButtonType.Exit:
                            item.ImgPath = ButtonMenuBarFontConstant.EXIT;
                            item.Argument = ButtonMenuBarActionConstant.EXIT;
                            item.Value = ButtonMenuBarValueConstant.EXIT;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.EXIT;
                            break;

                        case MenuBarButtonType.Cancel:
                            item.ImgPath = ButtonMenuBarFontConstant.CANCEL;
                            item.Argument = ButtonMenuBarActionConstant.CANCEL;
                            item.Value = ButtonMenuBarValueConstant.CANCEL;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.CANCEL;
                            break;
                        case MenuBarButtonType.Print:
                            item.ImgPath = ButtonMenuBarFontConstant.PRINT;
                            item.Argument = ButtonMenuBarActionConstant.PRINT;
                            item.Value = ButtonMenuBarValueConstant.PRINT;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.PRINT;
                            break;
                        case MenuBarButtonType.ExportXls:
                            item.ImgPath = ButtonMenuBarFontConstant.IMPORT;
                            item.Argument = ButtonMenuBarActionConstant.IMPORT_XLS;
                            item.Value = ButtonMenuBarValueConstant.IMPORTAR_XLS;
                            if (String.IsNullOrEmpty(item.Name))
                                item.Name = ButtonMenuBarNameConstant.IMPORTAR_XLS;
                            break;

                    }
                }

                if (type == MenuBarType.Custom)
                {
                    itemsHtml += string.Concat("<button class='btn btn-primary btn-color btn-bg-color btn-sm' id='", name + "_" + item.Name, "' ", (item.Disabled ? "disabled='disabled'" : ""), " onclick=\"", onClickFunction, "('", item.Argument, "');\">");

                    if (item.ImgPath.Contains("."))
                        itemsHtml += item.ImgPath != "" ? "<img src=\"" +
                           (item.Disabled ? VirtualPathUtility.ToAbsolute(item.ImgPath.Replace(AppConstante.ENABLED_PATH + "/", AppConstante.DISABLED_PATH + "/")) :
                           VirtualPathUtility.ToAbsolute(item.ImgPath.Replace(AppConstante.DISABLED_PATH + "/", AppConstante.ENABLED_PATH + "/"))) +
                           "\" alt=\"" + item.Value + "\" title=\"" + item.Value + "\" />" : "";
                    else
                        itemsHtml += "<span class=\"" + item.ImgPath + "\"></span>";
                    itemsHtml += " " + item.Value + "</button>";
                }
                else
                {
                    itemsHtml += string.Concat("<button id='", name, "_", item.Name, "' type=\"button\" class=\"btn btn-sm\" ", (item.Disabled ? "disabled='disabled'" : ""), " onclick=\"", onClickFunction, "('", item.Argument, "');\">");

                    if (item.ImgPath.Contains("."))
                        itemsHtml += "<img src=\"" + VirtualPathUtility.ToAbsolute(item.ImgPath) +
                           (item.Disabled ? VirtualPathUtility.ToAbsolute(item.ImgPath.Replace(AppConstante.ENABLED_PATH + "/", AppConstante.DISABLED_PATH + "/")) :
                           VirtualPathUtility.ToAbsolute(item.ImgPath.Replace(AppConstante.DISABLED_PATH + "/", AppConstante.ENABLED_PATH + "/"))) +
                           "\" alt=\"" + item.Value + "\" title=\"" + item.Value + "\" />";
                    else
                        itemsHtml += "<span style=\"float:left;padding: 0px 4px 0px 0px;\" class=\"" + item.ImgPath + "\"></span>";
                    itemsHtml += "&nbsp;" + item.Value;
                    itemsHtml += "</button>";
                }
            }
            tb.InnerHtml = itemsHtml;
            return new MvcHtmlString(tb.ToString());
        }
Exemplo n.º 19
0
 public IHtmlString MenuBar(string name, string onClickFunction, ItemMenuBar[] items, MenuBarType type)
 {
     return MenuBar(name, onClickFunction, items, null, type);
 }
Exemplo n.º 20
0
 public static String CreateMenuBar(MenuBarType type)
 {
     return("Modules/Menu/Add.aspx?type=" + type.ToString());
 }
Exemplo n.º 21
0
        public void AddItem(long idOwner, MenuItemType itemOwner, MenuItemType itemToCreate)
        {
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, Service.GetMenubarType(View.IdMenubar)));
            }
            else
            {
                MenuBarType menubarType      = Service.GetMenubarType(View.IdMenubar);
                Boolean     loadProfileTypes = (menubarType == MenuBarType.Portal || menubarType == MenuBarType.PortalAdministration);
                switch (itemOwner)
                {
                case MenuItemType.Menubar:
                    TopMenuItem item = Service.AddItemToMenubar(idOwner);
                    if (item != null)
                    {
                        View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        View.LoadMenuBarInfo(Service.GetDtoMenubar(View.IdMenubar));
                        //if (loadProfileTypes)
                        //    View.LoadTopMenuItem(Service.GetDtoTopMenuItem(item.Id) , Service.GetDtoTranslations(item.Id), Service.GetItemProfilesAssignments(item.Id));
                        //else
                        //    View.LoadTopMenuItem(Service.GetDtoTopMenuItem(item.Id), Service.GetDtoTranslations(item.Id));
                    }
                    break;

                case MenuItemType.TopItemMenu:
                    ItemColumn column = Service.AddItemToTopItem(idOwner);
                    if (column != null)
                    {
                        View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        SelectItem(new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        //View.LoadColumnItem(Service.GetDtoColumn(column.Id));
                    }
                    break;

                case MenuItemType.ItemColumn:
                    MenuItem subColumnItem = Service.AddToColumn(idOwner, itemToCreate);
                    if (subColumnItem != null)
                    {
                        //dtoMenuItem dto = Service.GetDtoMenuItem(subColumnItem.Id);
                        View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        //if (itemToCreate == MenuItemType.Separator)
                        //    View.LoadSeparatorItem(dto);
                        //else if (loadProfileTypes)
                        //    View.LoadMenuItem(dto, Service.GetDtoTranslations(subColumnItem.Id), Service.GetItemProfilesAssignments(subColumnItem.Id), Service.GetItemAvailableProfileTypes(subColumnItem), Service.GetMenuItemAvailableTypes(subColumnItem));
                        //else
                        //    View.LoadMenuItem(dto, Service.GetDtoTranslations(subColumnItem.Id), Service.GetMenuItemAvailableTypes(subColumnItem));
                        SelectItem(new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                    }
                    break;

                case MenuItemType.Link:
                case MenuItemType.Text:
                    if (!(itemToCreate == MenuItemType.IconManage || itemToCreate == MenuItemType.IconNewItem || itemToCreate == MenuItemType.IconStatistic))
                    {
                        View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        break;
                    }
                    goto case MenuItemType.TextContainer;

                case MenuItemType.TextContainer:
                case MenuItemType.LinkContainer:
                    MenuItem subItem = Service.AddToItem(idOwner, itemToCreate);
                    if (subItem != null)
                    {
                        View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        SelectItem(new dtoItem()
                        {
                            Id = idOwner, Type = itemOwner
                        });
                        //if (itemToCreate == MenuItemType.Separator)
                        //    View.LoadSeparatorItem(Service.GetDtoMenuItem(subItem.Id));
                        //else if (loadProfileTypes)
                        //    View.LoadMenuItem(Service.GetDtoMenuItem(subItem.Id), Service.GetDtoTranslations(subItem.Id), Service.GetItemProfilesAssignments(subItem.Id), Service.GetItemAvailableProfileTypes(subItem), Service.GetMenuItemAvailableTypes(subItem));
                        //else
                        //    View.LoadMenuItem(Service.GetDtoMenuItem(subItem.Id), Service.GetDtoTranslations(subItem.Id), Service.GetMenuItemAvailableTypes(subItem));
                    }

                    break;

                default:
                    View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem()
                    {
                        Id = idOwner, Type = itemOwner
                    });
                    break;
                }
            }
        }
Exemplo n.º 22
0
 public static String RenderMenu(MenuBarType type)
 {
     return((type == MenuBarType.Portal || type == MenuBarType.PortalAdministration) ? RenderPortal(type) : RenderAllCommunity);
 }
Exemplo n.º 23
0
 public void AddMenuItem(MenuBarType type, MenuItem menuItem, int index = -1)
 {
     AddItemToMenu(type, menuItem, index);
 }
Exemplo n.º 24
0
 public static String ViewMenuBar(long IdMenubar, MenuBarType type)
 {
     return("Modules/Menu/View.aspx?Id=" + IdMenubar.ToString() + "&View=" + type.ToString());
 }
Exemplo n.º 25
0
 /// <summary>
 /// Searchs for dynamo parent menu item. Parent item can be:
 /// file menu, edit menu, view menu and help mebu bars.
 /// </summary>
 /// <param name="menuBarType">File, Edit, View or Help.</param>
 private MenuItem SearchForMenuItem(MenuBarType type)
 {
     var dynamoMenuItems = dynamoMenu.Items.OfType<MenuItem>();
     return dynamoMenuItems.First(item => item.Header.ToString() == "_" + type);
 }
Exemplo n.º 26
0
        /// <summary>
        /// Searchs for dynamo parent menu item. Parent item can be:
        /// file menu, edit menu, view menu and help mebu bars.
        /// </summary>
        /// <param name="menuBarType">File, Edit, View or Help.</param>
        private MenuItem SearchForMenuItem(MenuBarType type)
        {
            var dynamoMenuItems = dynamoMenu.Items.OfType <MenuItem>();

            return(dynamoMenuItems.First(item => item.Header.ToString() == type.ToDisplayString()));
        }