From: Jack Phoenix Date: Mon, 22 Feb 2010 20:27:06 +0000 (+0000) Subject: ApiExpandTemplates.php: fix copyright symbol, coding style tweaks, more braces X-Git-Tag: 1.31.0-rc.0~37644 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=fe866da9a6f47b693540a3cf2cbf501b93236500;p=lhc%2Fweb%2Fwiklou.git ApiExpandTemplates.php: fix copyright symbol, coding style tweaks, more braces --- diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index 587664570c..81a6149274 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -1,11 +1,11 @@ @gmail.com + * 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 @@ -25,7 +25,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { // Eclipse helper - will be ignored in production - require_once ( "ApiBase.php" ); + require_once( "ApiBase.php" ); } /** @@ -38,7 +38,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { class ApiExpandTemplates extends ApiBase { public function __construct( $main, $action ) { - parent :: __construct( $main, $action ); + parent::__construct( $main, $action ); } public function execute() { @@ -46,18 +46,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' ) ) ) { @@ -78,9 +78,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, @@ -88,7 +88,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', @@ -100,7 +100,7 @@ class ApiExpandTemplates extends ApiBase { } protected function getExamples() { - return array ( + return array( 'api.php?action=expandtemplates&text={{Project:Sandbox}}' ); }