[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/classes/ -> MantisCoreWikiPlugin.class.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  
   4  # Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.
   5  
   6  # MantisBT is free software: you can redistribute it and/or modify
   7  # it under the terms of the GNU General Public License as published by
   8  # the Free Software Foundation, either version 2 of the License, or
   9  # (at your option) any later version.
  10  #
  11  # MantisBT is distributed in the hope that it will be useful,
  12  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  # GNU General Public License for more details.
  15  #
  16  # You should have received a copy of the GNU General Public License
  17  # along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
  18  
  19  /**
  20   * Mantis Core Wiki Plugins
  21   * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
  22   * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
  23   * @link http://www.mantisbt.org
  24   * @package MantisBT
  25   */
  26  
  27  /**
  28   * requires MantisWikiPlugin.class
  29   */
  30  require_once ( 'MantisWikiPlugin.class.php' );
  31  
  32  /**
  33   * Base that uses the old style wiki definitions from config_inc.php
  34   * @package MantisBT
  35   * @subpackage classes
  36   */
  37  abstract class MantisCoreWikiPlugin extends MantisWikiPlugin {
  38  	function config() {
  39          return array(
  40              'root_namespace' => config_get_global( 'wiki_root_namespace' ),
  41              'engine_url' => config_get_global( 'wiki_engine_url' ),
  42          );
  43      }
  44  }
  45  
  46  /**
  47   * Basic Dokuwiki support with old-style wiki integration.
  48   * @package MantisBT
  49   * @subpackage classes
  50   */
  51  class MantisCoreDokuwikiPlugin extends MantisCoreWikiPlugin {
  52  
  53  	function register() {
  54          $this->name = 'MantisBT Dokuwiki Integration';
  55          $this->version = '0.1';
  56          $this->requires = array(
  57              'MantisCore' => '1.2.0',
  58          );
  59      }
  60  
  61  	function base_url( $p_project_id=null ) {
  62          $t_base = plugin_config_get( 'engine_url' ) . 'doku.php?id=';
  63  
  64          $t_namespace = plugin_config_get( 'root_namespace' );
  65          if ( !is_blank( $t_namespace ) ) {
  66              $t_base .= urlencode( $t_namespace ) . ':';
  67          }
  68  
  69          if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
  70              $t_base .= urlencode( project_get_name( $p_project_id ) ) . ':';
  71          }
  72          return $t_base;
  73      }
  74  
  75  	function link_bug( $p_event, $p_bug_id ) {
  76          return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) .  'issue:' . (int)$p_bug_id;
  77      }
  78  
  79  	function link_project( $p_event, $p_project_id ) {
  80          return $this->base_url( $p_project_id ) . 'start';
  81      }
  82  }
  83  
  84  /**
  85   * Basic MediaWiki support with old-style wiki integration.
  86   * @package MantisBT
  87   * @subpackage classes
  88   */
  89  class MantisCoreMediaWikiPlugin extends MantisCoreWikiPlugin {
  90  
  91  	function register() {
  92          $this->name = 'MantisBT MediaWiki Integration';
  93          $this->version = '0.1';
  94          $this->requires = array(
  95              'MantisCore' => '1.2.0',
  96          );
  97      }
  98  
  99  	function base_url( $p_project_id=null ) {
 100          $t_base = plugin_config_get( 'engine_url' ) . 'index.php/';
 101          if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
 102              $t_base .= urlencode( project_get_name( $p_project_id ) ) . ':';
 103          } else {
 104              $t_base .= urlencode( plugin_config_get( 'root_namespace' ) );
 105          }
 106          return $t_base;
 107      }
 108  
 109  	function link_bug( $p_event, $p_bug_id ) {
 110          return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . (int)$p_bug_id;
 111      }
 112  
 113  	function link_project( $p_event, $p_project_id ) {
 114          return $this->base_url( $p_project_id ) . 'Main_Page';
 115      }
 116  }
 117  
 118  /**
 119   * Basic Twiki support with old-style wiki integration.
 120   * @package MantisBT
 121   * @subpackage classes
 122   */
 123  class MantisCoreTwikiPlugin extends MantisCoreWikiPlugin {
 124  
 125  	function register() {
 126          $this->name = 'MantisBT Twiki Integration';
 127          $this->version = '0.1';
 128          $this->requires = array(
 129              'MantisCore' => '1.2.0',
 130          );
 131      }
 132  
 133  	function base_url( $p_project_id=null ) {
 134          $t_base = plugin_config_get( 'engine_url' );
 135  
 136          $t_namespace = plugin_config_get( 'root_namespace' );
 137          if ( !is_blank( $t_namespace ) ) {
 138              $t_base .= urlencode( $t_namespace ) . '/';
 139          }
 140  
 141          if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
 142              $t_base .= urlencode( project_get_name( $p_project_id ) ) . '/';
 143          }
 144          return $t_base;
 145      }
 146  
 147  	function link_bug( $p_event, $p_bug_id ) {
 148          return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . 'IssueNumber' . (int)$p_bug_id;
 149      }
 150  
 151  	function link_project( $p_event, $p_project_id ) {
 152          return $this->base_url( $p_project_id );
 153      }
 154  }
 155  
 156  /**
 157   * Basic WikkaWiki support with old-style wiki integration.
 158   * @package MantisBT
 159   * @subpackage classes
 160   */
 161  class MantisCoreWikkaWikiPlugin extends MantisCoreWikiPlugin {
 162  
 163  	function register() {
 164          $this->name = 'MantisBT WikkaWiki Integration';
 165          $this->version = '0.1';
 166          $this->requires = array(
 167              'MantisCore' => '1.2.0',
 168          );
 169      }
 170  
 171  	function base_url( $p_project_id=null ) {
 172          $t_base = plugin_config_get( 'engine_url' ) . 'wikka.php?wakka=';
 173  
 174          $t_namespace = ucfirst( plugin_config_get( 'root_namespace' ) );
 175          if ( !is_blank( $t_namespace ) ) {
 176              $t_base .= urlencode( $t_namespace );
 177          }
 178  
 179          if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
 180              $t_base .= urlencode( project_get_name( $p_project_id ) );
 181          }
 182          return $t_base;
 183      }
 184  
 185  	function link_bug( $p_event, $p_bug_id ) {
 186          return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . 'Issue' . (int)$p_bug_id;
 187      }
 188  
 189  	function link_project( $p_event, $p_project_id ) {
 190          return $this->base_url( $p_project_id ) . 'Start';
 191      }
 192  }
 193  
 194  /**
 195   * Basic Xwiki support with old-style wiki integration.
 196   * @package MantisBT
 197   * @subpackage classes
 198   */
 199  class MantisCoreXwikiPlugin extends MantisCoreWikiPlugin {
 200  
 201  	function register() {
 202          $this->name = 'MantisBT Xwiki Integration';
 203          $this->version = '0.1';
 204          $this->requires = array(
 205              'MantisCore' => '1.2.0',
 206          );
 207      }
 208  
 209  	function base_url( $p_project_id=null ) {
 210          $t_base = plugin_config_get( 'engine_url' );
 211          if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
 212              $t_base .= urlencode( project_get_name( $p_project_id ) ) . '/';
 213          } else {
 214              $t_base .= urlencode( plugin_config_get( 'root_namespace' ) );
 215          }
 216          return $t_base;
 217      }
 218  
 219  	function link_bug( $p_event, $p_bug_id ) {
 220          return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) .  (int)$p_bug_id;
 221      }
 222  
 223  	function link_project( $p_event, $p_project_id ) {
 224          return $this->base_url( $p_project_id ) . 'Main_Page';
 225      }
 226  }


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