]> git.p6c8.net - jirafeau_mojo42.git/blob - index.php
use scripting interface to send files
[jirafeau_mojo42.git] / index.php
1 <?php
2 /*
3 * Jirafeau, your web file repository
4 * Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
20
21 require (JIRAFEAU_ROOT . 'lib/config.php');
22 require (JIRAFEAU_ROOT . 'lib/settings.php');
23 require (JIRAFEAU_ROOT . 'lib/functions.php');
24 require (JIRAFEAU_ROOT . 'lib/lang.php');
25 require (JIRAFEAU_ROOT . 'lib/template/header.php');
26
27 check_errors ();
28 if (has_error ())
29 show_errors ();
30
31 ?>
32 <div id="upload_finished">
33 <p>
34 <?php echo t('File uploaded! Copy the following URL to get it') ?>:
35 <br />
36 <a id="upload_link" href=""></a>
37 <br />
38 </p>
39
40 <p>
41 <?php echo t('Keep the following URL to delete it at any moment'); ?>:
42 <br />
43 <a id="delete_link" href=""></a>
44 </p>
45
46 <p id="validity">
47 <?php echo t('This file is valid until the following date'); ?>:
48 <br /><strong><div id="date"></div></strong>
49 </p>
50 </div>
51
52 <div id="uploading">
53 <p>
54 <?php echo t ('Uploading ...'); ?><div id="uploaded_percentage"></div>
55 </p>
56 </div>
57
58 <div id="upload">
59 <legend>
60 <?php echo t('Select a file'); ?> :
61 </legend>
62 <p>
63 <input type="file" id="file_select" size="30"
64 onchange="
65 document.getElementById('options').style.display = '';
66 document.getElementById('send').style.display = '';
67 "/>
68 </p>
69 <p class="config">
70 <?php echo t('Maximum file size') . ': ' . jirafeau_get_max_upload_size (); ?>
71 </p>
72 <p>
73 <input type="submit" id="send" value="<?php echo t('Send'); ?>"
74 onclick="
75 document.getElementById('upload').style.display = 'none';
76 document.getElementById('uploading').style.display = '';
77 start_upload('<?php echo $cfg['web_root']; ?>');
78 "/>
79 </p>
80 <div id="options">
81 <table id="option_table">
82 <tr>
83 <td><?php echo t('One time download'); ?>:</td>
84 <td><input type="checkbox" id="one_time_download" /></td>
85 </tr>
86 <tr>
87 <td><label for="input_key"><?php echo t('Password') . ':'; ?></label></td>
88 <td><input type="text" name="key" id="input_key" /></td>
89 </tr>
90 <tr>
91 <td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td>
92 <td><select name="time" id="select_time">
93 <option value="none"><?php echo t('None'); ?></option>
94 <option value = "minute"><?php echo t('One minute'); ?></option>
95 <option value = "hour"><?php echo t('One hour'); ?></option>
96 <option value = "day"><?php echo t('One day'); ?></option>
97 <option value = "week"><?php echo t('One week'); ?></option>
98 <option value = "month"><?php echo t('One month');?></option>
99 </select></td>
100 </tr>
101 </table>
102 </div>
103 </div>
104 <script lang="Javascript">
105 document.getElementById('uploading').style.display = 'none';
106 document.getElementById('upload_finished').style.display = 'none';
107 document.getElementById('options').style.display = 'none';
108 document.getElementById('send').style.display = 'none';
109 </script>
110 <?php require (JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>

patrick-canterino.de