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