mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #2527 from mike-esokia/PHRAS-1898_fix_write_video
PHRAS-1898 save video chapters to meta field
This commit is contained in:
@@ -54,6 +54,7 @@ class ToolsController extends Controller
|
||||
|
||||
/** @Ignore */
|
||||
$JSFields[$meta->get_id()] = [
|
||||
'id' => $meta->get_id(),
|
||||
'name' => $meta->get_name(),
|
||||
'_value' => $record->getCaption([$meta->get_name()]),
|
||||
];
|
||||
@@ -442,4 +443,29 @@ class ToolsController extends Controller
|
||||
unset($media);
|
||||
$this->getFilesystem()->remove($fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $request
|
||||
* @return \Symfony\Component\HttpFoundation\JsonResponse
|
||||
*/
|
||||
public function saveMetasAction(Request $request)
|
||||
{
|
||||
$record = new \record_adapter($this->app,
|
||||
(int)$request->request->get("databox_id"),
|
||||
(int)$request->request->get("record_id"));
|
||||
|
||||
$metadatas[0] = [
|
||||
'meta_struct_id' => (int)$request->request->get("meta_struct_id"),
|
||||
'meta_id' => '',
|
||||
'value' => $request->request->get("value")
|
||||
];
|
||||
try {
|
||||
$record->set_metadatas($metadatas);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
return $this->app->json(['success' => false, 'errorMessage' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
return $this->app->json(['success' => true, 'errorMessage' => '']);
|
||||
}
|
||||
}
|
||||
|
@@ -69,6 +69,10 @@ class Tools implements ControllerProviderInterface, ServiceProviderInterface
|
||||
|
||||
$controllers->post('/sharing-editor/{base_id}/{record_id}/', 'controller.prod.tools:editRecordSharing');
|
||||
|
||||
$controllers->post('/metadata/save/', 'controller.prod.tools:saveMetasAction')
|
||||
->bind('prod_tools_metadata_save');
|
||||
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,8 @@
|
||||
<div id="phraseanet-embed-frame" class="videoTips"
|
||||
data-original-width="{{original_w}}"
|
||||
data-original-height="{{original_h}}"
|
||||
data-kind="video">
|
||||
data-kind="video"
|
||||
data-src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}">
|
||||
<iframe width="100%" height="100%"
|
||||
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||
frameborder="0" allowfullscreen></iframe>
|
||||
@@ -22,7 +23,8 @@
|
||||
<div id="phraseanet-embed-frame" class="documentTips"
|
||||
data-original-width="{{original_w}}"
|
||||
data-original-height="{{original_h}}"
|
||||
data-kind="document">
|
||||
data-kind="document"
|
||||
data-src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}">
|
||||
<iframe width="100%" height="100%"
|
||||
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||
frameborder="0" allowfullscreen></iframe>
|
||||
@@ -31,7 +33,8 @@
|
||||
<div id="phraseanet-embed-frame" class="audioTips"
|
||||
data-original-width="{{original_w}}"
|
||||
data-original-height="{{original_h}}"
|
||||
data-kind="audio">
|
||||
data-kind="audio"
|
||||
data-src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}">
|
||||
<iframe width="100%" height="100%"
|
||||
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||
frameborder="0" allowfullscreen></iframe>
|
||||
|
@@ -358,12 +358,14 @@
|
||||
var toolsConfig = {
|
||||
selectionLength: {{ selectionLength }},
|
||||
databaseId: {% if selectionLength == 1%}{{record.get_base_id}}{% else %}0{% endif %},
|
||||
databoxId: {% if selectionLength == 1 %}{{ record.get_sbas_id() }}{% else %}0{% endif %},
|
||||
recordId: {% if selectionLength == 1%}{{record.get_record_id}}{% else %}0{% endif %},
|
||||
translations: {
|
||||
alertTitle: '{{ "alert" | trans }}',
|
||||
noImgSelected: '{{ "no image selected" | trans }}',
|
||||
processing: '{{ "processing" | trans }}',
|
||||
thumbnailTitle: '{{ 'thumbnail validation' | trans }}'
|
||||
thumbnailTitle: '{{ 'thumbnail validation' | trans }}',
|
||||
updateTitle: '{{ 'Successful update' | trans }}'
|
||||
},
|
||||
T_fields: {{ JSonFields|raw }},
|
||||
videoEditorConfig: {% if videoEditorConfig is not null %}{{ videoEditorConfig|json_encode()|raw }}{% else %}{}{% endif %},
|
||||
|
Reference in New Issue
Block a user