/**
  * Visit a Navigation Block
  * 
  * @param object NavBlockSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 6/11/08
  */
 public function visitNavBlock(NavBlockSiteComponent $siteComponent)
 {
     $orig = $siteComponent->getDisplayName();
     $new = $this->replacePlaceholders($orig);
     if ($orig != $new) {
         $siteComponent->updateDisplayName($new);
     }
     $orig = $siteComponent->getDescription();
     $new = $this->replacePlaceholders($orig);
     if ($orig != $new) {
         $siteComponent->updateDescription($new);
     }
     // Traverse down
     $childOrganizer = $siteComponent->getOrganizer();
     $childOrganizer->acceptVisitor($this);
     $nestedMenuOrganizer = $siteComponent->getNestedMenuOrganizer();
     if (!is_null($nestedMenuOrganizer)) {
         $nestedMenuOrganizer->acceptVisitor($this);
     }
 }
 /**
  * Visit a block and return the resulting GUI component.
  * 
  * @param object NavBlockSiteComponent $navBlock
  * @return ref array
  * @access public
  * @since 4/3/06
  */
 public function visitNavBlock(NavBlockSiteComponent $navBlock)
 {
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     // Since view AZs cascade up, just check at the node.
     if (!$authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.view"), $idManager->getId($navBlock->getId()))) {
         return false;
     }
     $menuItems = array();
     // Create the menu item
     $title = $navBlock->getTitleMarkup();
     if (!$title) {
         $title = _("Untitled");
     }
     $menuItems[] = new MenuItemLinkWithAdditionalHtml($title, $this->getUrlForComponent($navBlock->getId()), $navBlock->isActive(), 1, null, null, $navBlock->getDescription(), $this->getAdditionalNavHTML($navBlock));
     // Traverse our child organizer, and place it in the _missingTargets array
     // if our target is not available.
     if ($navBlock->isActive()) {
         $childOrganizer = $navBlock->getOrganizer();
         $childGuiComponent = $childOrganizer->acceptVisitor($this);
         if (isset($this->_emptyCellContainers[$navBlock->getTargetId()])) {
             $this->_emptyCellContainers[$navBlock->getTargetId()]->insertAtPlaceholder($this->_emptyCellPlaceholders[$navBlock->getTargetId()], $childGuiComponent, $childOrganizer->getWidth(), '100%', null, TOP);
             unset($this->_emptyCellContainers[$navBlock->getTargetId()], $this->_emptyCellPlaceholders[$navBlock->getTargetId()]);
         } else {
             $this->_missingTargets[$navBlock->getTargetId()] = $childGuiComponent;
             $this->_missingTargetWidths[$navBlock->getTargetId()] = $childOrganizer->getWidth();
         }
         $nestedMenuOrganizer = $navBlock->getNestedMenuOrganizer();
         if (!is_null($nestedMenuOrganizer)) {
             $this->_menuNestingLevel++;
             $menuItems[] = $nestedMenuOrganizer->acceptVisitor($this);
         } else {
             $this->_menuNestingLevel = 0;
         }
     }
     // return the menu items
     return $menuItems;
 }