protected override MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            if (id == Constants.System.Root.ToInvariantString())
            {
                // root && grant actions
                menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
                return menu;
            }
            else if (id.StartsWith(GrantPrefix))
            {
                //menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias)).AdditionalData.Add("actionView", "/");
                //var i = menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias) );
                //menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias), "id", id);
                //menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                //menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));

                //menu.DefaultMenuAlias = "createGrantDef";
                menu.Items.Add(new MenuItem("createGrantDef", ui.Text("actions", ActionNew.Instance.Alias)) { Icon = "add" });

                menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            }
            else if (id.StartsWith(GrantDefinitionPrefix))
            {
                menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            }
            return menu;
        }
Exemplo n.º 2
0
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            menu.DefaultMenuAlias = ActionNull.Instance.Alias;

            return menu;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Returns context menu for each tree node
 /// </summary>
 /// <param name="id">Node's id.</param>
 /// <param name="queryStrings">Query strings</param>
 /// <returns>Collection of menu items</returns>
 protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     if (id == Constants.System.Root.ToInvariantString())
     {
         // WebPack node actions:       
         menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
         return menu;
     }
     else if(id == "0")
     {
         // Websites node actions:
         MenuItem createItem = new MenuItem("Create", ActionNew.Instance.Alias);
         createItem.Name = "Create";
         createItem.Icon = "add";
         menu.Items.Add(createItem);
         //menu.Items.Add<CreateChildEntity, ActionNew>(ActionNew.Instance.Alias);
         menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
         return menu;
     }
     else
     {
         // Website node actions:
         menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));                
     }
     return menu;
 }
Exemplo n.º 4
0
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
        {
            var menu = new Umbraco.Web.Models.Trees.MenuItemCollection();

            menu.Items.Clear();
            return(menu);
        }
 protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     menu.DefaultMenuAlias = ActionNew.Instance.Alias;
     menu.Items.Add<ActionNew>("Create");
     return menu;
 }
Exemplo n.º 6
0
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == "-1")
            {
                // root actions

                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
                return menu;
            }
            else
            {
                var idInt = 0;
                if (int.TryParse(id.Split('?')[0], out idInt))
                    menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
                else
                {
                    menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                    menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias),true);
                }

            }
            return menu;
        }
        // TODO : Umbraco Refactored the TreeNodeController and it's underlying collections.  This
        // TODO : broke with the introduction of the Umbraco Nightly Build 111
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == "settings")
            {
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            }

            //if (id == Constants.System.Root.ToInvariantString())
            //{
            //    // root actions
            //    menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            //    return menu;
            //}
            //else if (id == "catalog")
            //{
            //    //create product
            //    menu.Items.Add<MerchelloActionNewProduct>(ui.Text("actions", MerchelloActionNewProduct.Instance.Alias));
            //}
            //else
            //{
                //only have refres for each node
             //menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            //}

            return menu;
        }
Exemplo n.º 8
0
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new Umbraco.Web.Models.Trees.MenuItemCollection();

            menu.DefaultMenuAlias = ActionNew.Instance.Alias;
            menu.Items.Add <ActionNew>("");
            return(menu);
        }
Exemplo n.º 9
0
 protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
 {
     MenuItemCollection menus = new MenuItemCollection();
     menus.Items.Add<ActionDelete>("Delete");
     menus.Items.Add(new MenuItem("Approved", "审核提现"));
     menus.Items.Add<RefreshNode, ActionRefresh>("Refresh Nodes");
     return menus;
 }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            menu.Items.Add(new MenuItem("create", "Create"));

            return menu;
        }
 protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     if (id == Constants.System.Root.ToInvariantString())
     {
         menu.Items.Add<RefreshNode, ActionRefresh>("Обновить", true);
     }
     return menu;
 }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            if (id == Constants.System.Root.ToInvariantString())
            {
                // root actions              

                return menu;
            }
            return menu;
        }
		protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
		{
			var menu = new MenuItemCollection();

			if (id == Constants.System.Root.ToInvariantString())
			{
				menu.Items.Add<RefreshNode, ActionRefresh>("Reload Log Files", true);
			}

			return menu;
		}
Exemplo n.º 14
0
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == "settings")
            {
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            }

            return menu;
        }
Exemplo n.º 15
0
 /// <summary>
 /// Adds the "Create Folder" action to the folder's menu.
 /// </summary>
 /// <param name="menu">
 /// The menu items.
 /// </param>
 public void AddCreateFolderAction(MenuItemCollection menu)
 {
     var path = "/App_Plugins/formulate/menu-actions/createFolder.html";
     var menuItem = new MenuItem()
     {
         Alias = "createFolder",
         Icon = "formulate-create-folder",
         Name = LocalizationHelper.GetMenuItemName("Create Folder")
     };
     menuItem.LaunchDialogView(path, "Create Folder");
     menu.Items.Add(menuItem);
 }
