示例#1
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     ob_start();
     CollectionsPrinter::printFunctionLinks();
     $layout = new Block(ob_get_contents(), STANDARD_BLOCK);
     ob_end_clean();
     $actionRows->add($layout, null, null, CENTER, CENTER);
     $type = HarmoniType::fromString(urldecode(RequestContext::value('type')));
     $repositoryManager = Services::getService("Repository");
     // Get the Repositories
     $allRepositories = $repositoryManager->getRepositoriesByType($type);
     // put the repositories into an array and order them.
     // @todo, do authorization checking
     $repositoryArray = array();
     while ($allRepositories->hasNext()) {
         $repository = $allRepositories->next();
         $repositoryArray[$repository->getDisplayName()] = $repository;
     }
     ksort($repositoryArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($repositoryArray, 2, 20, "printrepositoryShort", $harmoni);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, null, null, CENTER, CENTER);
 }
示例#2
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     ob_start();
     CollectionsPrinter::printFunctionLinks();
     print "<p>";
     print _("Below are listed the available <em>Collections</em>, organized by type, then name.");
     print "</p>\n<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, CENTER, CENTER);
     ob_end_clean();
     $exhibitionRepositoryType = new Type('System Repositories', 'edu.middlebury.concerto', 'Exhibitions');
     $repositoryManager = Services::getService("Repository");
     // Get all the types
     $types = $repositoryManager->getRepositoryTypes();
     // put the drs into an array and order them.
     $typeArray = array();
     while ($types->hasNext()) {
         $type = $types->next();
         // include all but Exhibitions repository.
         if (!$exhibitionRepositoryType->isEqual($type)) {
             $typeArray[HarmoniType::typeToString($type)] = $type;
         }
     }
     ksort($typeArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($typeArray, 2, 20, "printTypeShort");
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, null, null, CENTER, CENTER);
 }
示例#3
0
 /**
  * Execute
  * 
  * @return null
  * @access public
  * @since 5/7/08
  */
 public function buildContent()
 {
     $rows = $this->getActionRows();
     $rows->add(new Heading(_("Themes"), 1));
     $guiMgr = Services::getService('GUIManager');
     if (!method_exists($guiMgr, 'getThemeSources')) {
         throw new Exception('This action only works with Gui2.');
     }
     $themes = $guiMgr->getThemes();
     $resultPrinter = new ArrayResultPrinter($themes, 1, 10, array($this, 'getThemeListing'));
     $rows->add($resultPrinter->getLayout());
 }
