Beispiel #1
0
 public virtual ItemTemplate GetItemTemplate(string category, string templateName)
 {
     var physicalPath = GetPhysicalPath(category);
     if (Directory.Exists(physicalPath))
     {
         ItemTemplate itemTemplate = new ItemTemplate() { TemplateName = templateName, Category = category };
         itemTemplate.TemplateFile = Path.Combine(physicalPath, templateName + FileExtension);
         var thumbnail = Path.Combine(physicalPath, templateName + ".png");
         if (File.Exists(thumbnail))
         {
             itemTemplate.Thumbnail = UrlUtility.GetVirtualPath(thumbnail);
         }
         return itemTemplate;
     }
     return null;
 }
Beispiel #2
0
        public virtual ActionResult Delete(ItemTemplate[] model)
        {
            ModelState.Clear();
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                if (model != null)
                {
                    foreach (var item in model)
                    {
                        SiteTemplateManager.DeleteItemTemplate(item);
                    }
                }

                data.ReloadPage = true;
            });

            return Json(data);
        }