read video chapters from meta fields in video-editor

This commit is contained in:
Mike Ng
2018-03-05 16:41:20 +04:00
parent 5708e8731b
commit cff7f65253
2 changed files with 20 additions and 4 deletions

View File

@@ -40,10 +40,24 @@ class ToolsController extends Controller
$metadatas = false;
$record = null;
$recordAccessibleSubdefs = array();
$JSFields = [];
if (count($records) == 1) {
/** @var \record_adapter $record */
$record = $records->first();
$databox = $record->getDatabox();
foreach ($databox->get_meta_structure() as $meta) {
/** @var \databox_field $meta */
$fields[] = $meta;
/** @Ignore */
$JSFields[$meta->get_id()] = [
'name' => $meta->get_name(),
'_value' => $record->getCaption([$meta->get_name()]),
];
}
// fetch subdef list:
$subdefs = $record->get_subdefs();
@@ -88,11 +102,12 @@ class ToolsController extends Controller
$conf = $this->getConf();
return $this->render('prod/actions/Tools/index.html.twig', [
'records' => $records,
'record' => $record,
'records' => $records,
'record' => $record,
'videoEditorConfig' => $conf->get(['video-editor']),
'recordSubdefs' => $recordAccessibleSubdefs,
'metadatas' => $metadatas,
'recordSubdefs' => $recordAccessibleSubdefs,
'metadatas' => $metadatas,
'JSonFields' => json_encode($JSFields),
]);
}