[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/plugins/MantisGraph/pages/ -> config_edit.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  # Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
   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  form_security_validate( 'plugin_graph_config_edit' );
  18  
  19  auth_reauthenticate( );
  20  access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
  21  
  22  $f_library = gpc_get_int( 'eczlibrary', ON );
  23  
  24  $f_window_width = gpc_get_int( 'window_width', 800 );
  25  $f_bar_aspect = (float) gpc_get_string( 'bar_aspect', '0.9' );
  26  $f_summary_graphs_per_row = gpc_get_int( 'summary_graphs_per_row', 2 );
  27  
  28  $f_jpgraph_antialias = gpc_get_int( 'jpgraph_antialias', ON );
  29  $f_font = gpc_get_string( 'font', '' );
  30  
  31  if ( plugin_config_get( 'eczlibrary' ) != $f_library ) {
  32      plugin_config_set( 'eczlibrary', $f_library );
  33  }
  34  
  35  if ( plugin_config_get( 'window_width' ) != $f_window_width ) {
  36      plugin_config_set( 'window_width', $f_window_width );
  37  }
  38  
  39  if ( plugin_config_get( 'bar_aspect' ) != $f_bar_aspect ) {
  40      plugin_config_set( 'bar_aspect', $f_bar_aspect );
  41  }
  42  
  43  if ( plugin_config_get( 'summary_graphs_per_row' ) != $f_summary_graphs_per_row ) {
  44      plugin_config_set( 'summary_graphs_per_row', $f_summary_graphs_per_row );
  45  }
  46  
  47  if ( plugin_config_get( 'font' ) != $f_font ) {
  48      switch ( $f_font ) {
  49          case 'arial':
  50          case 'verdana':
  51          case 'trebuchet':
  52          case 'verasans':
  53          case 'times':
  54          case 'georgia':
  55          case 'veraserif':
  56          case 'courier':
  57          case 'veramono':
  58              plugin_config_set( 'font', $f_font );
  59              break;
  60          default:
  61              plugin_config_set( 'font', 'arial' );
  62      }
  63  }
  64  
  65  if ( current_user_is_administrator() ) {
  66      $f_jpgraph_path = gpc_get_string( 'jpgraph_path', '' );
  67      if ( plugin_config_get( 'jpgraph_path' ) != $f_jpgraph_path ) {
  68          plugin_config_set( 'jpgraph_path', $f_jpgraph_path );
  69      }
  70  }
  71  
  72  if ( plugin_config_get( 'jpgraph_antialias' ) != $f_jpgraph_antialias ) {
  73      plugin_config_set( 'jpgraph_antialias', $f_jpgraph_antialias );
  74  }
  75  
  76  form_security_purge( 'plugin_graph_config_edit' );
  77  
  78  print_successful_redirect( plugin_page( 'config', true ) );


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7