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

Added mechanism to allow AbstractRecord subclasses to override default tab configuration.

parent ac239323
No related merge requests found
...@@ -529,6 +529,17 @@ class AbstractRecord extends AbstractBase ...@@ -529,6 +529,17 @@ class AbstractRecord extends AbstractBase
return $this->redirect()->toUrl($target . $params); return $this->redirect()->toUrl($target . $params);
} }
/**
* Get the tab configuration for this controller.
*
* @return array
*/
protected function getTabConfiguration()
{
$cfg = $this->getServiceLocator()->get('Config');
return $cfg['recorddriver_tabs'];
}
/** /**
* Get all tab information for a given driver. * Get all tab information for a given driver.
* *
...@@ -538,11 +549,10 @@ class AbstractRecord extends AbstractBase ...@@ -538,11 +549,10 @@ class AbstractRecord extends AbstractBase
{ {
if (null === $this->allTabs) { if (null === $this->allTabs) {
$driver = $this->loadRecord(); $driver = $this->loadRecord();
$cfg = $this->getServiceLocator()->get('Config');
$request = $this->getRequest(); $request = $this->getRequest();
$this->allTabs = $this->getServiceLocator() $this->allTabs = $this->getServiceLocator()
->get('VuFind\RecordTabPluginManager') ->get('VuFind\RecordTabPluginManager')
->getTabsForRecord($driver, $cfg['recorddriver_tabs'], $request); ->getTabsForRecord($driver, $this->getTabConfiguration(), $request);
} }
return $this->allTabs; return $this->allTabs;
} }
......
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