Remove the cloud create submit page

This commit is contained in:
Gregory Trolliet 2021-01-11 18:05:46 +01:00
parent 17a975f28d
commit af32ddf003
4 changed files with 13 additions and 24 deletions

View File

@ -5,4 +5,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
* Removed the display page after a cloud creation, now everything is on result.php

View File

@ -47,27 +47,8 @@ if (empty($_POST)) {
if ($cloud = $db->createCloud($text, $size, $duration)) {
$viewUrl = 'result.php?id=' . $cloud['code'];
$viewName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $viewUrl;
$voteUrl = 'index.php?id=' . $cloud['code'];
$voteName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $voteUrl;
?>
<h2><?php echo L::cloud_links_warning ?></h2>
<div id="cloud_links">
<div id="cloud_links_results" class="cloud_link">
<div class="label"><?php echo L::cloud_link_view_title ?></div>
<div class="link">
<a href="<?php echo $viewUrl ?>" title="<?php echo L::cloud_link_view_tooltip ?>"><?php echo $viewName ?></a>
</div>
</div>
<div id="cloud_links_vote" class="cloud_link">
<div class="label"><?php echo L::cloud_link_vote_title ?></div>
<div class="link">
<a href="<?php echo $voteUrl ?>" title="<?php echo L::cloud_link_vote_tooltip ?>"><?php echo $voteName ?></a>
</div>
</div>
</div>
<?php
header('Location: ' . $viewUrl);
die();
} else {
?>
<h2><?php echo L::create_errorCode ?></h2>

View File

@ -26,7 +26,7 @@ duration = "Durée de vie du nuage"
duration_tooltip = "Durée après laquelle le nuage sera supprimé"
size = "Nombre de mots maximum par entrée"
create_message = "Voulez-vous créer un nouveau nuage de mots?"
links_warning = "Attention, il n'y a aucun moyen de retrouver ces liens par la suite."
links_warning = "Attention, il n'y a aucun moyen de retrouver ces liens si vous fermez la fenêtre."
noId = "Aucun nuage se trouve à cet endroit, désolé."
empty = "Il n'y a pas encore de mots dans ce nuage."

View File

@ -9,7 +9,9 @@ if (isset($_GET['id'])) {
$id = null;
}
}
?>
<h2><?php echo L::cloud_links_warning ?></h2>
<?php
if ($db->isCloudSet()) {
$nbWords = $db->countWords();
if ($nbWords == 0) {
@ -19,7 +21,13 @@ if ($db->isCloudSet()) {
}
$voteUrl = 'index.php?id=' . $id;
$voteName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $voteUrl;
$viewUrl = 'result.php?id=' . $id;
$viewName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $viewUrl;
?>
<div class="label"><?php echo L::cloud_link_view_title ?></div>
<div class="link">
<a href="<?php echo $viewUrl ?>" title="<?php echo L::cloud_link_view_tooltip ?>"><?php echo $viewName ?></a>
</div>
<div class="label"><?php echo L::cloud_link_vote_title ?></div>
<div class="link">
<a href="<?php echo $voteUrl ?>" title="<?php echo L::cloud_link_vote_tooltip ?>"><?php echo $voteName ?></a>