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

Fixed bug: tab class refactoring broke Authority module;

made Authority module more robust by standardizing routing.
parent bde1c73d
No related merge requests found
...@@ -282,6 +282,9 @@ $config = array( ...@@ -282,6 +282,9 @@ $config = array(
// driver is not defined here, it will inherit configuration from a configured // driver is not defined here, it will inherit configuration from a configured
// parent class. // parent class.
'recorddriver_tabs' => array( 'recorddriver_tabs' => array(
'VuFind\RecordDriver\SolrAuth' => array(
'Details' => 'StaffViewMARC',
),
'VuFind\RecordDriver\SolrDefault' => array( 'VuFind\RecordDriver\SolrDefault' => array(
'Holdings' => 'HoldingsILS', 'Description' => 'Description', 'Holdings' => 'HoldingsILS', 'Description' => 'Description',
'TOC' => 'TOC', 'UserComments' => 'UserComments', 'TOC' => 'TOC', 'UserComments' => 'UserComments',
...@@ -470,6 +473,7 @@ $config = array( ...@@ -470,6 +473,7 @@ $config = array(
$recordRoutes = array( $recordRoutes = array(
'record' => 'Record', 'record' => 'Record',
'missingrecord' => 'MissingRecord', 'missingrecord' => 'MissingRecord',
'solrauthrecord' => 'Authority',
'summonrecord' => 'SummonRecord', 'summonrecord' => 'SummonRecord',
'worldcatrecord' => 'WorldcatRecord' 'worldcatrecord' => 'WorldcatRecord'
); );
......
...@@ -55,6 +55,12 @@ class AuthorityController extends AbstractSearch ...@@ -55,6 +55,12 @@ class AuthorityController extends AbstractSearch
*/ */
public function homeAction() 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 // Do nothing -- just display template
return $this->createViewModel(); return $this->createViewModel();
} }
...@@ -66,12 +72,15 @@ class AuthorityController extends AbstractSearch ...@@ -66,12 +72,15 @@ class AuthorityController extends AbstractSearch
*/ */
public function recordAction() public function recordAction()
{ {
return $this->createViewModel( $id = $this->params()->fromQuery('id');
array( $cfg = $this->getServiceLocator()->get('Config');
'driver' => $this->getSearchManager()->setSearchClassId('SolrAuth') $driver = $this->getSearchManager()->setSearchClassId('SolrAuth')
->getResults()->getRecord($this->params()->fromQuery('id')) ->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));
} }
/** /**
......
...@@ -38,6 +38,13 @@ namespace VuFind\RecordDriver; ...@@ -38,6 +38,13 @@ namespace VuFind\RecordDriver;
*/ */
class SolrAuth extends SolrMarc class SolrAuth extends SolrMarc
{ {
/**
* Used for identifying database records
*
* @var string
*/
protected $resourceSource = 'SolrAuth';
/** /**
* Get the short (pre-subtitle) title of the record. * Get the short (pre-subtitle) title of the record.
* *
......
<? $this->layout()->breadcrumbs = ' '; ?> <? $this->layout()->breadcrumbs = ' '; ?>
<?=$this->record($this->driver)->getTab('details')?> <?=$this->record($this->driver)->getTab($this->tabs['Details'])?>
\ No newline at end of file \ No newline at end of file
<div data-role="page"> <div data-role="page">
<?=$this->mobileMenu()->header(array('searchLink' => 'authority-home'))?> <?=$this->mobileMenu()->header(array('searchLink' => 'authority-home'))?>
<div data-role="content"> <div data-role="content">
<?=$this->record($this->driver)->getTab('details')?> <?=$this->record($this->driver)->getTab($this->tabs['Details'])?>
</div> </div>
<?=$this->mobileMenu()->footer()?> <?=$this->mobileMenu()->footer()?>
</div> </div>
\ No newline at end of file
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