示例#4
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     // Get the Repository
     $repositoryManager = Services::getService("Repository");
     $idManager = Services::getService("Id");
     // get the search type.
     $searchType = HarmoniType::fromString(urldecode($harmoni->request->get('search_type')));
     // Get the Search criteria
     $searchModules = Services::getService("RepositorySearchModules");
     $searchCriteria = $searchModules->getSearchCriteria($repository, $searchType);
     ob_start();
     print "<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $introText = new Block(ob_get_contents(), 2);
     ob_end_clean();
     $actionRows->add($introText, "100%", null, CENTER, CENTER);
     //***********************************
     // Get the assets to display
     //***********************************
     $assetArray = array();
     // Go through all the repositories. if they support the searchType,
     // run the search on them.
     $repositories = $repositoryManager->getRepositories();
     while ($repositories->hasNext()) {
         $repository = $repositories->next();
         $assets = $repository->getAssetsBySearch($searchCriteria, $searchType, new HarmoniProperties(new Type('Repository', 'edu.middlebury', 'null')));
         // add the results to our total results
         while ($assets->hasNext()) {
             $assetArray[] = $assets->next();
         }
     }
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new ArrayResultPrinter($assetArray, 2, 6, "printAssetShort", $harmoni);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, null, null, CENTER, CENTER);
 }
 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $idManager = Services::getService("Id");
     $repositoryManager = Services::getService("Repository");
     $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.concerto.exhibition_repository"));
     $asset = $repository->getAsset($idManager->getId(RequestContext::value('exhibition_id')));
     // function links
     ob_start();
     ExhibitionPrinter::printFunctionLinks($asset);
     $actionRows->add(new Block(ob_get_clean(), STANDARD_BLOCK), null, null, CENTER, CENTER);
     /*********************************************************
      * Description
      *********************************************************/
     $description = HtmlString::withValue($asset->getDescription());
     $description->clean();
     if (strlen($description->asString())) {
         $actionRows->add(new Block($description->asString(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
     }
     //***********************************
     // Get the assets to display
     //***********************************
     $setManager = Services::getService("Sets");
     $exhibitionSet = $setManager->getPersistentSet($asset->getId());
     $slideshowIterator = $asset->getAssets();
     $orderedSlideshows = array();
     $unorderedSlideshows = array();
     while ($slideshowIterator->hasNext()) {
         $slideshowAsset = $slideshowIterator->next();
         $slideshowAssetId = $slideshowAsset->getId();
         if ($exhibitionSet->isInSet($slideshowAssetId)) {
             $orderedSlideshows[$exhibitionSet->getPosition($slideshowAssetId)] = $slideshowAsset;
         } else {
             $exhibitionSet->addItem($slideshowAssetId);
             $unorderedSlideshows[] = $slideshowAsset;
         }
     }
     ksort($orderedSlideshows);
     $assets = array_merge($orderedSlideshows, $unorderedSlideshows);
     unset($orderedSlideshows, $unorderedSlideshows);
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new ArrayResultPrinter($assets, 2, 6, "printAssetShort", $harmoni);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
 }
示例#6
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     ob_start();
     CollectionsPrinter::printFunctionLinks();
     print "<p>";
     print _("Below are listed the available <em>Collections</em>, organized by name.");
     print "</p>\n<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, CENTER, CENTER);
     ob_end_clean();
     // Get the Repositoriess
     $repositoryManager = Services::getService("Repository");
     $allRepositories = $repositoryManager->getRepositories();
     $exhibitionRepositoryType = new Type('System Repositories', 'edu.middlebury.concerto', 'Exhibitions');
     // put the drs into an array and order them.
     // @todo, do authorization checking
     $repositoryArray = array();
     $repositoryTitles = array();
     while ($allRepositories->hasNext()) {
         $repository = $allRepositories->next();
         // include all but Exhibitions repository.
         if (!$exhibitionRepositoryType->isEqual($repository->getType())) {
             $id = $repository->getId();
             $repositoryTitles[$id->getIdString()] = $repository->getDisplayName();
             $repositoryArray[$id->getIdString()] = $repository;
         }
     }
     array_multisort($repositoryTitles, SORT_ASC, SORT_STRING, $repositoryArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($repositoryArray, 1, 20, "printRepositoryShort", $harmoni);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout('canView');
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
 }
 /**
  * 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;
 }
示例#8
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $repository = $this->getRepository();
     // function links
     ob_start();
     print _("Collection") . ": ";
     RepositoryPrinter::printRepositoryFunctionLinks($harmoni, $repository);
     $layout = new Block(ob_get_contents(), 3);
     ob_end_clean();
     $actionRows->add($layout, "100%", null, LEFT, CENTER);
     $repositoryManager = Services::getService("Repository");
     // Get all the types
     $types = $repository->getAssetTypes();
     // put the drs into an array and order them.
     $typeArray = array();
     while ($types->hasNext()) {
         $type = $types->next();
         $typeArray[$type->getDomain() . " " . $type->getAuthority() . " " . $type->getKeyword()] = $type;
     }
     ksort($typeArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($typeArray, 2, 20, "printTypeShort", $repository->getId());
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
 }
示例#9
0
 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $this->init();
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $asset = $this->getAsset();
     $assetId = $asset->getId();
     // function links
     ob_start();
     AssetPrinter::printAssetFunctionLinks($harmoni, $asset);
     $actionRows->add(new Block(ob_get_clean(), STANDARD_BLOCK), null, null, CENTER, CENTER);
     ob_start();
     print "\n<table width='100%'>\n<tr><td style='text-align: left; vertical-align: top'>";
     print "\n\t<dl>";
     if ($asset->getDisplayName()) {
         print "\n\t\t<dt style='font-weight: bold;'>" . _("Title:") . "</dt>";
         print "\n\t\t<dd>" . $asset->getDisplayName() . "</dd>";
     }
     if ($asset->getDescription()) {
         $description = HtmlString::withValue($asset->getDescription());
         $description->clean();
         print "\n\t\t<dt style='font-weight: bold;'>" . _("Description:") . "</dt>";
         print "\n\t\t<dd>" . $description->asString() . "</dd>";
     }
     print "\n\t\t<dt style='font-weight: bold;'>";
     print _("ID#");
     print ":</dt>\n\t\t<dd >";
     print $assetId->getIdString();
     print "</dd>";
     print "\n\t\t<dt style='font-weight: bold;'>";
     print _("Type");
     print ":</dt>\n\t\t<dd >";
     print $asset->getAssetType()->asString();
     print "</dd>";
     $date = $asset->getModificationDate();
     print "\n\t\t<dt style='font-weight: bold;'>";
     print _("Modification Date");
     print ":</dt>\n\t\t<dd >";
     print $date->monthName() . " " . $date->dayOfMonth() . ", " . $date->year() . " " . $date->hmsString() . " " . $date->timeZoneAbbreviation();
     print "</dd>";
     $date = $asset->getCreationDate();
     print "\n\t\t<dt style='font-weight: bold;'>";
     print _("Creation Date");
     print ":</dt>\n\t\t<dd >";
     print $date->monthName() . " " . $date->dayOfMonth() . ", " . $date->year() . " " . $date->hmsString() . " " . $date->timeZoneAbbreviation();
     print "</dd>";
     if (is_object($asset->getEffectiveDate())) {
         $date = $asset->getEffectiveDate();
         print "\n\t\t<dt style='font-weight: bold;'>";
         print _("Effective Date");
         print ":</dt>\n\t\t<dd >";
         print $date->monthName() . " " . $date->dayOfMonth() . ", " . $date->year() . " " . $date->hmsString() . " " . $date->timeZoneAbbreviation();
         print "</dd>";
     }
     if (is_object($asset->getExpirationDate())) {
         $date = $asset->getExpirationDate();
         print "\n\t\t<dt style='font-weight: bold;'>";
         print _("Expiration Date");
         print ":</dt>\n\t\t<dd >";
         print $date->monthName() . " " . $date->dayOfMonth() . ", " . $date->year() . " " . $date->hmsString() . " " . $date->timeZoneAbbreviation();
         print "</dd>";
     }
     print "\n\t</dl>";
     print "\n</td><td style='text-align: right; vertical-align: top'>";
     $thumbnailURL = RepositoryInputOutputModuleManager::getThumbnailUrlForAsset($assetId);
     if ($thumbnailURL !== FALSE) {
         print "\n\t\t<img src='{$thumbnailURL}' alt='Thumbnail Image' align='right' class='thumbnail_image' style='margin-bottom: 5px;' />";
     }
     // Add the tagging manager script to the header
     $outputHandler = $harmoni->getOutputHandler();
     $outputHandler->setHead($outputHandler->getHead() . "\n\t\t<script type='text/javascript' src='" . POLYPHONY_PATH . "javascript/Tagger.js'></script>" . "\n\t\t<link rel='stylesheet' type='text/css' href='" . POLYPHONY_PATH . "javascript/Tagger.css' />");
     // Tags
     print "\n\t<div style='font-weight: bold; margin-bottom: 10px; text-align: left; clear: both;'>" . _("Tags given to this Asset: ") . "</div>";
     print "\n\t<div style=' text-align: justify;'>";
     print TagAction::getTagCloudForItem(TaggedItem::forId($assetId, 'concerto'), 'view');
     print "\n\t</div>";
     print "\n</td></tr></table>";
     // 		print "\n\t<hr/>";
     $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
     ob_end_clean();
     $searchBar = new Container(new YLayout(), BLOCK, STANDARD_BLOCK);
     $actionRows->add($searchBar, "100%", null, CENTER, CENTER);
     //***********************************
     // Get the assets to display
     //***********************************
     $assets = $asset->getAssets();
     $tmpAssets = array();
     while ($assets->hasNext()) {
         $asset = $assets->next();
         switch ($_SESSION["asset_order"]) {
             case 'DisplayName':
                 $assetKey = $asset->getDisplayName();
                 break;
             case 'Id':
                 $id = $asset->getId();
                 $assetKey = $id->getIdString();
                 break;
             case 'ModificationDate':
                 $date = $asset->getModificationDate();
                 $assetKey = $date->asString();
                 break;
             case 'CreationDate':
                 $date = $asset->getCreationDate();
                 $assetKey = $date->asString();
                 break;
             default:
                 $assetKey = '0';
         }
         $i = 0;
         while (isset($tmpAssets[$assetKey . "_" . $i])) {
             $i++;
         }
         $tmpAssets[$assetKey . "_" . $i] = $asset;
     }
     if ($_SESSION["asset_order_direction"] == 'ASC') {
         ksort($tmpAssets);
     } else {
         krsort($tmpAssets);
     }
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new ArrayResultPrinter($tmpAssets, $_SESSION["asset_columns"], $_SESSION["assets_per_page"], array($this, "printAssetShort"), $this->getParams());
     $resultPrinter->setStartingNumber($this->_state['startingNumber']);
     $resultLayout = $resultPrinter->getLayout(array($this, "canView"));
     $resultLayout->setPreHTML("<form id='AssetMultiEditForm' name='AssetMultiEditForm' action='' method='post'>");
     $resultLayout->setPostHTML("</form>");
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
     /*********************************************************
      * Display options
      *********************************************************/
     $currentUrl = $harmoni->request->mkURL();
     $searchBar->setPreHTML("\n<form action='" . $currentUrl->write() . "' method='post'>\n\t<input type='hidden' name='" . RequestContext::name('form_submitted') . "' value='true'/>");
     $searchBar->setPostHTML("\n</form>");
     ob_start();
     print "\n\t<strong>" . _("Child Assets") . ":</strong>";
     $searchBar->add(new UnstyledBlock(ob_get_clean()), null, null, LEFT, TOP);
     $searchBar->add($this->getDisplayOptions($resultPrinter), null, null, LEFT, TOP);
 }
示例#10
0
 /**
  * Execute this action
  * 
  * @return mixed
  * @access public
  * @since 4/1/08
  */
 public function buildContent()
 {
     $actionRows = $this->getActionRows();
     $portalWrapper = $actionRows->add(new Container(new XLayout(), BLANK, 1), "100%", null, CENTER, TOP);
     // Store the login state for determining whether or not to show edit links.
     $authN = Services::getService("AuthN");
     $this->isAuthenticated = $authN->isUserAuthenticatedWithAnyType();
     $this->addHeadJs();
     // Add the selection Panel
     Segue_Selection::instance()->addHeadJavascript();
     $harmoni = Harmoni::instance();
     $harmoni->attachData('help_topic', 'Portal');
     // Categories
     ob_start();
     $portalMgr = PortalManager::instance();
     print "\n<ul class='portal_categories'>";
     foreach ($portalMgr->getCategories() as $category) {
         print "\n\t<li class='portal_category'>";
         print "\n\t\t<div class='title'>" . $category->getDisplayName() . "</div>";
         if (strlen($category->getDescription())) {
             print "\n\t\t<div class='description'>" . $category->getDescription() . "</div>";
         }
         print "\n\t\t<ul class='portal_folders'>";
         foreach ($category->getFolders() as $folder) {
             print "\n\t\t\t<li class='portal_folder";
             if ($folder->getIdString() == $this->getCurrentFolderId()) {
                 print " current";
             }
             print "'>";
             print "\n\t\t\t\t<div class='title'>";
             print "<a href='";
             print $harmoni->request->quickURL($harmoni->request->getRequestedModule(), $harmoni->request->getRequestedAction(), array('folder' => $folder->getIdString()));
             print "'>";
             print $folder->getDisplayName();
             print "</a></div>";
             if (strlen($folder->getDescription())) {
                 print "\n\t\t\t\t<div class='description'>" . $folder->getDescription() . "</div>";
             }
             print "\n\t\t\t</li>";
         }
         print "\n\t\t</ul>";
         print "\n\t</li>";
     }
     print "\n</ul>";
     $portalWrapper->add(new Block(ob_get_clean(), STANDARD_BLOCK), "175px", null, CENTER, TOP);
     /*********************************************************
      * Sites in the current folder.
      *********************************************************/
     $siteList = $portalWrapper->add(new Container(new YLayout(), BLANK, 1), null, null, CENTER, TOP);
     $currentFolder = $portalMgr->getFolder($this->getCurrentFolderId());
     // controls
     $controls = $currentFolder->getControlsHtml();
     if (strlen($controls)) {
         $siteList->add(new Heading($controls, 3));
     }
     // Sites
     $slots = $currentFolder->getSlots();
     $resultPrinter = new ArrayResultPrinter($slots, 1, 20, array($this, "printSlot"));
     if ($currentFolder->slotsAreFilteredByAuthorization()) {
         $resultLayout = $resultPrinter->getLayout();
     } else {
         $resultLayout = $resultPrinter->getLayout(array($this, "canView"));
     }
     if ($resultPrinter->getNumItemsPrinted()) {
         $siteList->add($resultLayout, "100%", null, LEFT, CENTER);
     } else {
         $siteList->add(new Block(_('No items to display.'), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
     }
 }
示例#11
0
 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $this->registerDisplayProperties();
     $this->registerState();
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $harmoni->request->passthrough("collection_id");
     $harmoni->request->passthrough("asset_id");
     $asset = $this->getAsset();
     $assetId = $asset->getId();
     // function links
     ob_start();
     SlideShowPrinter::printFunctionLinks($asset);
     $actionRows->add(new Block(ob_get_clean(), STANDARD_BLOCK), null, null, CENTER, CENTER);
     ob_start();
     $description = HtmlString::withValue($asset->getDescription());
     $description->clean();
     print "\n\t<div style='font-size: smaller;'>" . $description->asString() . "</div>";
     $actionRows->add(new Block(ob_get_clean(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
     $searchBar = new Container(new YLayout(), BLOCK, STANDARD_BLOCK);
     $actionRows->add($searchBar, "100%", null, CENTER, CENTER);
     //***********************************
     // Get the assets to display
     //***********************************
     $setManager = Services::getService("Sets");
     $slideshowSet = $setManager->getPersistentSet($asset->getId());
     $slideIterator = $asset->getAssets();
     $orderedSlides = array();
     $unorderedSlides = array();
     while ($slideIterator->hasNext()) {
         $slideAsset = $slideIterator->next();
         $slideAssetId = $slideAsset->getId();
         if ($slideshowSet->isInSet($slideAssetId)) {
             $orderedSlides[$slideshowSet->getPosition($slideAssetId)] = $slideAsset;
         } else {
             $unorderedSlides[] = $slideAsset;
         }
     }
     ksort($orderedSlides);
     $slides = array_merge($orderedSlides, $unorderedSlides);
     unset($orderedSlides, $unorderedSlides);
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new ArrayResultPrinter($slides, $_SESSION["asset_columns"], $_SESSION["assets_per_page"], "printSlideShort", $this->getParams(), $assetId->getIdString());
     $resultPrinter->setStartingNumber($this->_state['startingNumber']);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout("canView");
     $resultLayout->setPreHTML("<form id='AssetMultiEditForm' name='AssetMultiEditForm' action='' method='post'>");
     $resultLayout->setPostHTML("</form>");
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
     /*********************************************************
      * Display options
      *********************************************************/
     $currentUrl = $harmoni->request->mkURL();
     $searchBar->setPreHTML("\n<form action='" . $currentUrl->write() . "' method='post'>\n\t<input type='hidden' name='" . RequestContext::name('form_submitted') . "' value='true'/>");
     $searchBar->setPostHTML("\n</form");
     ob_start();
     $searchBar->add(new UnstyledBlock(ob_get_clean()), null, null, LEFT, TOP);
     $searchBar->add($this->getDisplayOptions($resultPrinter, false), null, null, LEFT, TOP);
 }
 /**
  * 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;
     }
 }