Example #1
0
        /// <summary>
        /// Handles Add New List command
        /// </summary>
        /// <remarks>
        /// Using "CommandName" property of cmdSaveEntry to determine this is a new list
        /// </remarks>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        protected void cmdAddList_Click(object sender, EventArgs e)
        {
            EnableView(false);
            EnableEdit(true);

            this.txtParentKey.Text        = "";
            this.txtEntryName.Text        = "";
            this.txtEntryValue.Text       = "";
            this.txtEntryText.Text        = "";
            this.txtEntryName.ReadOnly    = false;
            this.cmdSaveEntry.CommandName = "SaveList";


            ListController ctlLists = new ListController();

            ddlSelectList.DataSource     = ctlLists.GetListInfoCollection();
            ddlSelectList.DataTextField  = "DisplayName";
            ddlSelectList.DataValueField = "Key";
            ddlSelectList.DataBind();
            ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));

            // Reset dropdownlist
            ddlSelectParent.ClearSelection();
            ddlSelectParent.Enabled = false;
        }
        private void BindTree()
        {
            var ctlLists = new ListController();
            var colLists = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            listTree.Nodes.Clear();

            foreach (ListInfo list in colLists)
            {
                String filteredNode;
                if (list.DisplayName.Contains(":"))
                {
                    var finalPeriod = list.DisplayName.LastIndexOf(".", StringComparison.InvariantCulture);
                    filteredNode = list.DisplayName.Substring(finalPeriod + 1);

                }
                else
                {
                    filteredNode = list.DisplayName;
                }
				var node = new DnnTreeNode { Text = filteredNode };
                {
                    node.Value = list.Key;
                    node.ToolTip = String.Format(LocalizeString("NoEntries"), list.EntryCount);
					node.ImageUrl = IconController.IconURL("Folder");
                }
                if (list.Level == 0)
                {
					listTree.Nodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        
                        var parentNode = (DnnTreeNode) indexLookup[list.ParentList];
  
                        parentNode.Nodes.Add(node);
                    }
                }
                
                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
Example #3
0
        private void BindTree()
        {
            var ctlLists    = new ListController();
            var colLists    = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            listTree.Nodes.Clear();

            foreach (ListInfo list in colLists)
            {
                String filteredNode;
                if (list.DisplayName.Contains(":"))
                {
                    var finalPeriod = list.DisplayName.LastIndexOf(".", StringComparison.InvariantCulture);
                    filteredNode = list.DisplayName.Substring(finalPeriod + 1);
                }
                else
                {
                    filteredNode = list.DisplayName;
                }
                var node = new DnnTreeNode {
                    Text = filteredNode
                };
                {
                    node.Value    = list.Key;
                    node.ToolTip  = String.Format(LocalizeString("NoEntries"), list.EntryCount);
                    node.ImageUrl = IconController.IconURL("Folder");
                }
                if (list.Level == 0)
                {
                    listTree.Nodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (DnnTreeNode)indexLookup[list.ParentList];

                        parentNode.Nodes.Add(node);
                    }
                }

                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
Example #4
0
        private void BindTree()
        {
            var ctlLists    = new ListController();
            var colLists    = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            listTree.Nodes.Clear();

            foreach (ListInfo list in colLists)
            {
                var node = new DnnTreeNode {
                    Text = list.DisplayName.Replace(list.ParentList + ".", "")
                };
                {
                    node.Value    = list.Key;
                    node.ToolTip  = String.Format(LocalizeString("NoEntries"), list.EntryCount);
                    node.ImageUrl = IconController.IconURL("Folder");
                }
                if (list.Level == 0)
                {
                    listTree.Nodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (DnnTreeNode)indexLookup[list.ParentList];
                        parentNode.Nodes.Add(node);
                    }
                }

                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
Example #5
0
        /// <summary>
        /// Loads top level entry list into DNNTree
        /// </summary>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        private void BindTree()
        {
            ListController     ctlLists    = new ListController();
            ListInfoCollection colLists    = ctlLists.GetListInfoCollection();
            Hashtable          indexLookup = new Hashtable();

            DNNtree.TreeNodes.Clear();

            foreach (ListInfo Lists in colLists)
            {
                TreeNode node = new TreeNode(Lists.DisplayName);
                node.Key        = Lists.Key;
                node.ToolTip    = Lists.EntryCount + " entries";
                node.ImageIndex = (int)eImageType.Folder;
                //.Target = Lists.DefinitionID.ToString & ":" & Lists.EnableSortOrder.ToString ' borrow this property to store this value

                if (Lists.Level == 0)
                {
                    DNNtree.TreeNodes.Add(node);
                }
                else
                {
                    if (indexLookup[Lists.ParentList] != null)
                    {
                        TreeNode parentNode = (TreeNode)(indexLookup[Lists.ParentList]);
                        parentNode.TreeNodes.Add(node);
                    }
                }

                // Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[Lists.Key] == null)
                {
                    indexLookup.Add(Lists.Key, node);
                }
            }
        }
Example #6
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        ///     Loads top level entry list into DNNTree
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void BindTree()
        {
            var ctlLists    = new ListController();
            var colLists    = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            DNNtree.TreeNodes.Clear();

            foreach (ListInfo list in colLists)
            {
                var node = new TreeNode(list.DisplayName);
                {
                    node.Key        = list.Key;
                    node.ToolTip    = list.EntryCount + " entries";
                    node.ImageIndex = (int)eImageType.Folder;
                }
                if (list.Level == 0)
                {
                    DNNtree.TreeNodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (TreeNode)indexLookup[list.ParentList];
                        parentNode.TreeNodes.Add(node);
                    }
                }

                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
        private void BindTree()
        {
            var ctlLists = new ListController();
            var colLists = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
            var indexLookup = new Hashtable();

            listTree.Nodes.Clear();

            foreach (ListInfo list in colLists)
            {
				var node = new DnnTreeNode { Text = list.DisplayName.Replace(list.ParentList + ".", "") };
                {
                    node.Value = list.Key;
                    node.ToolTip = String.Format(LocalizeString("NoEntries"), list.EntryCount);
					node.ImageUrl = IconController.IconURL("Folder");
                }
                if (list.Level == 0)
                {
					listTree.Nodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (DnnTreeNode) indexLookup[list.ParentList];
                        parentNode.Nodes.Add(node);
                    }
                }
                
                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
        /// <summary>
        ///     Loads top level entry list
        /// </summary>
        private void BindListInfo()
        {
            lblListName.Text = ListName;
            lblListParent.Text = ParentKey;
            rowListParent.Visible = (!String.IsNullOrEmpty(ParentKey));
            chkEnableSortOrder.Checked = EnableSortOrder;
            if (!SystemList && ShowDelete)
            {
                cmdDeleteList.Visible = true;
                ClientAPI.AddButtonConfirm(cmdDeleteList, Localization.GetString("DeleteItem"));
            }
            else
            {
                cmdDeleteList.Visible = false;
            }
            switch (Mode)
            {
                case "ListEntries":
                    EnableView(true);
                    break;
                case "EditEntry":
                    EnableView(false);
                    EnableEdit(false);
                    break;
                case "AddEntry":
                    EnableView(false);
                    EnableEdit(false);
                    if (SelectedList != null)
                    {
                        txtParentKey.Text = SelectedList.ParentKey;
                    }
                    else
                    {
                        rowEnableSortOrder.Visible = true;
                    }
                    txtEntryName.Text = ListName;
                    rowListName.Visible = false;
                    txtEntryValue.Text = "";
                    txtEntryText.Text = "";
                    cmdSaveEntry.CommandName = "SaveEntry";
                    break;
                case "AddList":
                    EnableView(false);
                    EnableEdit(true);

                    rowListName.Visible = true;
                    txtParentKey.Text = "";
                    txtEntryName.Text = "";
                    txtEntryValue.Text = "";
                    txtEntryText.Text = "";
                    txtEntryName.ReadOnly = false;
                    cmdSaveEntry.CommandName = "SaveList";

                    var ctlLists = new ListController();

                    ddlSelectList.Enabled = true;
                    ddlSelectList.DataSource = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
                    ddlSelectList.DataTextField = "DisplayName";
                    ddlSelectList.DataValueField = "Key";
                    ddlSelectList.DataBind();
                    //ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));
                    ddlSelectList.InsertItem(0, Localization.GetString("None_Specified"), "");

                    //Reset dropdownlist
                    ddlSelectParent.ClearSelection();
                    ddlSelectParent.Enabled = false;

                    break;
            }
        }
Example #9
0
        /// <summary>
        ///     Loads top level entry list
        /// </summary>
        private void BindListInfo()
        {
            lblListName.Text           = ListName;
            lblListParent.Text         = ParentKey;
            rowListParent.Visible      = (!String.IsNullOrEmpty(ParentKey));
            chkEnableSortOrder.Checked = EnableSortOrder;
            if (!SystemList && ShowDelete)
            {
                cmdDeleteList.Visible = true;
                ClientAPI.AddButtonConfirm(cmdDeleteList, Localization.GetString("DeleteItem"));
            }
            else
            {
                cmdDeleteList.Visible = false;
            }
            switch (Mode)
            {
            case "ListEntries":
                EnableView(true);
                break;

            case "EditEntry":
                EnableView(false);
                EnableEdit(false);
                break;

            case "AddEntry":
                EnableView(false);
                EnableEdit(false);
                if (SelectedList != null)
                {
                    txtParentKey.Text = SelectedList.ParentKey;
                }
                else
                {
                    rowEnableSortOrder.Visible = true;
                }
                txtEntryName.Text        = ListName;
                rowListName.Visible      = false;
                txtEntryValue.Text       = "";
                txtEntryText.Text        = "";
                cmdSaveEntry.CommandName = "SaveEntry";
                break;

            case "AddList":
                EnableView(false);
                EnableEdit(true);

                rowListName.Visible      = true;
                txtParentKey.Text        = "";
                txtEntryName.Text        = "";
                txtEntryValue.Text       = "";
                txtEntryText.Text        = "";
                txtEntryName.ReadOnly    = false;
                cmdSaveEntry.CommandName = "SaveList";

                var ctlLists = new ListController();

                ddlSelectList.Enabled        = true;
                ddlSelectList.DataSource     = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
                ddlSelectList.DataTextField  = "DisplayName";
                ddlSelectList.DataValueField = "Key";
                ddlSelectList.DataBind();
                //ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));
                ddlSelectList.InsertItem(0, Localization.GetString("None_Specified"), "");

                //Reset dropdownlist
                ddlSelectParent.ClearSelection();
                ddlSelectParent.Enabled = false;

                break;
            }
        }
Example #10
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        ///     Loads top level entry list into DNNTree
        /// </summary>        
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void BindTree()
        {
            var ctlLists = new ListController();
            var colLists = ctlLists.GetListInfoCollection();
            var indexLookup = new Hashtable();

            DNNtree.TreeNodes.Clear();

            foreach (ListInfo list in colLists)
            {
                var node = new TreeNode(list.DisplayName);
                {
                    node.Key = list.Key;
                    node.ToolTip = list.EntryCount + " entries";
                    node.ImageIndex = (int) eImageType.Folder;
                }
                if (list.Level == 0)
                {
                    DNNtree.TreeNodes.Add(node);
                }
                else
                {
                    if (indexLookup[list.ParentList] != null)
                    {
                        var parentNode = (TreeNode) indexLookup[list.ParentList];
                        parentNode.TreeNodes.Add(node);
                    }
                }

                //Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[list.Key] == null)
                {
                    indexLookup.Add(list.Key, node);
                }
            }
        }
        /// <summary>
        /// Loads top level entry list into DNNTree
        /// </summary>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        private void BindTree()
        {
            ListController ctlLists = new ListController();
            ListInfoCollection colLists = ctlLists.GetListInfoCollection();
            Hashtable indexLookup = new Hashtable();

            DNNtree.TreeNodes.Clear();

            foreach (ListInfo Lists in colLists)
            {
                TreeNode node = new TreeNode(Lists.DisplayName);
                node.Key = Lists.Key;
                node.ToolTip = Lists.EntryCount + " entries";
                node.ImageIndex = (int)eImageType.Folder;
                //.Target = Lists.DefinitionID.ToString & ":" & Lists.EnableSortOrder.ToString ' borrow this property to store this value

                if (Lists.Level == 0)
                {
                    DNNtree.TreeNodes.Add(node);
                }
                else
                {
                    if (indexLookup[Lists.ParentList] != null)
                    {
                        TreeNode parentNode = (TreeNode)(indexLookup[Lists.ParentList]);
                        parentNode.TreeNodes.Add(node);
                    }
                }

                // Add index key here to find it later, should suggest with Joe to add it to DNNTree
                if (indexLookup[Lists.Key] == null)
                {
                    indexLookup.Add(Lists.Key, node);
                }

            }

        }
        /// <summary>
        /// Handles Add New List command
        /// </summary>
        /// <remarks>
        /// Using "CommandName" property of cmdSaveEntry to determine this is a new list
        /// </remarks>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        protected void cmdAddList_Click( object sender, EventArgs e )
        {

            EnableView(false);
            EnableEdit(true);

            this.txtParentKey.Text = "";
            this.txtEntryName.Text = "";
            this.txtEntryValue.Text = "";
            this.txtEntryText.Text = "";
            this.txtEntryName.ReadOnly = false;
            this.cmdSaveEntry.CommandName = "SaveList";


            ListController ctlLists = new ListController();
            ddlSelectList.DataSource = ctlLists.GetListInfoCollection();
            ddlSelectList.DataTextField = "DisplayName";
            ddlSelectList.DataValueField = "Key";
            ddlSelectList.DataBind();
            ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));

            // Reset dropdownlist
            ddlSelectParent.ClearSelection();
            ddlSelectParent.Enabled = false;
        }