<?php
/*
* Jirafeau, your web file repository
- * Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com>
+ * Copyright (C) 2013
+ * Jerome Jutteau <j.jutteau@gmail.com>
+ * Jimmy Beauvois <jimmy.beauvois@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
*/
define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
-require (JIRAFEAU_ROOT . 'lib/config.php');
+require (JIRAFEAU_ROOT . 'lib/config.original.php');
require (JIRAFEAU_ROOT . 'lib/settings.php');
require (JIRAFEAU_ROOT . 'lib/functions.php');
require (JIRAFEAU_ROOT . 'lib/lang.php');
check_errors ();
if (has_error ())
+{
show_errors ();
-
+ require (JIRAFEAU_ROOT . 'lib/template/footer.php');
+ exit;
+}
?>
<div id="upload_finished">
<p>
</div>
<div id="upload">
+<fieldset>
<legend>
- <?php echo t('Select a file'); ?> :
+ <?php echo t('Select a file'); ?>
</legend>
<p>
<input type="file" id="file_select" size="30"
document.getElementById('send').style.display = '';
"/>
</p>
- <p class="config">
- <?php echo t('Maximum file size') . ': ' . jirafeau_get_max_upload_size (); ?>
- </p>
- <p>
- <input type="submit" id="send" value="<?php echo t('Send'); ?>"
- onclick="
- document.getElementById('upload').style.display = 'none';
- document.getElementById('uploading').style.display = '';
- start_upload('<?php echo $cfg['web_root']; ?>');
- "/>
- </p>
+
<div id="options">
<table id="option_table">
<tr>
<option value = "month"><?php echo t('One month');?></option>
</select></td>
</tr>
+ <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 $cfg['web_root']; ?>', <?php echo jirafeau_get_max_upload_size_bytes (); ?>);
+ "/>
+ </p>
</table>
- </div>
+ </div> </fieldset>
</div>
+
<script lang="Javascript">
document.getElementById('uploading').style.display = 'none';
document.getElementById('upload_finished').style.display = 'none';
document.getElementById('options').style.display = 'none';
document.getElementById('send').style.display = 'none';
+ if (!check_html5_file_api ())
+ 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 ();
+ ?>';
</script>
<?php require (JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>