[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> adm_config_report.php (source)

   1  <?php
   2  # Mantis - a php based bugtracking system
   3  
   4  # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   5  # Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   6  
   7  # Mantis is free software: you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation, either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Mantis is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
  19  
  20      # --------------------------------------------------------
  21      # $Id: adm_config_report.php,v 1.9.2.1 2007-10-13 22:32:25 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      require_once ( 'core.php' );
  25  
  26      access_ensure_project_level( config_get( 'view_configuration_threshold' ) );
  27  
  28      $t_core_path = config_get( 'core_path' );
  29  
  30      html_page_top1( lang_get( 'configuration_report' ) );
  31      html_page_top2();
  32  
  33      print_manage_menu( 'adm_config_report.php' );
  34      print_manage_config_menu( 'adm_config_report.php' );
  35  
  36  	function get_config_type( $p_type ) {
  37          switch( $p_type ) {
  38              case CONFIG_TYPE_INT:
  39                  return "integer";
  40              case CONFIG_TYPE_COMPLEX:
  41                  return "complex";
  42              case CONFIG_TYPE_STRING:
  43              default:
  44                  return "string";
  45          }
  46      }
  47  
  48  	function print_config_value_as_string( $p_type, $p_value ) {
  49          switch( $p_type ) {
  50              case CONFIG_TYPE_INT:
  51                  $t_value = (integer)$p_value;
  52                  echo $t_value;
  53                  return;
  54              case CONFIG_TYPE_STRING:
  55                  $t_value = config_eval( $p_value );
  56                  echo string_nl2br( string_html_specialchars( "'$t_value'" ) );
  57                  return;
  58              case CONFIG_TYPE_COMPLEX:
  59                  $t_value = unserialize( $p_value );
  60                  break;
  61              default:
  62                  $t_value = config_eval( $p_value );
  63                  break;
  64          }
  65          
  66          echo '<pre>';
  67          if ( function_exists( 'var_export' ) ) {
  68              var_export( $t_value );
  69          } else {
  70              print_r( $t_value );
  71          }
  72          echo '</pre>';
  73      }
  74  
  75      $t_config_table = config_get_global( 'mantis_config_table' );
  76      $query = "SELECT config_id, user_id, project_id, type, value, access_reqd FROM $t_config_table ORDER BY user_id, project_id, config_id";
  77      $result = db_query( $query );
  78  ?>
  79  <br />
  80  <div align="center">
  81  <table class="width100" cellspacing="1">
  82  
  83  <!-- Title -->
  84  <tr>
  85      <td class="form-title" colspan="3">
  86          <?php echo lang_get( 'database_configuration' ) ?>
  87      </td>
  88  </tr>
  89          <tr class="row-category">
  90              <td class="center">
  91                  <?php echo lang_get( 'username' ) ?>
  92              </td>
  93              <td class="center">
  94                  <?php echo lang_get( 'project_name' ) ?>
  95              </td>
  96              <td>
  97                  <?php echo lang_get( 'configuration_option' ) ?>
  98              </td>
  99              <td class="center">
 100                  <?php echo lang_get( 'configuration_option_type' ) ?>
 101              </td>
 102              <td class="center">
 103                  <?php echo lang_get( 'configuration_option_value' ) ?>
 104              </td>
 105              <td class="center">
 106                  <?php echo lang_get( 'access_level' ) ?>
 107              </td>
 108              <td class="center">
 109                  <?php echo lang_get( 'actions' ) ?>
 110              </td>
 111          </tr>
 112  <?php
 113      while ( $row = db_fetch_array( $result ) ) {
 114          extract( $row, EXTR_PREFIX_ALL, 'v' );
 115  
 116  ?>
 117  <!-- Repeated Info Rows -->
 118          <tr <?php echo helper_alternate_class() ?> valign="top">
 119              <td class="center">
 120                  <?php echo ($v_user_id == 0) ? lang_get( 'all_users' ) : user_get_name( $v_user_id ) ?>
 121              </td>
 122              <td class="center">
 123                  <?php echo project_get_name( $v_project_id ) ?>
 124              </td>
 125              <td>
 126                  <?php echo string_display( $v_config_id ) ?>
 127              </td>
 128              <td class="center">
 129                  <?php echo string_display( get_config_type( $v_type ) ) ?>
 130              </td>
 131              <td class="left">
 132                  <?php print_config_value_as_string( $v_type, $v_value ) ?>
 133              </td>
 134              <td class="center">
 135                  <?php echo get_enum_element( 'access_levels', $v_access_reqd ) ?>
 136              </td>
 137              <td class="center">
 138                  <?php
 139                      if ( config_can_delete( $v_config_id ) ) {
 140                          print_button( 'adm_config_delete.php?user_id=' . $v_user_id . '&amp;project_id=' . $v_project_id . '&amp;config_option=' . $v_config_id, lang_get( 'delete_link' ) );
 141                      } else {
 142                          echo '&nbsp;';
 143                      }
 144                  ?>
 145              </td>
 146          </tr>
 147  <?php
 148      } # end for loop
 149  ?>
 150  </table>
 151  <br />
 152  <!-- Config Set Form -->
 153  <table class="width100" cellspacing="1">
 154  
 155  <!-- Title -->
 156  <tr>
 157      <td class="form-title" colspan="2">
 158          <?php echo lang_get( 'set_configuration_option' ) ?>
 159      </td>
 160  </tr>
 161          <form method="post" action="adm_config_set.php">
 162  <tr <?php echo helper_alternate_class() ?> valign="top">
 163      <td>
 164          <?php echo lang_get( 'username' ) ?>
 165      </td>
 166      <td>
 167          <select name="user_id">
 168              <option value="0" selected="selected"><?php echo lang_get( 'all_users' ); ?></option>
 169              <?php print_user_option_list( auth_get_current_user_id() ) ?>
 170          </select>
 171      </td>
 172  </tr>
 173  <tr <?php echo helper_alternate_class() ?> valign="top">
 174      <td>
 175          <?php echo lang_get( 'project_name' ) ?>
 176      </td>
 177      <td>
 178          <select name="project_id">
 179              <option value="0" selected="selected"><?php echo lang_get( 'all_projects' ); ?></option>
 180              <?php print_project_option_list( ALL_PROJECTS, false ) ?>" />
 181          </select>
 182      </td>
 183  </tr>
 184  <tr <?php echo helper_alternate_class() ?> valign="top">
 185      <td>
 186          <?php echo lang_get( 'configuration_option' ) ?>
 187      </td>
 188      <td>
 189              <input type="text" name="config_option" value="" size="64" maxlength="64" />
 190      </td>
 191  </tr>
 192  <tr <?php echo helper_alternate_class() ?> valign="top">
 193      <td>
 194          <?php echo lang_get( 'configuration_option_type' ) ?>
 195      </td>
 196      <td>
 197          <select name="type">
 198              <option value="default" selected="selected">default</option>
 199              <option value="string">string</option>
 200              <option value="integer">integer</option>
 201              <option value="complex">complex</option>
 202          </select>
 203      </td>
 204  </tr>
 205  <tr <?php echo helper_alternate_class() ?> valign="top">
 206      <td>
 207          <?php echo lang_get( 'configuration_option_value' ) ?>
 208      </td>
 209      <td>
 210              <textarea name="value" cols="80" rows="10"></textarea>
 211      </td>
 212  </tr>
 213  <tr>
 214      <td colspan="2">
 215              <input type="submit" name="config_set" class="button" value="<?php echo lang_get( 'set_configuration_option' ) ?>" />
 216      </td>
 217  </tr>
 218          </form>
 219  </table>
 220  </div>
 221  <?php
 222      html_page_bottom1( __FILE__ );
 223  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics