diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index b2119e961456982dd52e08f7e7f7077ea8d8e026..d6614d5e856f04d7c3d69c4457ca27ebaed73427 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -282,6 +282,9 @@ $config = array( // driver is not defined here, it will inherit configuration from a configured // parent class. 'recorddriver_tabs' => array( + 'VuFind\RecordDriver\SolrAuth' => array( + 'Details' => 'StaffViewMARC', + ), 'VuFind\RecordDriver\SolrDefault' => array( 'Holdings' => 'HoldingsILS', 'Description' => 'Description', 'TOC' => 'TOC', 'UserComments' => 'UserComments', @@ -470,6 +473,7 @@ $config = array( $recordRoutes = array( 'record' => 'Record', 'missingrecord' => 'MissingRecord', + 'solrauthrecord' => 'Authority', 'summonrecord' => 'SummonRecord', 'worldcatrecord' => 'WorldcatRecord' ); diff --git a/module/VuFind/src/VuFind/Controller/AuthorityController.php b/module/VuFind/src/VuFind/Controller/AuthorityController.php index c81e4fef2b49f840dc8135e5c9376d5200691681..fb9cc489c41a161d4515e5f25dc42c3d7806b295 100644 --- a/module/VuFind/src/VuFind/Controller/AuthorityController.php +++ b/module/VuFind/src/VuFind/Controller/AuthorityController.php @@ -55,6 +55,12 @@ class AuthorityController extends AbstractSearch */ public function homeAction() { + // If we came in with a record ID, forward to the record action: + if ($id = $this->params()->fromRoute('id', false)) { + $this->getRequest()->getQuery()->set('id', $id); + return $this->forwardTo('Authority', 'Record'); + } + // Do nothing -- just display template return $this->createViewModel(); } @@ -66,12 +72,15 @@ class AuthorityController extends AbstractSearch */ public function recordAction() { - return $this->createViewModel( - array( - 'driver' => $this->getSearchManager()->setSearchClassId('SolrAuth') - ->getResults()->getRecord($this->params()->fromQuery('id')) - ) - ); + $id = $this->params()->fromQuery('id'); + $cfg = $this->getServiceLocator()->get('Config'); + $driver = $this->getSearchManager()->setSearchClassId('SolrAuth') + ->getResults()->getRecord($id); + $request = $this->getRequest(); + $tabs = $this->getServiceLocator() + ->get('VuFind\RecordTabPluginManager') + ->getTabsForRecord($driver, $cfg['recorddriver_tabs'], $request); + return $this->createViewModel(array('driver' => $driver, 'tabs' => $tabs)); } /** diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrAuth.php b/module/VuFind/src/VuFind/RecordDriver/SolrAuth.php index 58f3bdb6271936578436e516e9fb61d30679eb56..b24cca0055df4524ef27955c1450da03df25fc42 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrAuth.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrAuth.php @@ -38,6 +38,13 @@ namespace VuFind\RecordDriver; */ class SolrAuth extends SolrMarc { + /** + * Used for identifying database records + * + * @var string + */ + protected $resourceSource = 'SolrAuth'; + /** * Get the short (pre-subtitle) title of the record. * diff --git a/themes/blueprint/templates/authority/record.phtml b/themes/blueprint/templates/authority/record.phtml index 5743b79b6854899b3dfd599e2ce08e88ea5a35ed..73bf63b69d4b61f5c63520928065f58ba797082c 100644 --- a/themes/blueprint/templates/authority/record.phtml +++ b/themes/blueprint/templates/authority/record.phtml @@ -1,2 +1,2 @@ <? $this->layout()->breadcrumbs = ' '; ?> -<?=$this->record($this->driver)->getTab('details')?> \ No newline at end of file +<?=$this->record($this->driver)->getTab($this->tabs['Details'])?> \ No newline at end of file diff --git a/themes/jquerymobile/templates/authority/record.phtml b/themes/jquerymobile/templates/authority/record.phtml index 502045b67e0142d90a7b71f936fcb9b116d8521b..ae55ebc78f6bfd2e3a0ce246e49e7f4e37f355bd 100644 --- a/themes/jquerymobile/templates/authority/record.phtml +++ b/themes/jquerymobile/templates/authority/record.phtml @@ -1,7 +1,7 @@ <div data-role="page"> <?=$this->mobileMenu()->header(array('searchLink' => 'authority-home'))?> <div data-role="content"> - <?=$this->record($this->driver)->getTab('details')?> + <?=$this->record($this->driver)->getTab($this->tabs['Details'])?> </div> <?=$this->mobileMenu()->footer()?> </div> \ No newline at end of file