[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/core/ -> wiki_xwiki_api.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: wiki_xwiki_api.php,v 1.1.2.1 2007-10-13 22:35:51 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      # ----------------------
  25      # Gets the URL for the page with the specified page id.  This function is used
  26      # internally by this API.
  27  	function wiki_xwiki_get_url_for_page_id( $p_page_id ) {
  28          $t_root_url = config_get_global( 'wiki_engine_url' );
  29          return $t_root_url . $p_page_id ;
  30      }
  31   
  32      # ----------------------
  33      # Gets the page id for the specified issue.  The page id can then be converted
  34      # to a URL using wiki_xwiki_get_url_for_page_id().
  35  	function wiki_xwiki_get_page_id_for_issue( $p_issue_id ) {
  36           
  37          $t_project_id = project_get_name (bug_get_field( $p_issue_id, 'project_id' ));
  38          $c_issue_id = db_prepare_int( $p_issue_id );
  39          return $c_issue_id;
  40           return $t_project_id.'/'.$c_issue_id;
  41      }
  42   
  43       # ----------------------
  44      # Gets the page url for the specified issue id.
  45  	function wiki_xwiki_get_url_for_issue( $p_issue_id ) {
  46          return wiki_xwiki_get_url_for_page_id( wiki_xwiki_get_page_id_for_issue( $p_issue_id ) );
  47      }
  48   
  49      # ----------------------
  50      # Gets the page id for the specified project.  The project id can be ALL_PROJECTS
  51      # The page id can then be converted to URL using wiki_xwiki_get_url_for_page_id().
  52  	function wiki_xwiki_get_page_id_for_project( $p_project_id ) {
  53          if ( $p_project_id == ALL_PROJECTS ) {
  54              return config_get( 'wiki_root_namespace' );
  55          } else {
  56              $t_project_name = project_get_name( $p_project_id );
  57              return $t_project_name;
  58          }
  59      }
  60   
  61       # ----------------------
  62      # Get URL for the specified project id.  The project is can be ALL_PROJECTS.
  63  	function wiki_xwiki_get_url_for_project( $p_project_id ) {
  64          return wiki_xwiki_get_url_for_page_id( wiki_xwiki_get_page_id_for_project( $p_project_id ) );
  65      }
  66  ?>


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