diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Record.php b/module/VuFind/src/VuFind/View/Helper/Root/Record.php index da217bf455c6798ef8402ffba37bb7c099ddb934..b5485bae2f618f0ddbcab6008e0fbde06cb50af2 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Record.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Record.php @@ -328,25 +328,6 @@ class Record extends AbstractHelper return $transEsc('Title not available'); } - /** - * Get the name of the controller used by the record route. - * - * @return string - */ - public function getController() - { - // Figure out controller using naming convention based on resource - // source: - $source = $this->driver->getSourceIdentifier(); - if ($source == DEFAULT_SEARCH_BACKEND) { - // Default source is special case -- it uses the basic record - // controller. - return 'Record'; - } - // All other controllers will correspond with the record source: - return ucwords(strtolower($source)) . 'record'; - } - /** * Render the link of the specified type. * diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php index 371744574c254a9e5a11a3799732e498b5b26ba2..6b1d902c98b4f3b38ae865888e60df6ac5552c80 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php @@ -207,23 +207,6 @@ class RecordTest extends \PHPUnit_Framework_TestCase ); } - /** - * Test getController. - * - * @return void - */ - public function testGetController() - { - // Default (Solr) case: - $driver = new \VuFindTest\RecordDriver\TestHarness(); - $record = $this->getRecord($driver); - $this->assertEquals('Record', $record->getController()); - - // Custom source case: - $driver->setSourceIdentifier('Foo'); - $this->assertEquals('Foorecord', $record->getController()); - } - /** * Test getPreviews. * diff --git a/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml index 6364402c81f7936e4be3e4c998236b46d9c72bf2..e28ef085b07967321d0a448799a5628473da984a 100644 --- a/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml +++ b/themes/bootstrap3/templates/RecordDriver/SolrDefault/toolbar.phtml @@ -5,17 +5,15 @@ } // Set up some variables for convenience: - $id = $this->driver->getUniqueId(); - $controllerClass = 'controller:' . $this->record($this->driver)->getController(); $cart = $this->cart(); - $cartId = $this->driver->getSourceIdentifier() . '|' . $id; + $cartId = $this->driver->getSourceIdentifier() . '|' . $this->driver->getUniqueId(); ?> <ul class="nav nav-pills hidden-print"> <? if (count($this->driver->getCitationFormats()) > 0): ?> - <li><a class="cite-record <?=$controllerClass?>" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><i class="fa fa-asterisk"></i> <?=$this->transEsc('Cite this')?></a></li> + <li><a class="cite-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><i class="fa fa-asterisk"></i> <?=$this->transEsc('Cite this')?></a></li> <? endif; ?> - <li><a class="sms-record <?=$controllerClass?>" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><i class="fa fa-mobile"></i> <?=$this->transEsc('Text this')?></a></li> - <li><a class="mail-record <?=$controllerClass?>" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><i class="fa fa-envelope"></i> <?=$this->transEsc('Email this')?></a></li> + <li><a class="sms-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><i class="fa fa-mobile"></i> <?=$this->transEsc('Text this')?></a></li> + <li><a class="mail-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><i class="fa fa-envelope"></i> <?=$this->transEsc('Email this')?></a></li> <? $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?> <? if(count($exportFormats) > 0): ?> @@ -30,7 +28,7 @@ <? endif; ?> <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <li><a class="save-record <?=$controllerClass?>" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" rel="nofollow"><i class="fa fa-star"></i> <?=$this->transEsc('Add to favorites')?></a></li> + <li><a class="save-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" rel="nofollow"><i class="fa fa-star"></i> <?=$this->transEsc('Add to favorites')?></a></li> <? endif; ?> <? if (!empty($addThis)): ?> <li><a class="addThis addthis_button" href="https://www.addthis.com/bookmark.php?v=250&pub=<?=urlencode($addThis)?>"><i class="fa fa-bookmark"></i> <?=$this->transEsc('Bookmark')?></a></li> diff --git a/themes/jquerymobile/templates/record/save.phtml b/themes/jquerymobile/templates/record/save.phtml index 1eeacf1273e968f2c9a165baefbfd30a3b24a1e2..149feb4c13ab9842722739d6161349f2b39a773c 100644 --- a/themes/jquerymobile/templates/record/save.phtml +++ b/themes/jquerymobile/templates/record/save.phtml @@ -37,7 +37,7 @@ </select> <? endif; ?> - <a rel="external" data-role="button" data-rel="dialog" href="<?=$this->url('editList', array('id' => 'NEW')) ?>?recordId=<?=urlencode($this->driver->getUniqueId())?>&recordSource=<?=urlencode($this->driver->getSourceIdentifier())?>" class="listEdit controller<?=$this->record($this->driver)->getController()?>" title="<?=$this->transEsc('Create a List') ?>"><? if ($showLists) echo $this->transEsc('or create a new list'); else echo $this->transEsc('Create a List'); ?></a> + <a rel="external" data-role="button" data-rel="dialog" href="<?=$this->url('editList', array('id' => 'NEW')) ?>?recordId=<?=urlencode($this->driver->getUniqueId())?>&recordSource=<?=urlencode($this->driver->getSourceIdentifier())?>" class="listEdit" title="<?=$this->transEsc('Create a List') ?>"><? if ($showLists) echo $this->transEsc('or create a new list'); else echo $this->transEsc('Create a List'); ?></a> <? if ($showLists): ?> <? if ($this->usertags()->getMode() !== 'disabled'): ?>