Exemplo n.º 16
0
 protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     if (id == "-1")
     {
         menu.DefaultMenuAlias = ActionNew.Instance.Alias;
         menu.Items.Add<ActionNew>("Create");
         menu.Items.Add<ActionRefresh>("Refresh nodes");
     }
     menu.Items.Add<ActionDelete>("Delete");
     return menu;
 }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            MenuItemCollection menu = new MenuItemCollection();

              if (id != Constants.System.Root.ToInvariantString())
              {
            menu.Items.Add<ActionDelete>("Delete");
            menu.Items.Add<ActionUpdate>("Unappeal");
              }

              return menu;
        }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == Constants.System.Root.ToString()) {
                menu.Items.Add<CreateChildEntity, ActionNew>(GetLocalizedText("actions", ActionNew.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(GetLocalizedText("actions", ActionRefresh.Instance.Alias), true);
                return menu;
            }

            menu.Items.Add<ActionDelete>(GetLocalizedText("actions", ActionDelete.Instance.Alias));
            return menu;
        }
Exemplo n.º 19
0
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            MenuItemCollection menuItemCollection = new MenuItemCollection();
            if (id == "-1")
            {
                menuItemCollection.Items.Add<ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
            }
            else
            {
                menuItemCollection.Items.Add<ActionDelete>(ui.Text("delete", ActionDelete.Instance.Alias));
            }
            menuItemCollection.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true, null);

            return menuItemCollection;
        }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == Constants.System.Root.ToInvariantString())
            {
                // root actions              
                menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
                return menu;
            }
            
            //only have delete for each node
            menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));            
            return menu;
        }
Exemplo n.º 21
0
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == Constants.System.Root.ToInvariantString())
            {
                menu.Items.Add<CreateChildEntity, ActionNew>(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias)));
                menu.Items.Add<RefreshNode, ActionRefresh>(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), hasSeparator: true);
            }
            else
            {
                menu.Items.Add<ActionDelete>(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias)));
            }

            return menu;
        }
Exemplo n.º 22
0
        /// <summary>
        /// The get menu for node.
        /// </summary>
        /// <param name="id">
        /// The id.
        /// </param>
        /// <param name="queryStrings">
        /// The query strings.
        /// </param>
        /// <returns>
        /// The <see cref="MenuItemCollection"/>.
        /// </returns>
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == "settings")
            {
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
            }

            ////if (id == "catalog")
            ////{
            //    //create product
            ////    menu.Items.Add<MerchelloActionNewProduct>(ui.Text("actions", MerchelloActionNewProduct.Instance.Alias));
            ////}

            return menu;
        }
Exemplo n.º 23
0
 /// <summary>
 /// Adds the "Create Form" action with the specified ID used
 /// as the parent for the form that is created.
 /// </summary>
 /// <param name="menu">
 /// The menu to add the action to.
 /// </param>
 /// <param name="entityId">
 /// The ID of the entity to create the form under.
 /// If null, the form will be created at the root.
 /// </param>
 public void AddCreateFormAction(MenuItemCollection menu,
     Guid? entityId = null)
 {
     var path = "/formulate/formulate/editForm/null";
     var menuItem = new MenuItem()
     {
         Alias = "createForm",
         Icon = "folder",
         Name = "Create Form"
     };
     if (entityId.HasValue)
     {
         path = path + "?under=" + GuidHelper.GetString(entityId.Value);
     }
     menuItem.NavigateToRoute(path);
     menu.Items.Add(menuItem);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Adds the "Create Validation" action with the specified ID used
 /// as the parent for the validation that is created.
 /// </summary>
 /// <param name="menu">
 /// The menu to add the action to.
 /// </param>
 /// <param name="entityId">
 /// The ID of the entity to create the validation under.
 /// If null, the validation will be created at the root.
 /// </param>
 public void AddCreateValidationAction(MenuItemCollection menu,
     Guid? entityId = null)
 {
     var path = "/App_Plugins/formulate/menu-actions/createValidation.html";
     var menuItem = new MenuItem()
     {
         Alias = "createValidation",
         Icon = "folder",
         Name = "Create Validation"
     };
     if (entityId.HasValue)
     {
         path = path + "?under=" + GuidHelper.GetString(entityId.Value);
     }
     menuItem.LaunchDialogView(path, "Create Validation");
     menu.Items.Add(menuItem);
 }
 protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     if (id == Constants.System.Root.ToInvariantString())
     {
         // root actions              
         menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
         menu.Items.Add<ActionSort>(ui.Text("actions", ActionSort.Instance.Alias));
         menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
         return menu;
     }
     else
     {
         menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
     }
     return menu;
 }
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            if (id == Constants.System.Root.ToInvariantString())
            {
                // root actions
                menu.Items.Add<CreateChildEntity, ActionNew>("create");
                menu.Items.Add<RefreshNode, ActionRefresh>("refresh");
                return menu;
            }
            else
            {
                //menu.DefaultMenuAlias = ActionDelete.Instance.Alias;
                menu.Items.Add<ActionDelete>("delete");

            }
            return menu;
        }
