예제 #1
0
		/// <summary>
		/// Gets all available content.
		/// </summary>
		/// <returns>A list of content records</returns>
		public static PopupModel Get(string id = "", bool published = false, string filter = "") {
			PopupModel lm = new PopupModel();

			if (!String.IsNullOrEmpty(id)) {
				lm.SelectedFolder = new Guid(id);
				lm.Content = Piranha.Models.Content.GetStructure(new Guid(id), true, published);
			} else lm.Content = Piranha.Models.Content.GetStructure(published);

			return lm;
		}
예제 #2
0
        /// <summary>
        /// Gets all available content.
        /// </summary>
        /// <returns>A list of content records</returns>
        public static PopupModel Get(string id = "")
        {
            PopupModel lm = new PopupModel() ;

            if (!String.IsNullOrEmpty(id))
                lm.Content = Piranha.Models.Content.GetStructure(new Guid(id), true) ;
            else lm.Content = Piranha.Models.Content.GetStructure() ;

            return lm ;
        }
예제 #3
0
        /// <summary>
        /// Gets all available content.
        /// </summary>
        /// <returns>A list of content records</returns>
        public static PopupModel Get(string id = "")
        {
            PopupModel lm = new PopupModel();

            if (!String.IsNullOrEmpty(id))
            {
                lm.Content = Piranha.Models.Content.GetStructure(new Guid(id), true, false);
            }
            else
            {
                lm.Content = Piranha.Models.Content.GetStructure(false);
            }

            return(lm);
        }
예제 #4
0
        /// <summary>
        /// Gets all available content.
        /// </summary>
        /// <returns>A list of content records</returns>
        public static PopupModel Get(string id = "", bool published = false, string filter = "")
        {
            PopupModel lm = new PopupModel();

            if (!String.IsNullOrEmpty(id))
            {
                lm.SelectedFolder = new Guid(id);
                lm.Content        = Piranha.Models.Content.GetStructure(new Guid(id), true, published);
            }
            else
            {
                lm.Content = Piranha.Models.Content.GetStructure(published);
            }

            return(lm);
        }
예제 #5
0
        public JsonResult Popup(PopupModel m)
        {
            if (ModelState.IsValid) {
                EditModel em = new EditModel() ;
                em.Content = m.NewContent ;
                em.FileUrl = m.FileUrl ;
                em.UploadedFile = m.UploadedFile ;

                if (em.SaveAll(false))
                    return new JsonResult() { Data = true } ;
            }
            return new JsonResult() { Data = false } ;
        }