/** * 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 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; }
/** * 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/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 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); } } }
/** * 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'> </div>"; $this->depth--; print $this->getTabs(); print "</div>"; $this->inHeaderOrFooter = false; } } } }
/** * 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;'> </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;'> </div>")); } } return $guiContainer; }