Exemplo n.º 27
0
 //设置菜单
 protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
 {
     var menu = new MenuItemCollection();
     IContentType ct = Services.ContentTypeService.GetContentType("PayRecords");
     //if (ct.Id.ToString().Equals(id))
     //{
     //    menu.Items.Add(new MenuItem("create", "创建入金记录"));
     //}
     //menu.Items.Add(new MenuItem("SendMail", "重发入金成功邮件"));
     //menu.Items.Add(new MenuItem("Approved", "审核入金"));
     if (id.ToLower() == "false")
     {
         menu.Items.Add(new MenuItem("clear", "清除未购买数据"));
     }
     menu.Items.Add<RefreshNode, ActionRefresh>("刷新节点");
     menu.Items.Add<ActionDelete>("Delete");
     return menu;
 }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (Helpers.Constants.DISABLE_EDITING) return menu;

            if (!id.EndsWith(Helpers.Constants.MARKDOWN_FILE_EXTENSION))
            {
                menu.Items.Add<ActionNew>("Create");
                menu.Items.Add<ActionRefresh>("Reload Nodes");
            }

            if (id == "-1") return menu;

            menu.Items.Add<ActionMove>("Rename");
            menu.Items.Add<ActionDelete>("Delete");

            return menu;
        }
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            if (id.EndsWith(".cshtml") == false)
            {
                menu.Items.Add<ActionNew>("Create");
            }
            else
            {
                // When clicking delete - it expects this default view
                // /App_Plugins/ViewsEditor/backoffice/ViewsEditorTree/delete.html
                menu.Items.Add<ActionDelete>("Delete");
            }

            menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);


            return menu;
        }
Exemplo n.º 30
0
        /// <summary>
        /// Gets the menu for the uLocate tree.
        /// </summary>
        /// <param name="id">
        /// The id.
        /// </param>
        /// <param name="queryStrings">
        /// The <see cref="FormatDataCollection"/> query strings.
        /// </param>
        /// <returns>
        /// The <see cref="MenuItemCollection"/> for respective tree nodes.
        /// </returns>
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == Constants.System.Root.ToInvariantString())
            {
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias));
            }
            if (id == "1")
            {
                menu.Items.Add<ActionNew>(ui.Text("actions", ActionNew.Instance.Alias)).LaunchDialogView("/App_Plugins/uLocate/Dialogs/create.location.dialog.html", "Create");
            }
            if (id == "2")
            {
                menu.Items.Add<ActionNew>(ui.Text("actions", ActionNew.Instance.Alias)).LaunchDialogView("/App_Plugins/uLocate/Dialogs/create.locationType.dialog.html", "Create");
            }

            return menu;
        }
Exemplo n.º 31
0
        protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();

            if (id == "-1")
            {
                // root actions

                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
                return menu;
            }
            else
            {
                //var idInt = 0;

                if (id.IndexOf("?") > 0)
                {
                    var currentType = Type.GetType(id.Split('?')[1].Replace("type=",""));
                    var attri = (UIOMaticAttribute)Attribute.GetCustomAttribute(currentType, typeof(UIOMaticAttribute));

                    if (!attri.ReadOnly)
                        menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
                }
                else
                {
                    var currentType = Type.GetType(id);
                    var attri = (UIOMaticAttribute)Attribute.GetCustomAttribute(currentType, typeof(UIOMaticAttribute));

                    if(!attri.ReadOnly)
                        menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                    if(attri.RenderType == Enums.UIOMaticRenderType.Tree)
                    menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
                }

            }
            return menu;
        }
Exemplo n.º 32
0
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            // create my menu item "Import"
            var menu = new MenuItemCollection();

            //// duplicate this section for more than one icon
            var m = new MenuItem("create", "Create");
            m.Icon = "add";
            m.NavigateToRoute("/settings/definedContent/create/" + id);
            m.AdditionalData.Add("DefinedContentParent", id == "-1" ? "" : id);
            menu.Items.Add(m);

            if (id != "-1")
            {
                menu.Items.Add<ActionDelete>("Delete", additionalData: new Dictionary<string, object> { { "id", id } });
            }
            else
            {
                menu.Items.Add<FullRefreshAction>("Full Refresh");
            }

            menu.Items.Add<ActionRefresh>("Refresh");
            return menu;
        }