git.p6c8.net
/
jirafeau_project.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[TASK] set a translation string id for each element
[jirafeau_project.git]
/
index.php
diff --git
a/index.php
b/index.php
index 09b37e4f00824acd17f5e69dd22baa67b6d24146..ec7aac43f2ca1b43866b0ebfb91d57540e9b9090 100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-18,6
+18,7
@@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+session_start();
define('JIRAFEAU_ROOT', dirname(__FILE__) . '/');
require(JIRAFEAU_ROOT . 'lib/settings.php');
define('JIRAFEAU_ROOT', dirname(__FILE__) . '/');
require(JIRAFEAU_ROOT . 'lib/settings.php');
@@
-38,8
+39,6
@@
require(JIRAFEAU_ROOT . 'lib/template/header.php');
if (true === jirafeau_challenge_upload_ip($cfg['upload_ip'], get_ip_address($cfg))) {
// Is an upload password required?
if (jirafeau_has_upload_password($cfg)) {
if (true === jirafeau_challenge_upload_ip($cfg['upload_ip'], get_ip_address($cfg))) {
// Is an upload password required?
if (jirafeau_has_upload_password($cfg)) {
- session_start();
-
// Logout action
if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
session_unset();
// Logout action
if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
session_unset();
@@
-53,30
+52,30
@@
if (true === jirafeau_challenge_upload_ip($cfg['upload_ip'], get_ip_address($cfg
$_SESSION['user_upload_password'] = $_POST['upload_password'];
} else {
$_SESSION['admin_auth'] = false;
$_SESSION['user_upload_password'] = $_POST['upload_password'];
} else {
$_SESSION['admin_auth'] = false;
- jirafeau_fatal_error(t('
Wrong password.
'), $cfg);
+ jirafeau_fatal_error(t('
BAD_PSW
'), $cfg);
}
}
// Show login form if user session is not authorized yet
if (true === empty($_SESSION['upload_auth'])) {
?>
}
}
// Show login form if user session is not authorized yet
if (true === empty($_SESSION['upload_auth'])) {
?>
- <form method="post">
+ <form method="post"
class="form login"
>
<fieldset>
<table>
<tr>
<td class = "label"><label for = "enter_password">
<fieldset>
<table>
<tr>
<td class = "label"><label for = "enter_password">
- <?php echo t('U
pload password
') . ':'; ?></label>
+ <?php echo t('U
P_PSW
') . ':'; ?></label>
</td>
</td>
+ </tr><tr>
<td class = "field"><input type = "password"
name = "upload_password" id = "upload_password"
size = "40" />
</td>
</tr>
<tr class = "nav">
<td class = "field"><input type = "password"
name = "upload_password" id = "upload_password"
size = "40" />
</td>
</tr>
<tr class = "nav">
- <td></td>
<td class = "nav next">
<input type = "submit" name = "key" value =
<td class = "nav next">
<input type = "submit" name = "key" value =
- "<?php echo t('L
ogin
'); ?>" />
+ "<?php echo t('L
OGIN
'); ?>" />
</td>
</tr>
</table>
</td>
</tr>
</table>
@@
-89,49
+88,63
@@
if (true === jirafeau_challenge_upload_ip($cfg['upload_ip'], get_ip_address($cfg
}
}
else {
}
}
else {
- jirafeau_fatal_error(t('A
ccess denied
'), $cfg);
+ jirafeau_fatal_error(t('A
CCESS_KO
'), $cfg);
}
?>
<div id="upload_finished">
}
?>
<div id="upload_finished">
- <p><?php echo t('F
ile uploaded !
') ?></p>
+ <p><?php echo t('F
ILE_UP
') ?></p>
<div id="upload_finished_download_page">
<p>
<div id="upload_finished_download_page">
<p>
- <?php echo t('Download page') ?>
- <a id="upload_link_email" href=""><img id="upload_image_email"/></a>
+ <a id="upload_link" href=""><?php echo t('DL_PAGE') ?></a>
+ <a id="upload_link_email" href=""><img id="upload_image_email"/></a>
+ </p><p>
+ <code id=upload_link_text></code>
+ <button id="upload_link_button">✂</button>
</p>
</p>
- <p><a id="upload_link" href=""></a></p>
</div>
<?php if ($cfg['preview'] == true) {
?>
<div id="upload_finished_preview">
</div>
<?php if ($cfg['preview'] == true) {
?>
<div id="upload_finished_preview">
- <p><?php echo t('View link') ?>:</p>
- <p><a id="preview_link" href=""></a></p>
+ <p>
+ <a id="preview_link" href=""><?php echo t('VIEW_LINK') ?></a>
+ </p><p>
+ <code id=preview_link_text></code>
+ <button id="preview_link_button">✂</button>
+ </p>
</div>
<?php
} ?>
<div id="upload_direct_download">
</div>
<?php
} ?>
<div id="upload_direct_download">
- <p><?php echo t('Direct download link') ?>:</p>
- <p><a id="direct_link" href=""></a></p>
+ <p>
+ <a id="direct_link" href=""><?php echo t('DIRECT_DL') ?></a>
+ </p><p>
+ <code id=direct_link_text></code>
+ <button id="direct_link_button">✂</button>
+ </p>
</div>
</div>
- <div>
- <p><?php echo t('Delete link') ?>:</p>
- <p><a id="delete_link" href=""></a></p>
+ <div id="upload_delete">
+ <p>
+ <a id="delete_link" href=""><?php echo t('DELETE_LINK') ?></a>
+ </p><p>
+ <code id=delete_link_text></code>
+ <button id="delete_link_button">✂</button>
+ </p>
</div>
</div>
- <div id="validity">
- <p><?php echo t('
This file is valid until the following date
'); ?>:</p>
+ <div id="
upload_
validity">
+ <p><?php echo t('
VALID_UNTIL
'); ?>:</p>
<p id="date"></p>
</div>
</div>
<div id="uploading">
<p>
<p id="date"></p>
</div>
</div>
<div id="uploading">
<p>
- <?php echo t('U
ploading ...
'); ?>
+ <?php echo t('U
P
'); ?>
<div id="uploaded_percentage"></div>
<div id="uploaded_speed"></div>
<div id="uploaded_time"></div>
<div id="uploaded_percentage"></div>
<div id="uploaded_speed"></div>
<div id="uploaded_time"></div>
@@
-144,59
+157,59
@@
else {
<div id="upload">
<fieldset>
<legend>
<div id="upload">
<fieldset>
<legend>
- <?php echo t('S
elect a file
'); ?>
+ <?php echo t('S
EL_FILE
'); ?>
</legend>
<p>
<input type="file" id="file_select" size="30"
</legend>
<p>
<input type="file" id="file_select" size="30"
- onchange="control_selected_file_size(<?php echo $cfg['maximal_upload_size'] ?>, '<?php echo t('
File is too big') . ', ' . t('File size is limited to
') . " " . $cfg['maximal_upload_size'] . " MB"; ?>')"/>
+ onchange="control_selected_file_size(<?php echo $cfg['maximal_upload_size'] ?>, '<?php echo t('
2_BIG') . ', ' . t('FILE_LIM
') . " " . $cfg['maximal_upload_size'] . " MB"; ?>')"/>
</p>
<div id="options">
<table id="option_table">
<tr>
</p>
<div id="options">
<table id="option_table">
<tr>
- <td><?php echo t('O
ne time download
'); ?>:</td>
+ <td><?php echo t('O
NE_TIME_DL
'); ?>:</td>
<td><input type="checkbox" id="one_time_download" /></td>
</tr>
<tr>
<td><input type="checkbox" id="one_time_download" /></td>
</tr>
<tr>
- <td><label for="input_key"><?php echo t('P
assword
') . ':'; ?></label></td>
+ <td><label for="input_key"><?php echo t('P
SW
') . ':'; ?></label></td>
<td><input type="text" name="key" id="input_key" /></td>
</tr>
<tr>
<td><input type="text" name="key" id="input_key" /></td>
</tr>
<tr>
- <td><label for="select_time"><?php echo t('T
ime limit
') . ':'; ?></label></td>
+ <td><label for="select_time"><?php echo t('T
IME_LIM
') . ':'; ?></label></td>
<td><select name="time" id="select_time">
<?php
$expirationTimeOptions = array(
array(
'value' => 'minute',
<td><select name="time" id="select_time">
<?php
$expirationTimeOptions = array(
array(
'value' => 'minute',
- 'label' => '
One minute
'
+ 'label' => '
1_MIN
'
),
array(
'value' => 'hour',
),
array(
'value' => 'hour',
- 'label' => '
One hour
'
+ 'label' => '
1_H
'
),
array(
'value' => 'day',
),
array(
'value' => 'day',
- 'label' => '
One day
'
+ 'label' => '
1_D
'
),
array(
'value' => 'week',
),
array(
'value' => 'week',
- 'label' => '
One week
'
+ 'label' => '
1_W
'
),
array(
'value' => 'month',
),
array(
'value' => 'month',
- 'label' => '
One month
'
+ 'label' => '
1_M
'
),
array(
'value' => 'quarter',
),
array(
'value' => 'quarter',
- 'label' => '
One quarter
'
+ 'label' => '
1_Q
'
),
array(
'value' => 'year',
),
array(
'value' => 'year',
- 'label' => '
One year
'
+ 'label' => '
1_Y
'
),
array(
'value' => 'none',
),
array(
'value' => 'none',
- 'label' => 'N
one
'
+ 'label' => 'N
ONE
'
)
);
foreach ($expirationTimeOptions as $expirationTimeOption) {
)
);
foreach ($expirationTimeOptions as $expirationTimeOption) {
@@
-212,7
+225,7
@@
else {
<?php
if ($cfg['maximal_upload_size'] > 0) {
<?php
if ($cfg['maximal_upload_size'] > 0) {
- echo '<p class="config">' . t('F
ile size is limited to
');
+ echo '<p class="config">' . t('F
ILE_LIM
');
echo " " . $cfg['maximal_upload_size'] . " MB</p>";
}
?>
echo " " . $cfg['maximal_upload_size'] . " MB</p>";
}
?>
@@
-232,11
+245,11
@@
else {
}
?>
}
?>
- <input type="submit" id="send" value="<?php echo t('S
end
'); ?>"
+ <input type="submit" id="send" value="<?php echo t('S
END
'); ?>"
onclick="
document.getElementById('upload').style.display = 'none';
document.getElementById('uploading').style.display = '';
onclick="
document.getElementById('upload').style.display = 'none';
document.getElementById('uploading').style.display = '';
- upload (
'<?php echo $cfg['web_root']; ?>',
<?php echo jirafeau_get_max_upload_size_bytes(); ?>);
+ upload (<?php echo jirafeau_get_max_upload_size_bytes(); ?>);
"/>
</p>
</table>
"/>
</p>
</table>
@@
-245,9
+258,9
@@
else {
<?php
if (jirafeau_has_upload_password($cfg)) {
?>
<?php
if (jirafeau_has_upload_password($cfg)) {
?>
- <form method="post">
+ <form method="post"
class="form logout"
>
<input type = "hidden" name = "action" value = "logout"/>
<input type = "hidden" name = "action" value = "logout"/>
- <input type = "submit" value = "<?php echo t('L
ogout
'); ?>" />
+ <input type = "submit" value = "<?php echo t('L
OGOUT
'); ?>" />
</form>
<?php
</form>
<?php
@@
-266,5
+279,10
@@
else {
document.getElementById('max_file_size').innerHTML = '<?php
echo t('You browser may not support HTML5 so the maximum file size is ') . jirafeau_get_max_upload_size();
?>';
document.getElementById('max_file_size').innerHTML = '<?php
echo t('You browser may not support HTML5 so the maximum file size is ') . jirafeau_get_max_upload_size();
?>';
+
+ addCopyListener('upload_link_button', 'upload_link');
+ addCopyListener('preview_link_button', 'preview_link');
+ addCopyListener('direct_link_button', 'direct_link');
+ addCopyListener('delete_link_button', 'delete_link');
</script>
<?php require(JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>
</script>
<?php require(JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>
patrick-canterino.de