Exemplo n.º 1
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);
                }
            }
        }
Exemplo n.º 2
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);
        }