/**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $numCells = $siteComponent->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $siteComponent->getSubcomponentForCell($i);
         if (is_object($child)) {
             $result = $child->acceptVisitor($this);
             if ($result) {
                 return $result;
             }
         }
     }
     return false;
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $num = 1;
     for ($i = 0; $i < $siteComponent->getTotalNumberOfCells(); $i++) {
         $child = $siteComponent->getSubComponentForCell($i);
         if ($child) {
             $num += $child->acceptVisitor($this);
         }
     }
     return $num;
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 6/6/08
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     return $siteComponent->getParentComponent()->acceptVisitor($this);
 }
 /**
  * Visit a fixed organizer and return the GUI component [a container] 
  * that corresponds to it. Traverse-to/add child components.
  * 
  * @param object FixedOrganizerSiteComponent $organizer
  * @return object Component
  * @access public
  * @since 4/3/06
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $organizer->getQualifierId())) {
         $tdStyles = 'border: 1px solid #F00; padding: 6px;';
     } else {
         $tdStyles = '';
     }
     $guiContainer = new Container(new TableLayout($organizer->getNumColumns(), $tdStyles), BLANK, 1);
     // Add controls bar and border
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.add_children"), $organizer->getQualifierId())) {
         $canAdd = true;
     } else {
         $canAdd = false;
     }
     $numCells = $organizer->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $organizer->getSubcomponentForCell($i);
         if (is_object($child)) {
             $childComponent = $child->acceptVisitor($this);
             if ($childComponent) {
                 $guiContainer->add($childComponent, $child->getWidth(), null, null, TOP);
             } else {
                 $childComponent = $guiContainer->add(new Blank(), $child->getWidth(), null, null, TOP);
             }
         } else {
             $this->_emptyCellContainers[$organizer->getId() . '_cell:' . $i] = $guiContainer;
             $this->_emptyCellPlaceholders[$organizer->getId() . '_cell:' . $i] = $guiContainer->addPlaceholder();
             $childComponent = $guiContainer->getComponent($this->_emptyCellPlaceholders[$organizer->getId() . '_cell:' . $i]);
         }
         if ($canAdd) {
             $this->wrapAsDroppable($childComponent, $organizer->getId() . "_cell:" . $i, array_keys($organizer->getVisibleComponentsForPossibleAdditionToCell($i)));
         }
     }
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $organizer->getQualifierId())) {
         $controlsHTML = $this->getBarPreHTML('#F00', $organizer, '1px') . $this->getControlsHTML($organizer, $organizer->getDisplayName(), $organizer->acceptVisitor($this->_controlsVisitor), '#F00', '#F99', '#F66', 0, '1px');
         $guiContainer->setPreHTML($controlsHTML . "\n<div style='z-index: 0;'>" . $guiContainer->getPreHTML($null = null));
         $guiContainer->setPostHTML($guiContainer->getPostHTML($null = null) . "</div>" . $this->getBarPostHTML());
         if (count($organizer->getVisibleDestinationsForPossibleAddition())) {
             $this->wrapAsDraggable($guiContainer, $organizer->getId(), 'FixedOrganizer');
         }
     }
     return $guiContainer;
 }
Beispiel #5
0
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $numCells = $siteComponent->getTotalNumberOfCells();
     $rootSiteComponent = SiteDispatcher::getCurrentRootNode();
     $isHeaderFooterVisitor = new IsHeaderFooterSiteVisitor();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $siteComponent->getSubcomponentForCell($i);
         if (is_object($child)) {
             // don't include in feed if header and footer blocks
             if (!$child->acceptVisitor($isHeaderFooterVisitor)) {
                 $child->acceptVisitor($this);
             }
         }
     }
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $parent = $siteComponent->getParentComponent();
     if (!$parent) {
         throw new OperationFailedException("No parent for " . $siteComponent->getId());
     }
     return $parent->acceptVisitor($this);
 }
 /**
  * Visit a fixed organizer
  *
  * @param object FixedOrganizerSiteComponent $organizer
  * @return boolean
  * @access public
  * @since 5/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $parent = $organizer->getParentComponent();
     return $parent->acceptVisitor($this);
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/5/08
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     if (!$this->firstSeen) {
         $this->firstSeen = true;
     }
     $numCells = $siteComponent->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $siteComponent->getSubcomponentForCell($i);
         if (is_object($child)) {
             $child->acceptVisitor($this);
         }
     }
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     if ($siteComponent->acceptVisitor($this->hasMenuBelowVisitor)) {
         return false;
     } else {
         if ($this->isChildOfSiteNavOrg($siteComponent) && $siteComponent->getParentComponent()->acceptVisitor($this->hasMenuBelowVisitor)) {
             return true;
         } else {
             return $siteComponent->getParentComponent()->acceptVisitor($this);
         }
     }
 }
 /**
  * Visit a fixed organizer and return the GUI component [a container] 
  * that corresponds to it. Traverse-to/add child components.
  * 
  * @param object FixedOrganizerSiteComponent $organizer
  * @return object Component
  * @access public
  * @since 4/3/06
  */
 function visitFixedOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $numCells = $organizer->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $organizer->getSubcomponentForCell($i);
         if (is_object($child)) {
             $child->acceptVisitor($this);
         }
     }
 }
