Skip to content
Snippets Groups Projects
Commit 9cb2c1ab authored by Sebastien's avatar Sebastien
Browse files

Fix open project in edit mode or preview mode

parent 73f3bdd8
Branches
Tags
3 merge requests!43tuleap-83-access-my-capsules,!42Draft: access-my-capsules-conflicts-fixed,!40Draft: Tuleap 83 access my capsules
......@@ -67,3 +67,6 @@ LEGACY_URL=http://legacy/
LEGACY_URL_EXTERNAL=http://localhost:8081/legacy/
# Should be the path part of the above url
LEGACY_EXTERNAL_PREFIX=/legacy
MEMBER_URL_EXTERNAL=http://localhost:8081/
FRONT_URL_EXTERNAL=http://localhost:8081/
\ No newline at end of file
......@@ -50,7 +50,8 @@
"symfonycasts/reset-password-bundle": "^1.11",
"symfonycasts/verify-email-bundle": "^1.6",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
"twig/twig": "^2.12|^3.0",
"ext-simplexml": "*"
},
"require-dev": {
"ext-dom": "*",
......
......@@ -32,6 +32,9 @@ services:
build: ./docker/legacy
depends_on:
- mysql
environment:
- MEMBER_URL_EXTERNAL
- FRONT_URL_EXTERNAL
volumes:
- $PWD/legacy:/sites/memorekall/www/web_legacy:rw
- $PWD/log:/sites/memorekall/www/log:rw
......
No preview for this file type
......@@ -59,7 +59,10 @@ class ProjectController extends AbstractController
return $this->redirectToRoute('capsule_list');
}
private function extractZipArchiveInNewCapsuleDirectory(string $capsule_name): void
/**
* @throws ZipArchiveNotOpeningException The archive file doesn't exist.
*/
private function extractZipArchiveInNewCapsuleDirectory(string $capsule_directory): void
{
$zip = new ZipArchive();
$zip_file_archive_is_open = $zip->open("create.zip");
......@@ -68,27 +71,21 @@ class ProjectController extends AbstractController
throw new ZipArchiveNotOpeningException("Create Zip Archive could not be open");
}
$zip->extractTo($capsule_name);
$zip->extractTo($capsule_directory);
$zip->close();
}
private function addProjectVideoUrlInXMLProjectFile(string $capsule_directory, string $video_url): void
{
$project_xml_file = $capsule_directory . "/file/project.xml";
$xml_file_content = file_get_contents($project_xml_file);
$xml_file_content = simplexml_load_file($project_xml_file);
$xml_file_content->video['url'] = $video_url;
if (false === $xml_file_content) {
throw new FileNotFoundException("The XML project file could not be found");
}
$video_url_XML_tag_is_filled = file_put_contents(
$project_xml_file,
str_replace(
"__video__",
$video_url,
$xml_file_content
)
);
$video_url_XML_tag_is_filled = $xml_file_content->saveXML($project_xml_file);
if (false === $video_url_XML_tag_is_filled) {
throw new XmlParsingException('Video URL could not be written in XML project file');
......
......@@ -51,7 +51,7 @@
<div class="d-flex flex-column flex-md-row justify-content-center align-items-center">
<div class="m-4 ratio ratio-16x9">
<iframe
src="{{ legacy_url }}/{{ capsule.getEditionLink() }}"
src="{{ legacy_url }}/{{ capsule.getPreviewLink() }}/?p=read"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment