/** * 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); }
/** * 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); }
/** * 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); }
/** * 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; }
/** * 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); }
/** * 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; } }