Example #1
0
 public JsonResult <dynamic> SavePortal(CoreModels.Portal portal)
 {
     return(API.Execute <dynamic>(r =>
     {
         Security.VerifyActivityAuthorized("Portal", "Administration");
         if (CoreServices.Portal.Save(portal))
         {
             r.Data = new { selectedId = portal.Id, portals = CoreServices.Portal.GetPortals() };
             r.AddMessage(Localization.GetPortalText("DataSave.Text", "Data has been saved."));
         }
     }));
 }
Example #2
0
 public JsonResult <dynamic> CreatePortal(CoreModels.User adminUser, CoreModels.Portal portal, List <string> packages)
 {
     return(API.Execute <dynamic>(r =>
     {
         Security.VerifyActivityAuthorized("Portal", "Administration");
         var portalId = Core.Services.Update.InstallPortal(adminUser, portal);
         foreach (var package in packages)
         {
             Update.InstallPackage(package, portalId);
         }
         r.Data = new { selectedId = portalId, portals = CoreServices.Portal.GetPortals() };
     }));
 }