protected function CreateAfterUrl()
 {
     $args = array('navigation' => $this->navigation->GetID());
     $args['previous'] = $this->item->GetID();
     $parent = $this->item->GetParent();
     if ($parent) {
         $args['parent'] = $parent->GetID();
     }
     return BackendRouter::ModuleUrl(new NavigationItemForm(), $args);
 }
 /**
  * Checks if the current navigation item points to a parent of the current page
  * @return boolean Returns true if the current page is a child of the current item
  */
 private function IsTrail()
 {
     $pageItem = $this->naviItem->GetPageItem();
     if (!$pageItem) {
         return false;
     }
     $parent = PageRenderer::Page()->GetParent();
     $itemPage = $pageItem->GetPage();
     while ($parent) {
         if ($itemPage->Equals($parent)) {
             return true;
         }
         $parent = $parent->GetParent();
     }
     return false;
 }
 protected function Init()
 {
     $this->navi = new ContentNavigation(Request::GetData('navigation'));
     $this->naviTree = new NavigationTreeProvider($this->navi);
     $this->tree = new TreeBuilder($this->naviTree);
     $this->naviItem = new NavigationItem(Request::GetData('item'));
     if (Request::GetData('previous')) {
         $this->previous = NavigationItem::Schema()->ByID(Request::GetData('previous'));
     }
     if (Request::GetData('parent')) {
         $this->parent = NavigationItem::Schema()->ByID(Request::GetData('parent'));
     }
     $this->AddTypeField();
     $this->AddNameField();
     $this->AddPageItemSelector();
     //$this->AddPageField();
     //$this->AddParametersField();
     $this->AddUrlField();
     $this->AddSubmit();
     return parent::Init();
 }
 /**
  * 
  * Gets the top most navigation item
  * @return NavigationItem
  */
 public function TopMost()
 {
     $tblNavItem = NavigationItem::Schema()->Table();
     $sql = Access::SqlBuilder();
     $where = $sql->Equals($tblNavItem->Field('Navigation'), $sql->Value($this->navi->GetID()))->And_($sql->IsNull($tblNavItem->Field('Parent')))->And_($sql->IsNull($tblNavItem->Field('Previous')));
     return NavigationItem::Schema()->First($where);
 }
 protected function TableSchema()
 {
     return NavigationItem::Schema();
 }