/**
  * 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);
 }
Example #2
0
function printAssetShort($asset, $harmoni)
{
    ob_start();
    $assetId = $asset->getId();
    print "\n\t<div style='font-weight: bold' title='" . _("ID#") . ": " . $assetId->getIdString() . "'>" . $asset->getDisplayName() . "</div>";
    $description = HtmlString::withValue($asset->getDescription());
    $description->trim(100);
    print "\n\t<div style='font-size: smaller;'>" . $description->asString() . "</div>";
    ExhibitionPrinter::printFunctionLinks($asset);
    $thumbnailURL = RepositoryInputOutputModuleManager::getThumbnailUrlForAsset($assetId);
    if ($thumbnailURL !== FALSE) {
        print "\n\t<br /><a href='";
        print $harmoni->request->quickURL("asset", "view", array('asset_id' => $assetId->getIdString()));
        print "'>";
        print "\n\t\t<img src='{$thumbnailURL}' alt='Thumbnail Image' class='thumbnail_image' />";
        print "\n\t</a>";
    }
    $layout = new Block(ob_get_contents(), EMPHASIZED_BLOCK);
    ob_end_clean();
    return $layout;
}