コード例 #1
0
ファイル: SiteForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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()));
 }