diff --git a/module/fid_bbi/Module.php b/module/fid_bbi/Module.php index 32ed37938987971dc7a6192bb92cd84076a1999c..3945f73a448556a6e7dbeb0b30754dc9c58026a5 100644 --- a/module/fid_bbi/Module.php +++ b/module/fid_bbi/Module.php @@ -28,6 +28,8 @@ namespace fid_bbi; use Zend\ModuleManager\ModuleManager, Zend\Mvc\MvcEvent; +use Zend\ModuleManager\ModuleEvent; +use finc\RecordDriver\SolrAI; /** * Template for ZF2 module for storing local overrides. @@ -76,6 +78,7 @@ class Module */ public function init(ModuleManager $m) { + $m->getEventManager()->attach(ModuleEvent::EVENT_MERGE_CONFIG,[$this,'onMergeConfig']); } /** @@ -89,4 +92,23 @@ class Module public function onBootstrap(MvcEvent $e) { } + + /** + * @param MvcEvent $event + */ + public function onMergeConfig(ModuleEvent $event) + { + $configListener = $event->getConfigListener(); + $config = $configListener->getMergedConfig(false); + $mergedTabOrder = &$config['vufind']['recorddriver_tabs'][SolrAI::class]['tabs'] ?? []; + + // Change tab order for SolrAI + if (!empty($mergedTabOrder)) { + $moduleTabOrder = $this->getConfig()['vufind']['recorddriver_tabs'][SolrAI::class]['tabs'] ?? []; + $mergedTabOrder = array_merge($moduleTabOrder,$mergedTabOrder); + } + + // Pass the changed configuration back to the listener: + $configListener->setMergedConfig($config); + } } diff --git a/module/fid_bbi/config/module.config.php b/module/fid_bbi/config/module.config.php index 414e9af2d873f18bdab96c6e8057314c66cb81a8..c1459efb5ec490c527e21fe82b5d7f7d4f90334f 100644 --- a/module/fid_bbi/config/module.config.php +++ b/module/fid_bbi/config/module.config.php @@ -76,7 +76,7 @@ $config = [ 'Similar' => null, 'Details' => 'StaffViewArray', ], - 'defaultTab' => null, + 'defaultTab' => 'Description', ], 'finc\RecordDriver\SolrMarcFinc' => [ 'tabs' => [ @@ -92,7 +92,7 @@ $config = [ 'Similar' => null, 'Details' => 'StaffViewMARC', ], - 'defaultTab' => null, + 'defaultTab' => 'Description', ], 'finc\RecordDriver\SolrAI' => [ 'tabs' => [ @@ -108,7 +108,7 @@ $config = [ 'Similar' => null, 'Details' => 'StaffViewAI', ], - 'defaultTab' => null, + 'defaultTab' => 'Description', ], ], 'recorddriver_collection_tabs' => [