Esempio n. 1
0
 public ActionResult Copy(string siteName)
 {
     var site = new Site(siteName);
     CopySiteModel model = new CopySiteModel()
     {
         Parent = site.Parent == null ? "" : site.Parent.FullName
     };
     return View(model);
 }
Esempio n. 2
0
        public ActionResult Copy(string siteName,CopySiteModel model)
        {
            var site = new Site(siteName);

            var data = new JsonResultEntry(ViewData.ModelState);

            if (ModelState.IsValid)
            {
                try
                {
                    var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(site, model.Name, model.Repository);
                }
                catch (Exception e)
                {
                    Kooboo.HealthMonitoring.Log.LogException(e);
                }
            }

            return Json(data);
        }
Esempio n. 3
0
        public ActionResult Copy(CopySiteModel model)
        {
            var data = new JsonResultData(ViewData.ModelState);

            if (ModelState.IsValid)
            {
                data.RunWithTry((resultData) =>
                {
                    if (string.IsNullOrEmpty(model.Membership))
                    {
                        model.Membership = Site.AsActual().Membership;
                    }
                    var options = model.ToCreateSiteOptions();
                    options.UserName = User.Identity.Name;
                    var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(Site, model.Name, options);

                    resultData.RedirectUrl = Url.Action("SiteMap", new { controller = "Home", siteName = createdSite.FullName });
                });
            }

            return Json(data);
        }
Esempio n. 4
0
 public ActionResult Copy()
 {
     CopySiteModel model = new CopySiteModel()
     {
         Parent = Site.Parent == null ? "" : Site.Parent.FullName
     };
     return View(model);
 }
Esempio n. 5
0
        public ActionResult Copy(CopySiteModel model)
        {
            var data = new JsonResultData(ViewData.ModelState);

            if (ModelState.IsValid)
            {
                data.RunWithTry((resultData) =>
                {
                    var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(Site, model.Name, model.Repository);

                    resultData.RedirectUrl = Url.Action("SiteMap", new { controller = "Home", siteName = createdSite.FullName });
                });
            }

            return Json(data);
        }