function GetSeriesTitles() { //Get other titles within a series for display within the title scroller require_once 'Enrichment.php'; $isbn = $_REQUEST['isbn']; $id = $_REQUEST['id']; $enrichmentData = Record_Enrichment::loadEnrichment($isbn); global $interface; $interface->assign('id', $id); $interface->assign('enrichment', $enrichmentData); }
function getEnrichmentData() { require_once ROOT_DIR . '/services/Record/Enrichment.php'; $record = $this->loadSolrRecord($_GET['id']); $isbn = isset($record['isbn']) ? ISBN::normalizeISBN($record['isbn'][0]) : null; //Need to trim the isbn to make sure there isn't descriptive text. $upc = isset($record['upc']) ? $record['upc'][0] : null; $enrichmentData = Record_Enrichment::loadEnrichment($isbn); //Load go deeper options require_once ROOT_DIR . '/Drivers/marmot_inc/GoDeeperData.php'; $goDeeperOptions = GoDeeperData::getGoDeeperOptions($isbn, $upc, false); return array('enrichment' => $enrichmentData, 'goDeeper' => $goDeeperOptions); }
function launch() { global $configArray; global $interface; global $user; //Enable and disable functionality based on library settings global $library; global $locationSingleton; $location = $locationSingleton->getActiveLocation(); if (isset($library)) { if ($location != null) { $interface->assign('showHoldButton', $location->showHoldButton == 1 && $library->showHoldButton == 1 ? 1 : 0); } else { $interface->assign('showHoldButton', $library->showHoldButton); } $interface->assign('showTagging', $library->showTagging); $interface->assign('showRatings', $library->showRatings); $interface->assign('showComments', $library->showComments); $interface->assign('showFavorites', $library->showFavorites); } else { if ($location != null) { $interface->assign('showHoldButton', $location->showHoldButton); } else { $interface->assign('showHoldButton', 1); } $interface->assign('showTagging', 1); $interface->assign('showRatings', 1); $interface->assign('showComments', 1); $interface->assign('showFavorites', 1); } //Build the actual view $interface->setTemplate('view-series.tpl'); require_once 'Enrichment.php'; $enrichment = new Record_Enrichment(); $enrichmentData = $enrichment->loadEnrichment($this->isbn); //Loading the series title is not reliable. Do not try to load it. $seriesTitle = ''; $seriesAuthors = array(); $seriesTitles = array(); $resourceList = array(); if (isset($enrichmentData['novelist'])) { $seriesTitles = $enrichmentData['novelist']['series']; if (isset($seriesTitles) && is_array($seriesTitles)) { foreach ($seriesTitles as $key => $title) { if (isset($title['series']) && strlen($title['series']) > 0 && !isset($seriesTitle)) { $seriesTitle = $title['series']; $interface->assign('seriesTitle', $seriesTitle); } if (isset($title['author'])) { $seriesAuthors[$title['author']] = $title['author']; } if ($title['libraryOwned']) { $record = RecordDriverFactory::initRecordDriver($title); $resourceList[] = $interface->fetch($record->getSearchResult($user, null, false)); } else { $interface->assign('record', $title); $resourceList[] = $interface->fetch('RecordDrivers/Index/nonowned_result.tpl'); } } } } $interface->assign('seriesAuthors', $seriesAuthors); $interface->assign('recordSet', $seriesTitles); $interface->assign('resourceList', $resourceList); $interface->assign('recordStart', 1); $interface->assign('recordEnd', count($seriesTitles)); $interface->assign('recordCount', count($seriesTitles)); $interface->setPageTitle($seriesTitle); // Display Page $interface->display('layout.tpl'); }