/**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     $parent = $siteComponent->getParentComponent();
     if (!$parent) {
         throw new OperationFailedException("No parent for " . $siteComponent->getId());
     }
     return $parent->acceptVisitor($this);
 }
 /**
  * Visit a flow organizer and return the resultant GUI component [a container].
  * 
  * @param object FlowOrganizerSiteComponent
  * @return object Component
  * @access public
  * @since 5/18/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $organizer)
 {
     if ($organizer->getId() == $this->_flowOrgId) {
         return $this->visitTargetBlock();
     } else {
         return parent::visitFlowOrganizer($organizer);
     }
 }
예제 #3
0
 /**
  * Answer a link to move/copy items from the selection into an organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return string
  * @access public
  * @since 8/4/08
  */
 public function getMoveCopyLink(FlowOrganizerSiteComponent $siteComponent)
 {
     $this->addHeadJavascript();
     $ancestorIds = "[";
     $parent = $siteComponent->getParentComponent();
     while ($parent) {
         $ancestorIds .= "'" . $parent->getId() . "'";
         $parent = $parent->getParentComponent();
         if ($parent) {
             $ancestorIds .= ", ";
         }
     }
     $ancestorIds .= "]";
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("selection");
     ob_start();
     print "<a ";
     print " style='cursor: pointer;'";
     print " class='Selection_MoveCopy_Link' ";
     print " onclick=\"MoveCopyPanel.run('" . $siteComponent->getId() . "', '" . $siteComponent->getComponentClass() . "', " . $ancestorIds . ", this); return false;\"";
     print " title=\"" . _("Paste from your Selection") . "\"";
     print ">" . _('Paste');
     print "</a>";
     $harmoni->request->endNamespace();
     return ob_get_clean();
 }
 /**
  * Answer controls for FlowOrganizer SiteComponents
  * 
  * @param SiteComponent $siteComponent
  * @return string
  * @access public
  * @since 4/17/06
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     $harmoni = Harmoni::instance();
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $siteComponent->getQualifierId())) {
         $url = SiteDispatcher::quickURL('ui1', 'editFlowOrg', array('node' => $siteComponent->getId(), 'returnNode' => SiteDispatcher::getCurrentNodeId(), 'returnAction' => $this->action));
         ob_start();
         print "\n\t\t\t\t<div style='text-align: center;'>";
         print "\n\t\t\t\t\t<a href='" . $url . "'>";
         print _("[ display options ]");
         print "</a>";
         print "\n\t\t\t\t</div>";
         $controls = ob_get_clean();
     } else {
         $controls = '';
     }
     return $controls;
 }
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     $element = $this->getElementForNewId($siteComponent->getId());
     $this->applyCommonProperties($siteComponent, $element);
     $this->applyOrganizerProperties($siteComponent, $element);
     if ($element->hasAttribute('overflowStyle')) {
         $siteComponent->updateOverflowStyle($element->getAttribute('overflowStyle'));
     }
     $this->importOrganizerChildren($siteComponent, $element);
 }
 /**
  * Visit a flow organizer and return the resultant GUI component [a container].
  * 
  * @param object FlowOrganizerSiteComponent
  * @return object Component
  * @access public
  * @since 4/3/06
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $organizer)
 {
     $numCells = $organizer->getTotalNumberOfCells();
     if ($organizer->getNumRows() == 0) {
         $cellsPerPage = $numCells;
     } else {
         $cellsPerPage = $organizer->getNumColumns() * $organizer->getNumRows();
     }
     $childGuiComponents = array();
     foreach ($organizer->getSortedSubcomponents() as $child) {
         if ($child) {
             $childGuiComponent = $child->acceptVisitor($this);
             // Filter out false entries returned due to lack of authorization
             if ($childGuiComponent) {
                 $childGuiComponents[] = $childGuiComponent;
             }
         }
     }
     if (count($childGuiComponents)) {
         $resultPrinter = new ArrayResultPrinter($childGuiComponents, $organizer->getNumColumns(), $cellsPerPage);
         $resultPrinter->setRenderDirection($organizer->getDirection());
         $resultPrinter->setNamespace('pages_' . $organizer->getId());
         $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
         return $resultPrinter->getLayout();
     } else {
         return null;
     }
 }