From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/api/ApiExpandTemplates.php | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'includes/api/ApiExpandTemplates.php') diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index d0c00db7..6f2df1b8 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -1,11 +1,10 @@ @gmail.com + * Created on Oct 05, 2007 + * + * Copyright © 2007 Yuri Astrakhan @gmail.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,13 +18,15 @@ * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html + * + * @file */ if ( !defined( 'MEDIAWIKI' ) ) { // Eclipse helper - will be ignored in production - require_once ( "ApiBase.php" ); + require_once( "ApiBase.php" ); } /** @@ -38,7 +39,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { class ApiExpandTemplates extends ApiBase { public function __construct( $main, $action ) { - parent :: __construct( $main, $action ); + parent::__construct( $main, $action ); } public function execute() { @@ -49,18 +50,18 @@ class ApiExpandTemplates extends ApiBase { $params = $this->extractRequestParams(); // Create title for parser - $title_obj = Title :: newFromText( $params['title'] ); - if ( !$title_obj ) - $title_obj = Title :: newFromText( "API" ); // default + $title_obj = Title::newFromText( $params['title'] ); + if ( !$title_obj ) { + $title_obj = Title::newFromText( 'API' ); // default + } $result = $this->getResult(); // Parse text global $wgParser; $options = new ParserOptions(); - - if ( $params['generatexml'] ) - { + + if ( $params['generatexml'] ) { $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS ); $dom = $wgParser->preprocessToDom( $params['text'] ); if ( is_callable( array( $dom, 'saveXML' ) ) ) { @@ -81,9 +82,9 @@ class ApiExpandTemplates extends ApiBase { } public function getAllowedParams() { - return array ( + return array( 'title' => array( - ApiBase :: PARAM_DFLT => 'API', + ApiBase::PARAM_DFLT => 'API', ), 'text' => null, 'generatexml' => false, @@ -91,7 +92,7 @@ class ApiExpandTemplates extends ApiBase { } public function getParamDescription() { - return array ( + return array( 'text' => 'Wikitext to convert', 'title' => 'Title of page', 'generatexml' => 'Generate XML parse tree', @@ -103,12 +104,12 @@ class ApiExpandTemplates extends ApiBase { } protected function getExamples() { - return array ( + return array( 'api.php?action=expandtemplates&text={{Project:Sandbox}}' ); } public function getVersion() { - return __CLASS__ . ': $Id: ApiExpandTemplates.php 69932 2010-07-26 08:03:21Z tstarling $'; + return __CLASS__ . ': $Id: ApiExpandTemplates.php 70647 2010-08-07 19:59:42Z ialex $'; } } -- cgit v1.2.3-54-g00ecf