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