- <legend><?php echo _('Upload a file'); ?></legend>
- <p><input type="file" name="file" size="30" /></p>
- <p class="config"><?php printf(_('Maximum file size: %dMB'), jirafeau_get_max_upload_size()/(1024*1024)); ?></p>
- <p><input type="submit" value="<?php echo _('Send in the binary chaos'); ?>" /></p>
-
- <hr />
-
- <div id="moreoptions">
- <p><label><input type="checkbox" name="one_time_download" /> <?php echo _('One time download'); ?></label></p>
- <p><label for="input_key"><?php echo _('File key:'); ?></label> <input type="text" name="key" id="input_key" /></p>
- <p><label for="select_time"><?php echo _('Time limit:'); ?></label>
- <select name="time" id="select_time">
- <option value="none"><?php echo _('None'); ?></option>
- <option value="minute"><?php echo _('One minute'); ?></option>
- <option value="hour"><?php echo _('One hour'); ?></option>
- <option value="day"><?php echo _('One day'); ?></option>
- <option value="week"><?php echo _('One week'); ?></option>
- <option value="month"><?php echo _('One month'); ?></option>
- </select>
- </p>
- </div>
-</fieldset>
-</form>
+ <legend>
+ <?php echo t('SEL_FILE'); ?>
+ </legend>
+ <p>
+ <input type="file" id="file_select" size="30"
+ onchange="control_selected_file_size(<?php echo $cfg['maximal_upload_size'] ?>, '<?php
+ if ($cfg['maximal_upload_size'] >= 1024) {
+ echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . number_format($cfg['maximal_upload_size']/1024, 2) . " GB.";
+ } elseif ($cfg['maximal_upload_size'] > 0) {
+ echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . $cfg['maximal_upload_size'] . " MB.";
+ }
+ ?>')"/>
+ </p>
+
+ <div id="options">
+ <table id="option_table">
+ <?php
+ if ($cfg['one_time_download']) {
+ echo '<tr><td>' . t('ONE_TIME_DL') . ':</td>';
+ echo '<td><input type="checkbox" id="one_time_download" /></td></tr>';
+ }
+ ?>
+ <tr>
+ <td><label for="input_key"><?php echo t('PSW') . ':'; ?></label></td>
+ <td><input type="password" name="key" id="input_key" autocomplete = "new-password"/></td>
+ </tr>
+ <tr>
+ <td><label for="select_time"><?php echo t('TIME_LIM') . ':'; ?></label></td>
+ <td><select name="time" id="select_time">
+ <?php
+ $expirationTimeOptions = array(
+ array(
+ 'value' => 'minute',
+ 'label' => '1_MIN'
+ ),
+ array(
+ 'value' => 'hour',
+ 'label' => '1_H'
+ ),
+ array(
+ 'value' => 'day',
+ 'label' => '1_D'
+ ),
+ array(
+ 'value' => 'week',
+ 'label' => '1_W'
+ ),
+ array(
+ 'value' => 'fortnight',
+ 'label' => '2_W'
+ ),
+ array(
+ 'value' => 'month',
+ 'label' => '1_M'
+ ),
+ array(
+ 'value' => 'quarter',
+ 'label' => '1_Q'
+ ),
+ array(
+ 'value' => 'year',
+ 'label' => '1_Y'
+ ),
+ array(
+ 'value' => 'none',
+ 'label' => 'NONE'
+ )
+ );
+ foreach ($expirationTimeOptions as $expirationTimeOption) {
+ $selected = ($expirationTimeOption['value'] === $cfg['availability_default'])? 'selected="selected"' : '';
+ if (true === $cfg['availabilities'][$expirationTimeOption['value']]) {
+ echo '<option value="' . $expirationTimeOption['value'] . '" ' .
+ $selected . '>' . t($expirationTimeOption['label']) . '</option>';
+ }
+ }
+ ?>
+ </select></td>
+ </tr>
+
+ <?php
+ if ($cfg['maximal_upload_size'] >= 1024) {
+ echo '<p class="config">' . t('FILE_LIM');
+ echo " " . number_format($cfg['maximal_upload_size'] / 1024, 2) . " GB.</p>";
+ } elseif ($cfg['maximal_upload_size'] > 0) {
+ echo '<p class="config">' . t('FILE_LIM');
+ echo " " . $cfg['maximal_upload_size'] . " MB.</p>";
+ } else {
+ echo '<p class="config"></p>';
+ }
+ ?>
+
+ <p id="max_file_size" class="config"></p>
+ <p>
+ <input type="submit" id="send" value="<?php echo t('SEND'); ?>"
+ onclick="
+ document.getElementById('upload').style.display = 'none';
+ document.getElementById('uploading').style.display = '';
+ upload (<?php echo jirafeau_get_max_upload_chunk_size_bytes($cfg['max_upload_chunk_size_bytes']); ?>);
+ "/>
+ </p>
+ </table>
+ </div> </fieldset>
+
+ <?php
+ if (jirafeau_user_session_logged()) {
+ ?>
+ <form method="post" class="form logout">
+ <input type = "hidden" name = "action" value = "logout"/>
+ <input type = "submit" value = "<?php echo t('LOGOUT'); ?>" />
+ </form>
+ <?php
+ }
+ ?>
+