コード例 #1
0
 private function _getACSPdfLinks($eContentItem, $eContentCheckout)
 {
     require_once ROOT_DIR . '/sys/AdobeContentServer.php';
     global $configArray;
     $links = array();
     //Download link
     $downloadLink = AdobeContentServer::mintDownloadLink($eContentItem, $eContentCheckout);
     $links[] = array('url' => $downloadLink, 'text' => 'Download');
     return $links;
 }
コード例 #2
0
 /**
  * @param String $itemId
  * @param String $fileName
  * @param String $acsId
  * @return array
  */
 function getActionsForItem($itemId, $fileName, $acsId)
 {
     $actions = array();
     if (!$this->isCheckedOut($itemId)) {
         //Get the number of current checkouts
         //TODO:
         if ($this->isItemAvailable($itemId, 1)) {
             $actions[] = array('url' => '', 'onclick' => "VuFind.LocalEContent.checkoutRestrictedEContent('{$this->getUniqueID()}', '{$itemId}')", 'title' => 'Check Out', 'requireLogin' => true, 'showInSummary' => true, 'showInFormats' => false);
         } else {
             $actions[] = array('url' => '', 'onclick' => "VuFind.LocalEContent.placeHoldOnRestrictedEContent('{$this->getUniqueID()}', '{$itemId}')", 'title' => 'Place Hold', 'requireLogin' => true, 'showInSummary' => true, 'showInFormats' => false);
         }
     } else {
         $actions['return'] = array('url' => '', 'onclick' => "return VuFind.LocalEContent.returnRestrictedEContent('{$this->getUniqueID()}', '{$itemId}')", 'title' => 'Return Now', 'requireLogin' => true, 'showInSummary' => true, 'showInFormats' => false);
         $fileExtension = '';
         if (strpos($fileName, '.') !== FALSE) {
             $fileExtension = substr($fileName, strrpos($fileName, '.') + 1);
         }
         global $configArray;
         //Add actions to read online, or fulfill hold in ACS server as appropriate
         if ($fileExtension == 'epub') {
             $actions[] = array('url' => $configArray['Site']['path'] . "/RestrictedEContent/{$this->getUniqueID()}/Viewer?itemId={$itemId}&file={$fileName}", 'onclick' => '', 'title' => 'Read Online', 'requireLogin' => true, 'showInSummary' => false, 'showInFormats' => true);
         }
         //Get the checkout for the current user
         $eContentCheckout = $this->getCurrentCheckout($itemId);
         require_once ROOT_DIR . '/sys/AdobeContentServer.php';
         $acsDownloadLink = AdobeContentServer::mintDownloadLink($acsId, $eContentCheckout);
         if ($acsDownloadLink) {
             $actions[] = array('url' => AdobeContentServer::mintDownloadLink($acsId, $eContentCheckout), 'onclick' => '', 'title' => 'Download', 'requireLogin' => true, 'showInSummary' => false, 'showInFormats' => true);
         }
     }
     return $actions;
 }