コード例 #1
0
ファイル: FolderList.ascx.cs プロジェクト: hdgardner/ECF
        /// <summary>
        /// Processes the move command.
        /// </summary>
        /// <param name="args">The args.</param>
        void ProcessMoveCommand(Dictionary <string, object> args)
        {
            int folderId = 0;

            string folderString = args["folder"] as string;

            if (String.IsNullOrEmpty(folderString) || !Int32.TryParse(folderString, out folderId))
            {
                return;
            }

            string[] items = MyListView.CurrentListView.GetCheckedCollection();

            if (items != null)
            {
                for (int i = 0; i < items.Length; i++)
                {
                    string[] keys = EcfListView.GetPrimaryKeyIdStringItems(items[i]);
                    if (keys != null)
                    {
                        int id = Int32.Parse(keys[0]);
                        FileTreeItem.MoveTo(id, folderId);
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Creates a new folder.
        /// </summary>
        private void CreateFolder()
        {
            //create temporary folder with unique name
            string guid  = Guid.NewGuid().ToString();
            int    newId = FileTreeItem.AddFileItem(guid, true, true, false, String.Empty, SiteId);

            FileTreeItem.MoveTo(newId, Int32.Parse(Root.SelectedValue));
            FileTreeItem.UpdateFileItem(newId, Name.Text, true, true, false, String.Empty, SiteId);

            // update folder access
            foreach (ListItem item in RolesList.Items)
            {
                if (item.Selected)
                {
                    FileTreeItem.AddPageAccess(item.Value, newId);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Creates a new page.
        /// </summary>
        private void CreatePage()
        {
            int    newId       = 0;
            string newPageName = MakePageName(Name.Text);

            //create new page
            string guid = Guid.NewGuid().ToString();

            newId = FileTreeItem.AddFileItem(guid, true, false, false, MasterPageText.Text, SiteId);
            FileTreeItem.MoveTo(newId, int.Parse(Root.SelectedValue));
            FileTreeItem.UpdateFileItem(newId, newPageName, true, true, false, MasterPageText.Text, SiteId);

            //append meta description and keywords
            PageAttributes.Add(newId,
                               String.IsNullOrEmpty(txtTitle.Text) ? GlobalVariable.GetVariable(_GlobalVariableTitleKey, SiteId) : txtTitle.Text,
                               String.IsNullOrEmpty(txtKeywords.Text) ? GlobalVariable.GetVariable(_GlobalVariableMetaKeywordsKey, SiteId) : txtKeywords.Text,
                               String.IsNullOrEmpty(txtDescription.Text) ? GlobalVariable.GetVariable(_GlobalVariableMetaDescriptionKey, SiteId) : txtDescription.Text);
        }