protected function OnSuccess() { File::CreateWithText($this->file, $this->Value('Contents', false)); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportLayoutAction($this->layout, Action::Update()); Response::Redirect($this->BackLink()); }
/** * Saves the group and redirects to the list */ protected function OnSuccess() { $action = $this->group->Exists() ? Action::Update() : Action::Create(); $this->group->SetName($this->Value('Name')); $this->group->SetCreateContainers((bool) $this->Value('CreateContainers')); $this->group->SetCreateLayouts((bool) $this->Value('CreateLayouts')); $this->group->SetCreateContainers((bool) $this->Value('CreateContainers')); $this->group->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportUserGroupAction($this->group, $action); $target = BackendRouter::ModuleUrl(new UsergroupList()); Response::Redirect($target); }
/** * Saves the container */ protected function OnSuccess() { $action = Action::Update(); if (!$this->container->Exists()) { $action = Action::Create(); $this->container->SetUser(self::Guard()->GetUser()); } $this->container->SetName($this->Value('Name')); $this->container->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportContainerAction($this->container, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } Response::Redirect(BackendRouter::ModuleUrl(new ContainerList())); }
/** * Saves the template into the given file name */ protected function OnSuccess() { $newTemplate = $this->Value('Name'); $action = Action::Create(); if ($this->template) { $action = Action::Update(); $this->UpdateUsages($newTemplate); $oldFile = $this->CalcFile($this->template); if (File::Exists($oldFile)) { File::Delete($oldFile); } } $logger = new Logger(self::Guard()->GetUser()); $logger->ReportTemplateAction($this->module->MyType(), $newTemplate, $action); if (!Folder::Exists($this->folder)) { Folder::Create($this->folder); } File::CreateWithText($this->CalcFile($newTemplate), $this->Value('Contents', false)); Response::Redirect($this->BackLink()); }
/** * Saves the site */ protected function OnSuccess() { $action = Action::Update(); if (!$this->site->Exists()) { $action = Action::Create(); $this->site->SetUser(self::Guard()->GetUser()); } $this->site->SetName($this->Value('Name')); $this->site->SetUrl($this->Value('Url')); $this->site->SetLanguage(Language::Schema()->ByID($this->Value('Language'))); $this->site->SetSitemapActive((bool) $this->Value('SitemapActive')); $this->site->SetSitemapCacheLifetime((int) $this->Value('SitemapCacheLifetime')); $this->site->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportSiteAction($this->site, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } Response::Redirect(BackendRouter::ModuleUrl(new SiteList())); }
/** * Saves the area */ protected function OnSuccess() { $action = $this->user->Exists() ? Action::Update() : Action::Create(); $this->user->SetName($this->Value('Name')); $this->user->SetEMail($this->Value('EMail')); $this->user->SetLanguage(new Language($this->Value('Language'))); if ($this->CanChangeIsAdmin()) { $this->user->SetIsAdmin((bool) $this->Value('IsAdmin')); } $this->SavePassword(); $this->user->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportUserAction($this->user, $action); Response::Redirect(BackendRouter::ModuleUrl(new UserList())); }
/** * Saves content base properties */ private function SaveContent() { $this->Content()->SetType($this->FrontendModule()->MyType()); $this->Content()->SetCssClass($this->Value('CssClass')); $this->Content()->SetCssID($this->Value('CssID')); $this->Content()->SetTemplate($this->Value('Template')); $this->Content()->SetCacheLifetime((int) $this->Value('CacheLifetime')); $this->Content()->SetGuestsOnly((bool) $this->Value('GuestsOnly')); if ($this->AutoPublish()) { $this->Content()->SetPublish(true); } else { $this->Content()->SetPublish((bool) $this->Value('Publish')); } $this->Content()->SetPublishFrom($this->PublishDate('PublishFrom')); $this->Content()->SetPublishTo($this->PublishDate('PublishTo')); $action = Action::Update(); if (!$this->Content()->Exists()) { $action = Action::Create(); $this->Content()->SetUser(self::Guard()->GetUser()); } $this->Content()->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportContentAction($this->Content(), $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } $this->SaveMemberGroups(); $this->SaveWordings(); }
/** * Saves the page */ protected function OnSuccess() { $this->page->SetName($this->Value('Name')); $this->page->SetUrl($this->Value('Url')); $this->page->SetSite($this->site); $this->page->SetTitle($this->Value('Title')); $this->page->SetDescription($this->Value('Description')); $this->page->SetKeywords($this->Value('Keywords')); $this->page->SetLayout(new Layout($this->Value('Layout'))); $this->page->SetMenuAccess($this->Value('MenuAccess')); $this->page->SetGuestsOnly((bool) $this->Value('GuestsOnly')); $this->page->SetPublish((bool) $this->Value('Publish')); $this->page->SetPublishFrom($this->PublishDate('PublishFrom')); $this->page->SetPublishTo($this->PublishDate('PublishTo')); $relevance = (double) $this->Value('SitemapRelevance') / 10; $this->page->SetSitemapRelevance(min(max(0.0, $relevance), 1.0)); $this->page->SetSitemapChangeFrequency($this->Value('SitemapChangeFrequency')); $this->SaveType(); $action = Action::Update(); if (!$this->page->Exists()) { $action = Action::Create(); $this->SaveNew(); } else { $this->page->Save(); } $logger = new Logger(self::Guard()->GetUser()); $logger->ReportPageAction($this->page, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } $this->SaveMemberGroups(); $this->AdjustHtaccess(); Response::Redirect($this->BackLink()); }
/** * Saves the layout */ protected function OnSuccess() { $action = Action::Update(); $isNew = !$this->layout->Exists(); if ($isNew) { $action = Action::Create(); $this->layout->SetUser(self::Guard()->GetUser()); } $oldFile = $isNew ? '' : PathUtil::LayoutTemplate($this->layout); $this->layout->SetName($this->Value('Name')); $this->layout->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportLayoutAction($this->layout, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } if ($isNew) { $this->SaveAreas(); } $this->UpdateFiles($oldFile); $args = array('layout' => $this->layout->GetID()); Response::Redirect(BackendRouter::ModuleUrl(new AreaList(), $args)); }
/** * Saves the user */ protected function OnSuccess() { $action = $this->member->Exists() ? Action::Update() : Action::Create(); $this->member->SetName($this->Value('Name')); $this->member->SetEMail($this->Value('EMail')); $this->SetPassword(); $this->member->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportMemberAction($thos->member, $action); if ($this->groupsExist && $this->CanAssignGroup()) { $this->SaveGroups(); } Response::Redirect(BackendRouter::ModuleUrl(new MemberList())); }