예제 #1
0
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 6/6/08
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     return $siteComponent->getParentComponent()->acceptVisitor($this);
 }
 /**
  * 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);
 }
예제 #3
0
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     foreach ($siteComponent->getSortedSubcomponents() as $child) {
         if (is_object($child)) {
             $child->acceptVisitor($this);
         }
     }
 }
예제 #4
0
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/5/08
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $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);
         }
     }
 }
예제 #5
0
 /**
  * Visit a flow organizer
  * 
  * @param object FlowOrganizerSiteComponent
  * @return boolean
  * @access public
  * @since 5/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $organizer)
 {
     $parent = $organizer->getParentComponent();
     return $parent->acceptVisitor($this);
 }
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 6/11/08
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     $numCells = $siteComponent->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $siteComponent->getSubcomponentForCell($i);
         $child->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);
     }
 }
 /**
  * Visit a menu organizer and return the menu GUI component that corresponds
  * to it.
  * 
  * @param object MenuOrganizerSiteComponent
  * @return object Component
  * @access public
  * @since 1/15/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $organizer)
 {
     $numCells = $organizer->getTotalNumberOfCells();
     if ($organizer->getNumRows() == 0) {
         $cellsPerPage = $numCells + 1;
     } else {
         $cellsPerPage = $organizer->getNumColumns() * $organizer->getNumRows();
     }
     $childGuiComponents = array();
     $i = 0;
     foreach ($organizer->getSortedSubcomponents() as $child) {
         if ($child) {
             $childGuiComponent = $child->acceptVisitor($this);
             // Filter out false entries returned due to lack of authorization
             if ($childGuiComponent) {
                 $childGuiComponents[] = $this->addFlowChildWrapper($organizer, $i, $childGuiComponent);
             }
         }
         $i++;
     }
     // Add the "Append" form to the organizer
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.add_children"), $organizer->getQualifierId())) {
         $pluginManager = Services::getService("PluginManager");
         $formHtml = "\n\t<div class='ui2_add_form_wrapper'>";
         $formHtml .= $this->getAddFormHTML($organizer->getId(), null, $pluginManager->getEnabledPlugins());
         // Move/Copy from selection
         $formHtml .= "\n\t | " . Segue_Selection::instance()->getMoveCopyLink($organizer);
         $formHtml .= "\n\t</div>";
         $form = $this->addFlowChildWrapper($organizer, $i, new UnstyledBlock($formHtml));
         // Add the form to the beginning of the list for custom ordering or recent last
         if (in_array($organizer->sortMethod(), array('custom', 'create_date_asc', 'mod_date_asc'))) {
             $childGuiComponents[] = $form;
         } else {
             array_unshift($childGuiComponents, $form);
         }
     }
     if (count($childGuiComponents)) {
         $resultPrinter = new ArrayResultPrinter($childGuiComponents, $organizer->getNumColumns(), $cellsPerPage);
         $resultPrinter->setRenderDirection($organizer->getDirection());
         $resultPrinter->setNamespace('pages_' . $organizer->getId());
         $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
         $guiContainer = $resultPrinter->getLayout();
     } else {
         return null;
     }
     // Add controls bar and border
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $organizer->getQualifierId())) {
         $controlsHTML = $this->getBarPreHTML('#00F', $organizer) . $this->getControlsHTML($organizer, "<em>" . $this->_classNames['FlowOrganizer'] . "</em>", $organizer->acceptVisitor($this->_controlsVisitor), '#00F', '#99F', '#66F');
         $guiContainer->setPreHTML($controlsHTML . "\n<div style='z-index: 0;'>" . $guiContainer->getPreHTML($null = null));
         $guiContainer->setPostHTML($guiContainer->getPostHTML($null = null) . "</div>" . $this->getBarPostHTML());
     }
     return $guiContainer;
 }
 /**
  * Visit a Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $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 Flow/Content Organizer
  * 
  * @param object FlowOrganizerSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitFlowOrganizer(FlowOrganizerSiteComponent $siteComponent)
 {
     $num = 0;
     for ($i = 0; $i < $siteComponent->getTotalNumberOfCells(); $i++) {
         $child = $siteComponent->getSubComponentForCell($i);
         if ($child) {
             $num += $child->acceptVisitor($this);
         }
     }
     return $num;
 }
예제 #11
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();
 }
예제 #12
0
 /**
  * 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);
 }
예제 #14
0
 /**
  * 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;
     }
 }