Use an i18n tool
This commit is contained in:
parent
e487438606
commit
16dec853f9
12 changed files with 662 additions and 97 deletions
58
result.php
58
result.php
|
@ -1,15 +1,57 @@
|
|||
<?php
|
||||
|
||||
include('init.php');
|
||||
include('templates/header.php');
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
if (!$db->isCloud($id)) {
|
||||
echo '<p>' . L::cloud_noId . '</p>';
|
||||
$id = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($id)) {
|
||||
$nbWords = $db->countWords($id);
|
||||
if ($nbWords == 0) {
|
||||
echo sprintf('<h2>%s</h2>', L::cloud_empty);
|
||||
} else {
|
||||
$jsWordcloud = true;
|
||||
}
|
||||
$voteUrl = 'index.php?id=' . $id;
|
||||
$voteName = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $voteUrl;
|
||||
?>
|
||||
|
||||
<div id="my_canvas">
|
||||
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
|
||||
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
|
||||
<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 id="my_canvas">
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$jsWordcloud = true;
|
||||
if ($nbWords > 0) {
|
||||
?>
|
||||
<details><summary><?php echo L::wordsList_title ?></summary>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo L::wordsList_word ?></th>
|
||||
<th><?php echo L::wordsList_count ?></th>
|
||||
<th><?php echo L::wordsList_percent ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($db->getWordsList($id) as $key => $word) {
|
||||
echo '<tr>';
|
||||
echo sprintf('<td>%s</td>', $word['word']);
|
||||
echo sprintf('<td>%.0f</td>', $word['count']);
|
||||
echo sprintf('<td>%.1f</td>', $word['percent']);
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</thead>
|
||||
</table>
|
||||
</details>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
include('templates/footer.php');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue