Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor. Creates a new model.
        /// </summary>
        /// <param name="isfolder">Whether this is a folder or not.</param>
        public EditModel(bool isfolder, Guid parentid)
        {
            Content = new Piranha.Models.Content()
            {
                IsFolder = isfolder, ParentId = parentid
            };
            ContentCategories = new List <Guid>();
            Categories        = new MultiSelectList(Category.GetFields("category_id, category_name",
                                                                       new Params()
            {
                OrderBy = "category_name"
            }), "Id", "Name");
            var folders = Content.GetFields("content_id, content_name", "content_folder=1 AND content_draft=1", new Params()
            {
                OrderBy = "content_name"
            });

            folders.Insert(0, new Content());
            Extensions = Content.GetExtensions(true);
            Folders    = SortFolders(Content.GetFolderStructure(false));
            Folders.Insert(0, new Placement()
            {
                Text = "", Value = Guid.Empty
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Default constructor. Creates a new model.
        /// </summary>
        /// <param name="isfolder">Weather this is a folder or not.</param>
        public EditModel(bool isfolder, Guid parentid)
        {
            Content = new Piranha.Models.Content()
            {
                IsFolder = isfolder, ParentId = parentid
            };
            ContentCategories = new List <Guid>();
            Categories        = new MultiSelectList(Category.GetFields("category_id, category_name",
                                                                       new Params()
            {
                OrderBy = "category_name"
            }), "Id", "Name");
            var folders = Content.GetFields("content_id, content_name", "content_folder=1", new Params()
            {
                OrderBy = "content_name"
            });

            folders.Insert(0, new Content());
            if (Content.ParentId == Guid.Empty)
            {
                Folders = new SelectList(folders, "Id", "Name");
            }
            else
            {
                Folders = new SelectList(folders, "Id", "Name", Content.ParentId);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Default constructor. Creates a new model.
 /// </summary>
 /// <param name="isfolder">Whether this is a folder or not.</param>
 public EditModel(bool isfolder, Guid parentid)
 {
     Content = new Piranha.Models.Content() { IsFolder = isfolder, ParentId = parentid } ;
     ContentCategories = new List<Guid>() ;
     Categories = new MultiSelectList(Category.GetFields("category_id, category_name",
         new Params() { OrderBy = "category_name" }), "Id", "Name") ;
     var folders = Content.GetFields("content_id, content_name", "content_folder=1 AND content_draft=1", new Params() { OrderBy = "content_name" }) ;
     folders.Insert(0, new Content()) ;
     Extensions = Content.GetExtensions() ;
     Folders = SortFolders(Content.GetFolderStructure(false)) ;
     Folders.Insert(0, new Placement() { Text = "", Value = Guid.Empty }) ;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Default constructor. Creates a new model.
 /// </summary>
 /// <param name="isfolder">Weather this is a folder or not.</param>
 public EditModel(bool isfolder, Guid parentid)
 {
     Content = new Piranha.Models.Content() { IsFolder = isfolder, ParentId = parentid } ;
     ContentCategories = new List<Guid>() ;
     Categories = new MultiSelectList(Category.GetFields("category_id, category_name",
         new Params() { OrderBy = "category_name" }), "Id", "Name") ;
     var folders = Content.GetFields("content_id, content_name", "content_folder=1", new Params() { OrderBy = "content_name" }) ;
     folders.Insert(0, new Content()) ;
     if (Content.ParentId == Guid.Empty)
         Folders = new SelectList(folders, "Id", "Name") ;
     else Folders = new SelectList(folders, "Id", "Name", Content.ParentId) ;
 }