aboutsummaryrefslogtreecommitdiff
path: root/file/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'file/index.php')
-rw-r--r--file/index.php58
1 files changed, 32 insertions, 26 deletions
diff --git a/file/index.php b/file/index.php
index d5ad3ef..3d8c460 100644
--- a/file/index.php
+++ b/file/index.php
@@ -14,7 +14,7 @@ function fallback() {if (true): ?>
<html>
<head>
- <title><?= l("Erreur", "Error") ?> | Familine Share</title>
+ <title><?= l("Erreur", "Error") ?> | Familine <?= l("Partage", "Share") ?></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
@@ -64,6 +64,12 @@ foreach ($profiles as $profile) {
if ($selected === null) {
fallback();
} else {
+ if ($selected['mime'] === "audio/mpeg") {
+ $selected['mime'] = "audio/mp3";
+ }
+ if ($selected['mime'] === "video/mpeg") {
+ $selected['mime'] = "video/mp4";
+ }
if ($selected['mime'] === "image/svg") {
$selected['mime'] = "image/svg+xml";
}
@@ -86,7 +92,7 @@ $_SESSION['name'] = $selected['name'];
<html>
<head>
- <title><?= $selected['name'] ?> | Familine Share</title>
+ <title><?= $selected['name'] ?> | Familine <?= l("Partage", "Share") ?></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
@@ -129,7 +135,7 @@ $_SESSION['name'] = $selected['name'];
<body>
<div style="color:white;background:#111;padding-bottom:50px;padding-top:50px;">
- <div class="container" id="header" style="display:grid;grid-template-columns: 1fr 1fr;">
+ <div class="container" id="header" style="display:grid;grid-template-columns: 50% 50%;">
<div>
<img src="<?php
@@ -141,7 +147,7 @@ $_SESSION['name'] = $selected['name'];
}
?>" width="96px">
- <h1><?= $selected['name'] ?></h1>
+ <h1 style="overflow: hidden;text-overflow: ellipsis;" title="<?= strip_tags(str_replace("\"", "''", $selected['name'])) ?>"><?= $selected['name'] ?></h1>
</div>
<div id="desktopinfo" style="text-align:right;">
<?php
@@ -149,9 +155,9 @@ $_SESSION['name'] = $selected['name'];
$mime = $file['mime'];
if (strpos($mime, "audio/") !== false || strpos($mime, "video/") !== false || strpos($mime, "image/") !== false || strpos($mime, "application/pdf") !== false || strpos($mime, "text/html") !== false || strpos($mime, "text/xml") !== false || strpos($mime, "application/x-executable") !== false || strpos($mime, "application/x-sharedlib") !== false || strpos($mime, "application/x-pie-executable") !== false || strpos($mime, "application/x-dosexec") !== false || strpos($mime, "application/x-ms-dos-executable") !== false || strpos($mime, "application/x-mach-binary") !== false || strpos($mime, "application/x-macbinary") !== false): ?>
<h5><?= l("compatible avec", "works with") ?></h5>
- <h3><b>Familine Share</b> Instant</h3>
- <p style="max-width:75%;margin-left:auto;"><?= l("Ayez un aperçu du fichier avant même de le télécharger grâce à Familine Share Instant.", "Get a preview of this file before even downloading it with Familine Share Instant.") ?> <a href="#" data-toggle="modal" data-target="#aboutinstant" style="color:white;text-decoration:underline;"><?= l("En savoir plus", "Learn more") ?></a></p>
- <a href="#instant" class="btn btn-light"><?= l("Voir l'Instant", "View the Instant") ?></a>
+ <h3><b>Familine <?= l("Partage", "Share") ?></b> <?= l("Instantané", "Instant") ?></h3>
+ <p style="max-width:75%;margin-left:auto;"><?= l("Ayez un aperçu du fichier avant même de le télécharger grâce à Familine Partage Instantané.", "Get a preview of this file before even downloading it with Familine Share Instant.") ?> <a href="#" data-toggle="modal" data-target="#aboutinstant" style="color:white;text-decoration:underline;"><?= l("En savoir plus", "Learn more") ?></a></p>
+ <a href="#instant" class="btn btn-light"><?= l("Voir l'Instantané", "View the Instant") ?></a>
<?php endif;
?>
@@ -364,32 +370,32 @@ $_SESSION['name'] = $selected['name'];
<?= str_replace("\n", "<br>", str_replace(">", "&gt;", str_replace("<", "&lt;", $selected['message']))) ?>
<hr>
<?php endif; ?>
- <h3><b>Familine Share</b> Instant</h3>
- <p><?= l("Ayez un aperçu du fichier avant même de le télécharger grâce à Familine Share Instant.", "Get a preview of this file before even downloading it with Familine Share Instant.") ?> <a href="#" data-toggle="modal" data-target="#aboutinstant"><?= l("En savoir plus", "Learn more") ?></a></p>
+ <h3><b>Familine <?= l("Partage", "Share") ?></b> <?= l("Instantané", "Instant") ?></h3>
+ <p><?= l("Ayez un aperçu du fichier avant même de le télécharger grâce à Familine Partage Instantané.", "Get a preview of this file before even downloading it with Familine Share Instant.") ?> <a href="#" data-toggle="modal" data-target="#aboutinstant"><?= l("En savoir plus", "Learn more") ?></a></p>
<?php
$mime = $selected['mime'];
$nothing = true;
if (strpos($mime, "audio/") !== false): ?>
- <audio id="instant" controls style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;">
+ <audio id="instant" controls style="max-width:100%;max-height:100vh;">
<source src="/p/<?= $_SESSION["pvid"] ?>">
</audio>
<?php $nothing = false; endif; if (strpos($mime, "video/") !== false): ?>
- <video id="instant" controls style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;">
+ <video id="instant" controls style="max-width:100%;max-height:100vh;">
<source src="/p/<?= $_SESSION["pvid"] ?>">
</video>
<?php $nothing = false; endif; if (strpos($mime, "image/svg") !== false): ?>
- <img id="instant" src="data:image/svg+xml;base64,<?= base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/shares/" . $selected['file'])) ?>" style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;">
+ <img id="instant" src="data:image/svg+xml;base64,<?= base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/shares/" . $selected['file'])) ?>" style="max-width:100%;max-height:100vh;">
<?php $nothing = false; endif; if (strpos($mime, "image/") !== false && $nothing): ?>
- <img id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;">
+ <img id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="max-width:100%;max-height:100vh;">
<?php $nothing = false; endif; if (strpos($mime, "application/pdf") !== false): ?>
- <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="border:2px solid blue;width:100%;height:100vh;border-radius:10px;"></iframe>
+ <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="width:100%;height:100vh;"></iframe>
<?php $nothing = false; endif; if (strpos($mime, "text/html") !== false): ?>
- <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="border:2px solid blue;width:100%;height:100vh;border-radius:10px;"></iframe>
+ <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="width:100%;height:100vh;"></iframe>
<?php $nothing = false; endif; if (strpos($mime, "text/xml") !== false): ?>
- <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="border:2px solid blue;width:100%;height:100vh;border-radius:10px;"></iframe>
+ <iframe id="instant" src="/p/<?= $_SESSION["pvid"] ?>" style="width:100%;height:100vh;"></iframe>
<?php $nothing = false; endif; if (strpos($mime, "application/x-executable") !== false || strpos($mime, "application/x-sharedlib") !== false || strpos($mime, "application/x-pie-executable") !== false): ?>
- <div id="instant" style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;"><p>
+ <div id="instant" style="max-width:100%;max-height:100vh;"><p>
<b><?= l("Programme Linux", "Linux executable") ?></b>
<p><?php
@@ -401,7 +407,7 @@ $_SESSION['name'] = $selected['name'];
?></p>
</p></div>
<?php $nothing = false; endif; if (strpos($mime, "application/x-dosexec") !== false || strpos($mime, "application/x-ms-dos-executable") !== false): ?>
- <div id="instant" style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;"><p>
+ <div id="instant" style="max-width:100%;max-height:100vh;"><p>
<b><?= l("Programme DOS/Windows", "DOS/Windows executable") ?></b>
<p><?php
@@ -413,7 +419,7 @@ $_SESSION['name'] = $selected['name'];
?></p>
</p></div>
<?php $nothing = false; endif; if (strpos($mime, "application/x-mach-binary") !== false || strpos($mime, "application/x-macbinary") !== false): ?>
- <div id="instant" style="border:2px solid blue;max-width:100%;max-height:100vh;border-radius:10px;"><p>
+ <div id="instant" style="max-width:100%;max-height:100vh;"><p>
<b><?= l("Programme macOS/OpenDarwin", "macOS/OpenDarwin executable") ?></b>
<p><?php
@@ -425,7 +431,7 @@ $_SESSION['name'] = $selected['name'];
?></p>
</p></div>
<?php $nothing = false; endif; if (strpos($mime, "text/") !== false && $nothing): ?>
- <textarea id="instant" disabled style="background:white; color: black;font-family: var(--font-family-monospace);cursor:text;border:2px solid blue;width:100%;height:100vh;border-radius:10px;"><?php
+ <textarea id="instant" disabled style="background:white; color: black;font-family: var(--font-family-monospace) !important;cursor:text;width:100%;height:100vh;"><?php
$file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/shares/" . $selected['file']);
echo(substr($file, 0, 50000));
if (strlen($file) > 50000) {
@@ -433,7 +439,7 @@ $_SESSION['name'] = $selected['name'];
}
?></textarea>
<?php $nothing = false; endif; if ($nothing): ?>
- <i id="instant">Familine Share Instant <?= l("n'est pas disponible pour ce type de fichier", "isn't available for this type of file") ?></i>
+ <i id="instant"><?= l("Familine Partage Instanté n'est pas disponible pour ce type de fichier", "Familine Share Instant isn't available for this type of file") ?></i>
<?php endif;
?>
@@ -444,18 +450,18 @@ $_SESSION['name'] = $selected['name'];
<div class="modal-content">
<div class="modal-header">
- <h4 class="modal-title"><?= l("À propos de", "About") ?> Familine Share Instant</h4>
+ <h4 class="modal-title"><?= l("À propos de", "About") ?> Familine <?= l("Partage Instantané", "Share Instant") ?> Instant</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<p>
- <?= l("Familine Share Instant est une technologie qui vous permet de visualiser les fichiers sans que vous ayez besoin de les télécharger. Cela vous permet entre autres de vous assurer que le fichier que vous vous apprêtez à télécharger et bien ce à quoi vous vous attendez.", "Familine Share Instant is a technology that helps you preview files without having to download them. This, in fact, helps you make sure the file you download is what you expect.") ?>
+ <?= l("Familine Partage Instantané est une technologie qui vous permet de visualiser les fichiers sans que vous ayez besoin de les télécharger. Cela vous permet entre autres de vous assurer que le fichier que vous vous apprêtez à télécharger et bien ce à quoi vous vous attendez.", "Familine Share Instant is a technology that helps you preview files without having to download them. This, in fact, helps you make sure the file you download is what you expect.") ?>
</p>
<p>
- <?= l("Familine Share Instant détecte automatiquement le type de fichier et détermine si il est possible d'afficher un aperçu du fichier. Dans le cas où c'est possible, il doit par la suite déterminer quel type d'aperçu il doit charger (lecteur vidéo, lecteur audio, image, ...)", "Familine Share Instant automatically detects the file type and checks whether or not it's possible to show a preview of the file. If it is possible, it then needs to find which type of preview it needs to load (video player, audio player, picture, ...)") ?>
+ <?= l("Familine Partage Instantané détecte automatiquement le type de fichier et détermine si il est possible d'afficher un aperçu du fichier. Dans le cas où c'est possible, il doit par la suite déterminer quel type d'aperçu il doit charger (lecteur vidéo, lecteur audio, image, ...)", "Familine Share Instant automatically detects the file type and checks whether or not it's possible to show a preview of the file. If it is possible, it then needs to find which type of preview it needs to load (video player, audio player, picture, ...)") ?>
</p>
- <?= l("Familine Share Instant est actuellement compatible avec les fichiers suivants :", "Familine Share Instant is currently compatible with these files:") ?>
+ <?= l("Familine Partage Instantané est actuellement compatible avec les fichiers suivants :", "Familine Share Instant is currently compatible with these files:") ?>
<ul>
<li><?= l("fichiers audio", "audio files") ?></li>
<li><?= l("fichiers vidéo", "video files") ?></li>
@@ -469,7 +475,7 @@ $_SESSION['name'] = $selected['name'];
</div>
<div class="modal-footer">
- <span style="margin-right: auto;"><b>Instant</b> version <?= date('Y-m-d') ?></span>
+ <span style="margin-right: auto;"><b><?= l("Instantané", "Instant") ?></b> version <?= date('Y-m-d') ?></span>
<button type="button" class="btn btn-danger" data-dismiss="modal"><?= l("Fermer", "Close") ?></button>
</div>