[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/ -> bug_file_upload_inc.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  
   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.
   8  #
   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.
  13  #
  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/>.
  16  
  17  /**
  18   * This include file prints out the bug file upload form
  19   * It POSTs to bug_file_add.php
  20   *
  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
  25   *
  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
  32   */
  33  
  34  if ( !defined( 'BUG_FILE_UPLOAD_INC_ALLOW' ) ) {
  35      return;
  36  }
  37  
  38  require_api( 'collapse_api.php' );
  39  require_api( 'config_api.php' );
  40  require_api( 'file_api.php' );
  41  require_api( 'form_api.php' );
  42  require_api( 'lang_api.php' );
  43  require_api( 'utility_api.php' );
  44  
  45  # check if we can allow the upload... bail out if we can't
  46  if ( !file_allow_bug_upload( $f_bug_id ) ) {
  47      return false;
  48  }
  49  
  50  $t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
  51  ?>
  52  <br />
  53  
  54  <?php
  55      collapse_open( 'upload_form' );
  56  ?>
  57  <form method="post" enctype="multipart/form-data" action="bug_file_add.php">
  58  <?php echo form_security_field( 'bug_file_add' ) ?>
  59  
  60  <table class="width100" cellspacing="1">
  61  <tr>
  62      <td class="form-title" colspan="2">
  63  <?php
  64          collapse_icon( 'upload_form' );
  65          echo lang_get( 'upload_file' ) ?>
  66      </td>
  67  </tr>
  68  <tr class="row-1">
  69      <td class="category" width="15%">
  70          <?php echo lang_get( 'select_file' ) ?><br />
  71          <?php //FIXME: hard coded "k" in here. ?>
  72          <span class="small"><?php echo lang_get( 'max_file_size_label' ) . lang_get( 'word_separator' ) . number_format( $t_max_file_size/1000 ) ?>k</span>
  73      </td>
  74      <td width="85%">
  75          <input type="hidden" name="bug_id" value="<?php echo $f_bug_id ?>" />
  76          <input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
  77          <input name="file" type="file" size="40" />
  78          <input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' ) ?>" />
  79      </td>
  80  </tr>
  81  </table>
  82  </form>
  83  <?php
  84  collapse_closed( 'upload_form' );
  85  ?>
  86  <table class="width100" cellspacing="1">
  87  <tr>
  88      <td class="form-title" colspan="2">
  89          <?php
  90              collapse_icon( 'upload_form' );
  91              echo lang_get( 'upload_file' ) ?>
  92      </td>
  93  </tr>
  94  </table>
  95  
  96  <?php
  97  collapse_end( 'upload_form' );


Generated: Sat Mar 6 17:17:35 2010 Cross-referenced by PHPXref 0.7