[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/plugins/MantisGraph/ -> MantisGraph.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  class MantisGraphPlugin extends MantisPlugin  {
  18  
  19      /**
  20       *  A method that populates the plugin information and minimum requirements.
  21       */
  22  	function register( ) {
  23          $this->name = lang_get( 'plugin_graph_title' );
  24          $this->description = lang_get( 'plugin_graph_description' );
  25          $this->page = 'config';
  26  
  27          $this->version = '1.0';
  28          $this->requires = array(
  29              'MantisCore' => '1.2.0',
  30          );
  31  
  32          $this->author = 'MantisBT Team';
  33          $this->contact = 'mantisbt-dev@lists.sourceforge.net';
  34          $this->url = 'http://www.mantisbt.org';
  35      }
  36  
  37      /**
  38       * Default plugin configuration.
  39       */
  40  	function config() {
  41          return array(
  42              'eczlibrary' => ON,
  43  
  44              'window_width' => 800,
  45              'bar_aspect' => 0.9,
  46              'summary_graphs_per_row' => 2,
  47              'font' => 'arial',
  48  
  49              'jpgraph_path' => '',
  50              'jpgraph_antialias' => ON,
  51          );
  52      }
  53  
  54  	function init() {
  55          //mantisgraph_autoload();
  56          spl_autoload_register( array( 'MantisGraphPlugin', 'autoload' ) );
  57  
  58          $t_path = config_get_global('plugin_path' ). plugin_get_current() . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR;
  59  
  60          set_include_path(get_include_path() . PATH_SEPARATOR . $t_path);
  61      }
  62  
  63  	public static function autoload( $className ) {
  64          if (class_exists( 'ezcBase' ) ) {
  65              ezcBase::autoload( $className );
  66          }
  67      }
  68  
  69  	function hooks( ) {
  70          $hooks = array(
  71              'EVENT_MENU_SUMMARY' => 'summary_menu',
  72              'EVENT_SUBMENU_SUMMARY' => 'summary_submenu',
  73              'EVENT_MENU_FILTER' => 'graph_filter_menu',
  74          );
  75          return $hooks;
  76      }
  77  
  78  	function summary_menu( ) {
  79          return array( '<a href="' . plugin_page( 'summary_jpgraph_page' ) . '">' . plugin_lang_get( 'menu_advanced_summary' ) . '</a>', );
  80      }
  81  
  82  	function graph_filter_menu( ) {
  83          return array( '<a href="' . plugin_page( 'bug_graph_page.php' ) . '">' . plugin_lang_get( 'graph_bug_page_link' ) . '</a>', );
  84      }
  85  
  86  	function summary_submenu( ) {
  87          $t_icon_path = config_get( 'icon_path' );
  88          return array( '<a href="' . helper_mantis_url( 'summary_page.php' ) . '"><img src="' . $t_icon_path . 'synthese.gif" alt="" />' . plugin_lang_get( 'synthesis_link' ) . '</a>',
  89              '<a href="' . plugin_page( 'summary_graph_imp_status.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . plugin_lang_get( 'status_link' ) . '</a>',
  90              '<a href="' . plugin_page( 'summary_graph_imp_priority.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . plugin_lang_get( 'priority_link' ) . '</a>',
  91              '<a href="' . plugin_page( 'summary_graph_imp_severity.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . plugin_lang_get( 'severity_link' ) . '</a>',
  92              '<a href="' . plugin_page( 'summary_graph_imp_category.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . plugin_lang_get( 'category_link' ) . '</a>',
  93              '<a href="' . plugin_page( 'summary_graph_imp_resolution.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . plugin_lang_get( 'resolution_link' ) . '</a>',
  94           );
  95      }
  96  
  97  }
  98  
  99  function mantisgraph_autoload() {
 100  }


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