diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/Record.php b/module/VuFind/src/VuFind/Theme/Root/Helper/Record.php index 5009d19f98cb55f4e4633a0a31a58a22e3b448ba..e8a77658be499ce8c62ed374dea6fc64fe83d4b1 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/Record.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/Record.php @@ -120,6 +120,16 @@ class Record extends AbstractHelper return $this->renderTemplate('core.phtml'); } + /** + * Render the core metadata area of the collection view. + * + * @return string + */ + public function getCollectionMetadata() + { + return $this->renderTemplate('collection-info.phtml'); + } + /** * Export the record in the requested format. For legal values, see * getExportFormats(). diff --git a/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml b/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml new file mode 100644 index 0000000000000000000000000000000000000000..85b7e560e83d78c198eef8ce76830b51148030e9 --- /dev/null +++ b/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml @@ -0,0 +1,189 @@ +<? /* Display thumbnail if appropriate: */ ?> +<? $mediumThumb = $this->record($this->driver)->getThumbnail('medium'); $largeThumb = $this->record($this->driver)->getThumbnail('large'); ?> +<? if ($mediumThumb): ?> + <div class="floatright"> + <? if ($largeThumb): ?><a href="<?=$this->escapeHtml($largeThumb)?>"><? endif; ?> + <img alt="<?=$this->transEsc('Cover Image')?>" class="recordcover" src="<?=$this->escapeHtml($mediumThumb);?>"/> + <? if ($largeThumb): ?></a><? endif; ?> + </div> +<? endif; ?> +<h1><?=$this->escapeHtml($this->driver->getShortTitle())?></h1> +<? $summ = $this->driver->getSummary(); if (!empty($summ)): ?> + <p><?=$this->escapeHtml($summ[0])?></p> +<? endif; ?> +<div id="collectionInfo" class="collectionInfo"> +<table cellpadding="2" cellspacing="0" border="0" class="citation" summary="{translate text='Bibliographic Details'}"> + <? $authors = $this->driver->getDeduplicatedAuthors(); ?> + <? if (isset($authors['main']) && !empty($authors['main'])): ?> + <tr valign="top"> + <th><?=$this->transEsc('Main Author')?>: </th> + <td><a href="<?=$this->record($this->driver)->getLink('author', $authors['main'])?>"><?=$this->escapeHtml($authors['main'])?></a></td> + </tr> + <? endif; ?> + + <? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?> + <tr valign="top"> + <th><?=$this->transEsc('Corporate Author')?>: </th> + <td><a href="<?=$this->record($this->driver)->getLink('author', $authors['corporate'])?>"><?=$this->escapeHtml($authors['corporate'])?></a></td> + </tr> + <? endif; ?> + + <? if (isset($authors['secondary']) && !empty($authors['secondary'])): ?> + <tr valign="top"> + <th><?=$this->transEsc('Other Authors')?>: </th> + <td> + <? $i = 0; foreach ($authors['secondary'] as $field): ?><?=($i++ == 0)?'':', '?><a href="<?=$this->record($this->driver)->getLink('author', $field)?>"><?=$this->escapeHtml($field)?></a><? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if (count($summ) > 1): ?> + <tr valign="top"> + <th><?=$this->transEsc('Summary')?>: </th> + <td> + <? foreach (array_slice($summ, 1) as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Format')?>: </th> + <td><?=$this->record($this->driver)->getFormatList()?></td> + </tr> + <? endif; ?> + + <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Language')?>: </th> + <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td> + </tr> + <? endif; ?> + + <? $publications = $this->driver->getPublicationDetails(); if (!empty($publications)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Published')?>: </th> + <td> + <? foreach ($publications as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Edition')?>: </th> + <td><?=$this->escapeHtml($edition)?></td> + </tr> + <? endif; ?> + + <?/* Display series section if at least one series exists. */?> + <? $series = $this->driver->getSeries(); if (!empty($series)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Series')?>: </th> + <td> + <? foreach ($series as $field): ?> + <?/* Depending on the record driver, $field may either be an array with + "name" and "number" keys or a flat string containing only the series + name. We should account for both cases to maximize compatibility. */?> + <? if (is_array($field)): ?> + <? if (!empty($field['name'])): ?> + <a href="<?=$this->record($this->driver)->getLink('series', $field['name'])?>"><?=$this->escapeHtml($field['name'])?></a> + <? if (!empty($field['number'])): ?> + <?=$this->escapeHtml($field['number'])?> + <? endif; ?> + <br/> + <? endif; ?> + <? else: ?> + <a href="<?=$this->record($this->driver)->getLink('series', $field)?>"><?=$this->escapeHtml($field)?></a><br/> + <? endif; ?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Subjects')?>: </th> + <td> + <? foreach ($subjects as $field): ?> + <div class="subjectLine"> + <? $subject = ''; ?> + <? $i = 0; foreach ($field as $subfield): ?> + <?=($i++ == 0) ? '' : ' > '?> + <? $subject = trim($subject . ' ' . $subfield); ?> + <a title="<?=$this->escapeHtml($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" class="subjectHeading"><?=$this->escapeHtml($subfield)?></a> + <? endforeach; ?> + </div> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? + $openUrl = $this->driver->openURLActive('record') ? $this->driver->getOpenURL() : false; + // Account for replace_other_urls setting + $urls = ($openUrl && $this->driver->replaceURLsWithOpenURL()) ? array() : $this->record($this->driver)->getLinkDetails(); + ?> + <? if (!empty($urls) || $openUrl): ?> + <tr valign="top"> + <th><?=$this->transEsc('Online Access')?>: </th> + <td> + <? foreach ($urls as $current): ?> + <a href="<?=$this->escapeHtml($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> + <? endforeach; ?> + <? if ($openUrl): ?> + <?=$this->openUrl($openUrl)?><br/> + <? endif; ?> + </td> + </tr> + <? endif; ?> + + <? $notes = $this->driver->getGeneralNotes(); if (!empty($notes)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Notes')?>: </th> + <td> + <? foreach ($notes as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $credits = $this->driver->getProductionCredits(); if (!empty($credits)): ?> + <tr valign="top"> + <th><?=$this->transEsc('Production Credits')?>: </th> + <td> + <? foreach ($credits as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $isbns = $this->driver->getISBNs(); if (!empty($isbns)): ?> + <tr valign="top"> + <th><?=$this->transEsc('ISBN')?>: </th> + <td> + <? foreach ($isbns as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $issns = $this->driver->getISSNs(); if (!empty($issns)): ?> + <tr valign="top"> + <th><?=$this->transEsc('ISSN')?>: </th> + <td> + <? foreach ($issns as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> +</table> +</div> diff --git a/themes/blueprint/templates/collection/view.phtml b/themes/blueprint/templates/collection/view.phtml index e968bd623bb866981f0aadf801b327a88de08245..4f0ea3f756474ccf1d11e6919e813790bca06e0f 100644 --- a/themes/blueprint/templates/collection/view.phtml +++ b/themes/blueprint/templates/collection/view.phtml @@ -25,7 +25,7 @@ <? if ($this->scrollData['nextRecord']): ?><a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>"><?=$this->transEsc('Next')?> »</a><? endif; ?> </div> <? endif; ?> - <?=$this->record($this->driver)->getCoreMetadata()?> + <?=$this->record($this->driver)->getCollectionMetadata()?> </div> <? if (count($this->tabs) > 0): ?> diff --git a/themes/jquerymobile/templates/RecordDriver/SolrDefault/collection-info.phtml b/themes/jquerymobile/templates/RecordDriver/SolrDefault/collection-info.phtml new file mode 100644 index 0000000000000000000000000000000000000000..550e2f6ca9fcde390bdda1f2a40f98235efc538b --- /dev/null +++ b/themes/jquerymobile/templates/RecordDriver/SolrDefault/collection-info.phtml @@ -0,0 +1,4 @@ +<h1><?=$this->escapeHtml($this->driver->getShortTitle())?></h1> +<? $summ = $this->driver->getSummary(); if (!empty($summ)): ?> + <p><?=$this->escapeHtml($summ[0])?></p> +<? endif; ?> diff --git a/themes/jquerymobile/templates/collection/view.phtml b/themes/jquerymobile/templates/collection/view.phtml index 7a9daa50018c7464dada6cb70bbf499276137e04..0a785bcfa63eadb195ef9bf698fa075ecc2d2732 100644 --- a/themes/jquerymobile/templates/collection/view.phtml +++ b/themes/jquerymobile/templates/collection/view.phtml @@ -14,7 +14,7 @@ <div class="record" data-role="content" data-record-id="<?=$this->escapeHtml($this->driver->getUniqueId())?>"> <?=$this->flashmessages()?> <? if ($this->activeTab == $this->defaultTab): ?> - <?=$this->record($this->driver)->getCoreMetadata()?> + <?=$this->record($this->driver)->getCollectionMetadata()?> <? else: ?> <h3><?=$this->escapeHtml($this->driver->getBreadcrumb())?></h3> <? endif; ?>