diff --git a/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php b/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php index 8692758b482d5117b3801d19a32e42875be9de58..39f87ea365ea2b9758135785ba0a692f6f71e976 100644 --- a/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php @@ -365,9 +365,16 @@ class RecordDataFormatterFactory extends \fid\View\Helper\Root\RecordDataFormatt $spec->setTemplateLine( 'Subjects', 'getAllSubjectHeadingsExtended', 'data-allSubjectHeadingsExtended.phtml' ); + /* $spec->setTemplateLine( 'RVK', 'getRVK', 'data-rvk.phtml' ); + */ + $spec->setMultiLine( + 'RVK', + true, + [$this,'multiRvk'] + ); $spec->setTemplateLine( 'BK', 'getBK', 'data-bk.phtml' ); @@ -459,4 +466,42 @@ class RecordDataFormatterFactory extends \fid\View\Helper\Root\RecordDataFormatt ]); return $spec->getArray(); } + + /** + * return render details for rvk data + * uses two different functions + * @return callback + */ + public function multiRvk($data, $options, $driver) + { + $args = func_get_args(); + // Sort the data: + $final = []; + $data = $driver->tryMethod('getRvkWithMetadata'); + if (!empty($data)) { + return [[ + 'label' => 'RVK', + 'values' => $data, + 'options' => [ + 'pos' => $options['pos'], + 'renderType' => 'RecordDriverTemplate', + 'template' => 'data-rvkNotation.phtml', + ], + ]]; + } + $data = $driver->tryMethod('getRvk'); + if (!empty($data)) { + return [[ + 'label' => 'RVK', + 'values' => $data, + 'options' => [ + 'pos' => $options['pos'], + 'renderType' => 'RecordDriverTemplate', + 'template' => 'data-rvk.phtml', + ], + ]]; + } + return []; + } + }