Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / bug_file_upload_inc.php
bloba0661404a6ef079d21726e9777d393dd4ad33d94
1 <?php
2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * This include file prints out the bug file upload form
19 * It POSTs to bug_file_add.php
21 * @package MantisBT
22 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
23 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
24 * @link http://www.mantisbt.org
26 * @uses collapse_api.php
27 * @uses config_api.php
28 * @uses file_api.php
29 * @uses form_api.php
30 * @uses lang_api.php
31 * @uses utility_api.php
34 require_api( 'collapse_api.php' );
35 require_api( 'config_api.php' );
36 require_api( 'file_api.php' );
37 require_api( 'form_api.php' );
38 require_api( 'lang_api.php' );
39 require_api( 'utility_api.php' );
41 # check if we can allow the upload... bail out if we can't
42 if ( !file_allow_bug_upload( $f_bug_id ) ) {
43 return false;
46 $t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
48 <br />
50 <?php
51 collapse_open( 'upload_form' );
53 <form method="post" enctype="multipart/form-data" action="bug_file_add.php">
54 <?php echo form_security_field( 'bug_file_add' ) ?>
56 <table class="width100" cellspacing="1">
57 <tr>
58 <td class="form-title" colspan="2">
59 <?php
60 collapse_icon( 'upload_form' );
61 echo lang_get( 'upload_file' ) ?>
62 </td>
63 </tr>
64 <tr class="row-1">
65 <td class="category" width="15%">
66 <?php echo lang_get( 'select_file' ) ?><br />
67 <?php //FIXME: hard coded "k" in here. ?>
68 <span class="small"><?php echo lang_get( 'max_file_size_label' ) . lang_get( 'word_separator' ) . number_format( $t_max_file_size/1000 ) ?>k</span>
69 </td>
70 <td width="85%">
71 <input type="hidden" name="bug_id" value="<?php echo $f_bug_id ?>" />
72 <input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
73 <input name="file" type="file" size="40" />
74 <input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' ) ?>" />
75 </td>
76 </tr>
77 </table>
78 </form>
79 <?php
80 collapse_closed( 'upload_form' );
82 <table class="width100" cellspacing="1">
83 <tr>
84 <td class="form-title" colspan="2">
85 <?php
86 collapse_icon( 'upload_form' );
87 echo lang_get( 'upload_file' ) ?>
88 </td>
89 </tr>
90 </table>
92 <?php
93 collapse_end( 'upload_form' );