Skip to content
Snippets Groups Projects
Commit 8ee02e02 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #18390 [fid_bbi] use multiple functions for RVK display

* use getRvkWithMetadata as standard
* getRvk (without metadata) only as fallback
parent a562fb04
No related merge requests found
......@@ -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 [];
}
}
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