protected function OnSuccess()
 {
     //$isNew = !$this->naviItem->Exists();
     $this->naviItem->SetName($this->Value('Name'));
     $this->naviItem->SetNavigation($this->navi);
     if (!$this->naviItem->Exists()) {
         $this->tree->Insert($this->naviItem, $this->parent, $this->previous);
     } else {
         $this->naviItem->Save();
     }
     if ($this->Value('Type') == 'PageItem') {
         $this->naviItem->SetPageItem($this->selector->Save($this->naviItem->GetPageItem()));
         $this->naviItem->Save();
         //$pageItem = $this->SavePageItem();
         //$this->SavePageParams($pageItem);
     } else {
         $this->SaveUrlItem();
     }
     $this->Redirect();
 }
Esempio n. 2
0
 /**
  * Attaches the content to the container
  * @param boolean $isNew
  */
 private function AttachContainerContent($isNew)
 {
     $provider = new ContainerContentTreeProvider($this->Container());
     $tree = new TreeBuilder($provider);
     $containerContent = $this->Content()->GetContainerContent();
     if (!$containerContent) {
         $containerContent = new ContainerContent();
         $containerContent->SetContainer($this->Container());
         $provider->AttachContent($containerContent, $this->Content());
     }
     if ($isNew) {
         $tree->Insert($containerContent, $this->ParentItem(), $this->PreviousItem());
     }
 }
Esempio n. 3
0
 /**
  * Takes care of page tree insertion important for a fresh page
  */
 private function SaveNew()
 {
     $treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));
     $treeBuilder->Insert($this->page, $this->parent, $this->previous);
 }
Esempio n. 4
0
 private function InsertAfter()
 {
     $previous = $this->TableSchema()->ByKeyValue(Request::PostData('previous'));
     $this->tree->Insert($this->item, null, $previous);
 }