Beispiel #11
0
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $numCells = $siteComponent->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $siteComponent->getSubcomponentForCell($i);
         if (is_object($child)) {
             $isHeaderOrFooter = false;
             if (!$this->inHeaderOrFooter && $child->acceptVisitor($this->isHeaderFooterVisitor)) {
                 $isHeaderOrFooter = true;
                 print $this->getTabs();
                 print "<div class='header_area'>" . _("The following are header or footer items:");
                 $this->depth++;
                 $this->inHeaderOrFooter = true;
             }
             $child->acceptVisitor($this);
             if ($isHeaderOrFooter) {
                 // Spacer
                 print $this->getTabs();
                 print "<div class='header_spacer'>&nbsp;</div>";
                 $this->depth--;
                 print $this->getTabs();
                 print "</div>";
                 $this->inHeaderOrFooter = false;
             }
         }
     }
 }
 /**
  * Visit a Fixed Organizer
  * 
  * @param object FixedOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $siteComponent)
 {
     $element = $this->getElementForNewId($siteComponent->getId());
     $this->applyCommonProperties($siteComponent, $element);
     $this->applyOrganizerProperties($siteComponent, $element);
     $this->importOrganizerChildren($siteComponent, $element);
 }
 /**
  * Visit a fixed organizer and return the GUI component [a container] 
  * that corresponds to it. Traverse-to/add child components.
  * 
  * @param object FixedOrganizerSiteComponent $organizer
  * @return object Component
  * @access public
  * @since 4/3/06
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $guiContainer = new Container(new TableLayout($organizer->getNumColumns()), BLANK, 1);
     $numCells = $organizer->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $organizer->getSubcomponentForCell($i);
         if (is_object($child)) {
             $childComponent = $child->acceptVisitor($this);
             if ($childComponent) {
                 $guiContainer->add($childComponent, $child->getWidth(), null, null, TOP);
             } else {
                 $guiContainer->add(new UnstyledBlock("<div style='height: 0px;'> &nbsp; </div>"), null, "0px", null, TOP);
             }
         } else {
             $this->_emptyCellContainers[$organizer->getId() . '_cell:' . $i] = $guiContainer;
             $this->_emptyCellPlaceholders[$organizer->getId() . '_cell:' . $i] = $guiContainer->addPlaceholder(new UnstyledBlock("<div style='height: 0px;'> &nbsp; </div>"));
         }
     }
     return $guiContainer;
 }
 /**
  * Set the organizer for this NavBlock
  * 
  * @param object Organizer $organizer
  * @return voiid
  * @access public
  * @since 3/31/06
  */
 public function setOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $orgElement = $organizer->getElement();
     $child = $this->_element->firstChild;
     while ($child) {
         if ($child->nodeName == 'NavOrganizer') {
             $this->_element->replaceChild($orgElement, $child);
             return;
         }
         $child = $child->nextSibling;
     }
     // organizer not found... create it
     $this->_element->appendChild($orgElement);
     $this->_saveXml();
 }