Skip to content
Snippets Groups Projects
Commit f389cc39 authored by Demian Katz's avatar Demian Katz
Browse files

Moved \VuFind\Summon class to a view helper; it was only accessed in views,...

Moved \VuFind\Summon class to a view helper; it was only accessed in views, and using a helper makes template syntax cleaner.
parent 65d21223
No related merge requests found
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://www.vufind.org Main Page * @link http://www.vufind.org Main Page
*/ */
namespace VuFind; namespace VuFind\Theme\Root\Helper;
use Zend\View\Helper\AbstractHelper;
/** /**
* Summon support functions. * Summon support functions.
...@@ -36,7 +37,7 @@ namespace VuFind; ...@@ -36,7 +37,7 @@ namespace VuFind;
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://www.vufind.org Main Page * @link http://www.vufind.org Main Page
*/ */
class Summon class Summon extends AbstractHelper
{ {
/** /**
* Export support function to convert Summon format to EndNote format. * Export support function to convert Summon format to EndNote format.
...@@ -45,7 +46,7 @@ class Summon ...@@ -45,7 +46,7 @@ class Summon
* *
* @return string * @return string
*/ */
public static function getEndnoteFormat($format) public function getEndnoteFormat($format)
{ {
switch ($format) { switch ($format) {
case 'Journal Article': case 'Journal Article':
...@@ -70,7 +71,7 @@ class Summon ...@@ -70,7 +71,7 @@ class Summon
* *
* @return string * @return string
*/ */
public static function getRefWorksFormat($format) public function getRefWorksFormat($format)
{ {
switch ($format) { switch ($format) {
case 'Book Chapter': case 'Book Chapter':
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Convert Summon formats to EndNote formats: // Convert Summon formats to EndNote formats:
$formats = $this->driver->getFormats(); $formats = $this->driver->getFormats();
foreach ($formats as $i => $format) { foreach ($formats as $i => $format) {
$formats[$i] = \VuFind\Summon::getEndnoteFormat($format); $formats[$i] = $this->summon()->getEndnoteFormat($format);
} }
// Use the default template, but override the formats: // Use the default template, but override the formats:
$this->overrideFormats = $formats; $this->overrideFormats = $formats;
echo $this->render('RecordDriver/Base/export-endnote.phtml'); echo $this->render('RecordDriver/AbstractBase/export-endnote.phtml');
?> ?>
\ No newline at end of file
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Convert Summon formats to RefWorks formats: // Convert Summon formats to RefWorks formats:
$formats = $this->driver->getFormats(); $formats = $this->driver->getFormats();
foreach ($formats as $i => $format) { foreach ($formats as $i => $format) {
$formats[$i] = \VuFind\Summon::getRefWorksFormat($format); $formats[$i] = $this->summon()->getRefWorksFormat($format);
} }
// Use the default template, but override the formats: // Use the default template, but override the formats:
$this->overrideFormats = $formats; $this->overrideFormats = $formats;
echo $this->render('RecordDriver/Base/export-refworks.phtml'); echo $this->render('RecordDriver/AbstractBase/export-refworks.phtml');
?> ?>
\ No newline at end of file
...@@ -37,6 +37,7 @@ helpers_to_register[] = "Reviews" ...@@ -37,6 +37,7 @@ helpers_to_register[] = "Reviews"
helpers_to_register[] = "SearchOptions" helpers_to_register[] = "SearchOptions"
helpers_to_register[] = "SafeMoneyFormat" helpers_to_register[] = "SafeMoneyFormat"
helpers_to_register[] = "SortFacetList" helpers_to_register[] = "SortFacetList"
helpers_to_register[] = "Summon"
helpers_to_register[] = "SyndeticsPlus" helpers_to_register[] = "SyndeticsPlus"
helpers_to_register[] = "SystemEmail" helpers_to_register[] = "SystemEmail"
helpers_to_register[] = "TransEsc" helpers_to_register[] = "TransEsc"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment