/// <summary>
 /// Adds the menu items to the node and sets the icon
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected virtual void CustomizeFolderNode(TreeNode n, FormCollection queryStrings)
 {
     //add the menu items
     n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
     n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete");
     n.AddMenuItem<Reload>();
 }
 protected override void AddMenuItemsToNodeInRecycleBin(TreeNode n, FormCollection queryStrings)
 {
     if (!queryStrings.GetValue <bool>(TreeQueryStringParameters.DialogMode))
     {
         //TODO: implement security restrictions here!
         //add the menu items
         n.AddEditorMenuItem <Move>(this, "moveUrl", "Move");
         n.AddEditorMenuItem <Delete>(this, "deleteUrl", "Delete");
         n.AddMenuItem <Reload>();
     }
 }
 /// <summary>
 /// Adds the menu items to the node and sets the icon
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected virtual void CustomizeFileNode(TreeNode n, FormCollection queryStrings)
 {
     n.HasChildren = false;
     n.Icon = "tree-doc";
     //add the menu items
     n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete");
 }
 /// <summary>
 /// Adds the menu items to the node and sets the icon
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected virtual void CustomizeFileNode(TreeNode n, FormCollection queryStrings)
 {
     n.HasChildren = false;
     n.Icon        = "tree-doc";
     //add the menu items
     n.AddEditorMenuItem <Delete>(this, "deleteUrl", "Delete");
 }
Exemple #5
0
 /// <summary>
 /// Adds menu items to root node
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected virtual void AddMenuItemsToRootNode(TreeNode n, FormCollection queryStrings)
 {
     if (!queryStrings.GetValue <bool>(TreeQueryStringParameters.DialogMode))
     {
         //add some menu items to the created root node
         n.AddEditorMenuItem <CreateItem>(this, "createUrl", "Create");
         n.AddMenuItem <Reload>();
     }
 }
        protected override void CustomizeFileNode(TreeNode n, FormCollection queryStrings)
        {
            n.AddEditorMenuItem <CreateItem>(this, "createUrl", "EditRule");
            base.CustomizeFileNode(n, queryStrings);
            n.AddMenuItem <Reload>();

            n.Icon = "tree-css";

            using (var uow = Hive.CreateReadonly())
            {
                var stylesheet = uow.Repositories.Get <File>(n.HiveId);
                var rules      = StylesheetHelper.ParseRules(stylesheet);
                n.HasChildren = rules.Count() > 0;
                if (n.HasChildren)
                {
                    n.JsonUrl = Url.GetTreeUrl(GetType(), n.HiveId, queryStrings);
                }
            }
        }
        protected override void CustomizeFileNode(TreeNode n, FormCollection queryStrings)
        {
            n.AddEditorMenuItem<CreateItem>(this, "createUrl", "EditRule");
            base.CustomizeFileNode(n, queryStrings);            
            n.AddMenuItem<Reload>();

            n.Icon = "tree-css";

            using (var uow = Hive.CreateReadonly())
            {
                var stylesheet = uow.Repositories.Get<File>(n.HiveId);
                var rules = StylesheetHelper.ParseRules(stylesheet);                
                n.HasChildren = rules.Count() > 0;
                if (n.HasChildren)
                {
                    n.JsonUrl = Url.GetTreeUrl(GetType(), n.HiveId, queryStrings);
                }

            }
        }
        /// <summary>
        /// Adds menu items to root node
        /// </summary>
        /// <param name="n"></param>
        /// <param name="queryStrings"></param>
        protected virtual void AddMenuItemsToRootNode(TreeNode n, FormCollection queryStrings)
        {
            if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
            {
                //add some menu items to the created root node
                n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
                n.AddEditorMenuItem<Sort>(this, "sortUrl", "Sort");
                n.AddMenuItem<Reload>();
            }

        }
 /// <summary>
 /// Adds menu items to each node
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected override void AddMenuItemsToNode(TreeNode n, FormCollection queryStrings)
 {
     if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
     {
         //add the menu items
         n.AddEditorMenuItem<CreateItem>(this, "createUrl", "CreateNew");
         //we need to add the recycle bin Id to the metadata so that the UI knows to refresh the bin on delete
         n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete", new Dictionary<string, object> {{"recycleBinId", RecycleBinId.ToJsonObject()}});
         n.AddEditorMenuItem<Move>(this, "moveUrl", "Move");
         n.AddEditorMenuItem<Copy>(this, "copyUrl", "Copy");
         n.AddEditorMenuItem<Sort>(this, "sortUrl", "Sort");
         n.AddEditorMenuItem<Rollback>(this, "rollbackUrl", "Rollback");
         n.AddEditorMenuItem<Publish>(this, "publishUrl", "Publish");
         n.AddEditorMenuItem<Permissions>(this, "permissionsUrl", "Permissions");
         n.AddEditorMenuItem<PublicAccess>(this, "publicAccessUrl", "PublicAccess");
         //n.AddMenuItem<Protect>();
         //n.AddMenuItem<Audit>();
         //n.AddMenuItem<Notify>();
         //nodeData.treeNode.AddMenuItem<SendTranslate>(MenuItems);
         n.AddEditorMenuItem<Hostname>(this, "hostnameUrl", "Hostname");
         n.AddEditorMenuItem<Language>(this, "languageUrl", "Language");
         n.AddMenuItem<Reload>();
     }
 }
 protected override void AddMenuItemsToNodeInRecycleBin(TreeNode n, FormCollection queryStrings)
 {
     if (!queryStrings.GetValue<bool>(TreeQueryStringParameters.DialogMode))
     {
         //TODO: implement security restrictions here!
         //add the menu items
         n.AddEditorMenuItem<Move>(this, "moveUrl", "Move");
         n.AddEditorMenuItem<Delete>(this, "deleteUrl", "Delete");
         n.AddMenuItem<Reload>();
     }
 }
