diff --git a/config/vufind/export.ini b/config/vufind/export.ini index 4bdb7e57ac6508de48e56f48e51bb45411c348fe..6866fa073586d530cff4024012f372394691397b 100644 --- a/config/vufind/export.ini +++ b/config/vufind/export.ini @@ -12,6 +12,8 @@ ; non-XML formats. ; headers[] - a repeatable field containing HTTP headers that should be output to ; specify the appropriate export format. +; label - the label to display to the user when referring to this format; if omitted, +; the section name will be used by default. ; redirectUrl - a URL to forward the user to when they export this format (used for ; sending data to an external service like RefWorks). The URL must include one ; or more of these special tokens: diff --git a/module/VuFind/src/VuFind/Export.php b/module/VuFind/src/VuFind/Export.php index 52ed4a57eb3696d911e6ae85e1b4e5c0aabd8f9b..53c9042587d035f6ff8120614a70b5ce33cfbe00 100644 --- a/module/VuFind/src/VuFind/Export.php +++ b/module/VuFind/src/VuFind/Export.php @@ -90,7 +90,7 @@ class Export if (isset($this->mainConfig->Export->$option) && $this->mainConfig->Export->$option == true ) { - $this->bulkOptions[] = $option; + $this->bulkOptions[] = $option; } } } @@ -325,4 +325,17 @@ class Export return isset($this->exportConfig->$format->headers) ? $this->exportConfig->$format->headers : array(); } + + /** + * Get the display label for the specified export format. + * + * @param string $format Format identifier + * + * @return string + */ + public function getLabelForFormat($format) + { + return isset($this->exportConfig->$format->label) + ? $this->exportConfig->$format->label : $format; + } } diff --git a/themes/blueprint/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/blueprint/templates/RecordDriver/SolrDefault/toolbar.phtml index 59dfc5148fb11bd372273e8ed03b59094c98749d..2ab3ba084609832eb827cc0fc7a6fab15bb891a7 100644 --- a/themes/blueprint/templates/RecordDriver/SolrDefault/toolbar.phtml +++ b/themes/blueprint/templates/RecordDriver/SolrDefault/toolbar.phtml @@ -22,7 +22,7 @@ <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" class="export exportMenu"><?=$this->transEsc('Export Record')?></a> <ul class="menu offscreen" id="exportMenu"> <? foreach ($exportFormats as $exportFormat): ?> - <li><a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <? endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->escapeHtml($exportFormat)?></a></li> + <li><a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <? endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li> <? endforeach; ?> </ul> </li> diff --git a/themes/blueprint/templates/ajax/export-favorites.phtml b/themes/blueprint/templates/ajax/export-favorites.phtml index 93fb0270e378d3a8addd445811a51e0d7b574832..c1120508d1ee6c30d8163ff50cc9b90d0253f61e 100644 --- a/themes/blueprint/templates/ajax/export-favorites.phtml +++ b/themes/blueprint/templates/ajax/export-favorites.phtml @@ -1,7 +1,7 @@ <p> <a class="save" onclick="hideLightbox();" href="<?=$this->escapeHtmlAttr($this->url)?>"<?=$this->export()->needsRedirect($this->format) ? ' target="_blank"' : ''?>><?= $this->export()->needsRedirect($this->format) - ? $this->transEsc('export_redirect', array('%%service%%' => $this->translate($this->format))) + ? $this->transEsc('export_redirect', array('%%service%%' => $this->translate($this->export()->getLabelForFormat($this->format)))) : $this->transEsc('export_download') ?></a> </p> \ No newline at end of file diff --git a/themes/blueprint/templates/cart/export.phtml b/themes/blueprint/templates/cart/export.phtml index 6c5da4a54b3bb3e9e4212412b22d0f500aef366e..249716037edbb409389ceb5640e1a09a9cc2395d 100644 --- a/themes/blueprint/templates/cart/export.phtml +++ b/themes/blueprint/templates/cart/export.phtml @@ -20,7 +20,7 @@ <label for="format"><?=$this->transEsc('Format')?>:</label> <select name="format" id="format"> <? foreach ($this->exportOptions as $exportOption): ?> - <option value="<?=$this->escapeHtmlAttr($exportOption)?>"><?=$this->transEsc($exportOption)?></option> + <option value="<?=$this->escapeHtmlAttr($exportOption)?>"><?=$this->transEsc($this->export()->getLabelForFormat($exportOption))?></option> <? endforeach; ?> </select> <br/> diff --git a/themes/blueprint/templates/record/export-menu.phtml b/themes/blueprint/templates/record/export-menu.phtml index bf75a3000fb7a9a06349149b73fb88c990ddb5f4..ee672ab24fde8b89e1bb491118e6f0f1208b1204 100644 --- a/themes/blueprint/templates/record/export-menu.phtml +++ b/themes/blueprint/templates/record/export-menu.phtml @@ -11,7 +11,7 @@ <?=$this->transEsc('export_choose_format')?> <ul> <? foreach ($exportFormats as $exportFormat): ?> - <li><a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtml($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->escapeHtml($exportFormat)?></a></li> + <li><a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtml($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li> <? endforeach; ?> </ul> <? else: ?> diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml index 5cf00aa3b645061a7bf71d686bb99ef1990373cc..8194442dd2c9d70f003b73553f61b33ec83910e4 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml @@ -23,7 +23,7 @@ <a class="export-toggle dropdown-toggle" data-toggle="dropdown" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>"><i class="fa fa-list-alt"></i> <?=$this->transEsc('Export Record') ?></a> <ul class="dropdown-menu" role="menu"> <? foreach ($exportFormats as $exportFormat): ?> - <li><a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <? endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->transEsc($exportFormat)?></a></li> + <li><a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" <? endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li> <? endforeach; ?> </ul> </li> diff --git a/themes/bootstrap3/templates/ajax/export-favorites.phtml b/themes/bootstrap3/templates/ajax/export-favorites.phtml index 6ebf7207568dd71b2e7bd7ee3ce459d7c39e184f..63648f8b29f09716eed353e348b81d66d3c63a1c 100644 --- a/themes/bootstrap3/templates/ajax/export-favorites.phtml +++ b/themes/bootstrap3/templates/ajax/export-favorites.phtml @@ -3,7 +3,7 @@ <?=$this->transEsc('export_success'); ?> — <a class="btn btn-primary" href="<?=$this->escapeHtmlAttr($this->url)?>"<?=$this->export()->needsRedirect($this->format) ? ' target="_blank"' : ''?>><?= $this->export()->needsRedirect($this->format) - ? $this->transEsc('export_redirect', array('%%service%%' => $this->translate($this->format))) + ? $this->transEsc('export_redirect', array('%%service%%' => $this->translate($this->export()->getLabelForFormat($this->format)))) : $this->transEsc('export_download') ?></a> </div> diff --git a/themes/bootstrap3/templates/cart/export.phtml b/themes/bootstrap3/templates/cart/export.phtml index 3acc97d3fcfd73f813bd17a6d47e988e03ab4029..b0fb46a37591ee19128b1bb34b90b9104b0980a1 100644 --- a/themes/bootstrap3/templates/cart/export.phtml +++ b/themes/bootstrap3/templates/cart/export.phtml @@ -40,7 +40,7 @@ <div class="col-sm-9"> <select name="format" id="format" class="form-control"> <? foreach ($this->exportOptions as $exportOption): ?> - <option value="<?=$this->escapeHtmlAttr($exportOption)?>"><?=$this->transEsc($exportOption)?></option> + <option value="<?=$this->escapeHtmlAttr($exportOption)?>"><?=$this->transEsc($this->export()->getLabelForFormat($exportOption))?></option> <? endforeach; ?> </select> </div> diff --git a/themes/bootstrap3/templates/record/export-menu.phtml b/themes/bootstrap3/templates/record/export-menu.phtml index ad399dafbe04490cc7864d1851ac0ddf978f46ec..376a99c270f705484ac185b09376e050fd49555e 100644 --- a/themes/bootstrap3/templates/record/export-menu.phtml +++ b/themes/bootstrap3/templates/record/export-menu.phtml @@ -12,7 +12,7 @@ <?=$this->transEsc('export_choose_format')?> <ul> <? foreach ($exportFormats as $exportFormat): ?> - <li><a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtml($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->escapeHtml($exportFormat)?></a></li> + <li><a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtml($exportFormat)?>"><?=$this->transEsc('Export to')?> <?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a></li> <? endforeach; ?> </ul> <? else: ?>