Exemple #11
0
 /// <summary>
 /// Adds menu items to each node
 /// </summary>
 /// <param name="n"></param>
 /// <param name="queryStrings"></param>
 protected override void AddMenuItemsToNode(TreeNode n, FormCollection queryStrings)
 {
     if (!queryStrings.GetValue <bool>(TreeQueryStringParameters.DialogMode))
     {
         //add the menu items
         n.AddEditorMenuItem <CreateItem>(this, "createUrl", "CreateNew");
         //we need to add the recycle bin Id to the metadata so that the UI knows to refresh the bin on delete
         n.AddEditorMenuItem <Delete>(this, "deleteUrl", "Delete", new Dictionary <string, object> {
             { "recycleBinId", RecycleBinId.ToJsonObject() }
         });
         n.AddEditorMenuItem <Move>(this, "moveUrl", "Move");
         n.AddEditorMenuItem <Copy>(this, "copyUrl", "Copy");
         n.AddEditorMenuItem <Sort>(this, "sortUrl", "Sort");
         n.AddEditorMenuItem <Rollback>(this, "rollbackUrl", "Rollback");
         n.AddEditorMenuItem <Publish>(this, "publishUrl", "Publish");
         n.AddEditorMenuItem <Permissions>(this, "permissionsUrl", "Permissions");
         n.AddEditorMenuItem <PublicAccess>(this, "publicAccessUrl", "PublicAccess");
         //n.AddMenuItem<Protect>();
         //n.AddMenuItem<Audit>();
         //n.AddMenuItem<Notify>();
         //nodeData.treeNode.AddMenuItem<SendTranslate>(MenuItems);
         n.AddEditorMenuItem <Hostname>(this, "hostnameUrl", "Hostname");
         n.AddEditorMenuItem <Language>(this, "languageUrl", "Language");
         n.AddMenuItem <Reload>();
     }
 }