r95699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95698‎ | r95699 | r95700 >
Date:21:20, 29 August 2011
Author:yaron
Status:deferred
Tags:
Comment:
More cleanup, including renaming GeneratePages and EditSchema classes to PSGeneratePages and PSEditSchema
Modified paths:
  • /trunk/extensions/PageSchemas/PS_Tabs.php (modified) (history)
  • /trunk/extensions/PageSchemas/PageSchemas.classes.php (modified) (history)
  • /trunk/extensions/PageSchemas/PageSchemas.php (modified) (history)
  • /trunk/extensions/PageSchemas/specials/PS_EditSchema.php (modified) (history)
  • /trunk/extensions/PageSchemas/specials/PS_GeneratePages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/PS_Tabs.php
@@ -61,11 +61,11 @@
6262
6363 $categoryName = $title->getText();
6464 if ( $action == 'generatepages' ) {
65 - $gen_page = new GeneratePages();
 65+ $gen_page = new PSGeneratePages();
6666 $gen_page->execute( $categoryName );
6767 return false;
6868 } elseif ( $action == 'editschema' ) {
69 - $edit_schema = new EditSchema();
 69+ $edit_schema = new PSEditSchema();
7070 $edit_schema->execute( $categoryName );
7171 return false;
7272 }
Index: trunk/extensions/PageSchemas/PageSchemas.classes.php
@@ -64,7 +64,7 @@
6565 if ( $namespace != '' ) {
6666 $namespace .= ':';
6767 }
68 - if ( self::isCapitalized( $title ) ) {
 68+ if ( MWNamespace::isCapitalized( $title->getNamespace() ) ) {
6969 global $wgContLang;
7070 return $namespace . $wgContLang->ucfirst( $title->getText() );
7171 } else {
@@ -72,10 +72,6 @@
7373 }
7474 }
7575
76 - public static function isCapitalized( $title ) {
77 - return MWNamespace::isCapitalized( $title->getNamespace() );
78 - }
79 -
8076 public static function validateXML( $xml, &$error_msg ) {
8177 $xmlDTD =<<<END
8278 <?xml version="1.0" encoding="utf-8"?>
Index: trunk/extensions/PageSchemas/specials/PS_GeneratePages.php
@@ -5,7 +5,7 @@
66 * @author Ankit Garg
77 */
88
9 -class GeneratePages extends IncludableSpecialPage {
 9+class PSGeneratePages extends IncludableSpecialPage {
1010 function __construct() {
1111 parent::__construct( 'GeneratePages' );
1212 }
@@ -16,7 +16,7 @@
1717 $this->setHeaders();
1818 $param = $wgRequest->getText('param');
1919 if ( $param != "" && $category != "" ) {
20 - $this->generatePages( $param, $_POST['page'] );
 20+ $this->generatePages( $param, $wgRequest->getValues( 'page' ) );
2121 $text = '<p>All pages will be generated! </p>';
2222 $wgOut->addHTML( $text );
2323 return true;
@@ -66,7 +66,7 @@
6767 return true;
6868 }
6969
70 - function generatePages ( $categoryName, $toGenPageList ) {
 70+ function generatePages( $categoryName, $toGenPageList ) {
7171 $pageSchema = new PSSchema( $categoryName );
7272 $pageSchema->generateAllPages( $toGenPageList );
7373 }
Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php
@@ -5,7 +5,7 @@
66 * @author Ankit Garg
77 */
88
9 -class EditSchema extends IncludableSpecialPage {
 9+class PSEditSchema extends IncludableSpecialPage {
1010 function __construct() {
1111 parent::__construct( 'EditSchema' );
1212 }
Index: trunk/extensions/PageSchemas/PageSchemas.php
@@ -45,12 +45,12 @@
4646 $wgAutoloadClasses['PageSchemas'] = $dir . 'PageSchemas.classes.php';
4747 $wgAutoloadClasses['PSSchema'] = $dir . 'PageSchemas.classes.php';
4848 $wgAutoloadClasses['ApiQueryPageSchemas'] = $dir . 'ApiQueryPageSchemas.php';
49 -$wgAutoloadClasses['GeneratePages'] = $dir . 'specials/PS_GeneratePages.php';
50 -$wgAutoloadClasses['EditSchema'] = $dir . 'specials/PS_EditSchema.php';
 49+$wgAutoloadClasses['PSGeneratePages'] = $dir . 'specials/PS_GeneratePages.php';
 50+$wgAutoloadClasses['PSEditSchema'] = $dir . 'specials/PS_EditSchema.php';
5151 $wgAutoloadClasses['PSTabs'] = $dir . 'PS_Tabs.php';
5252 // registering Special page
53 -$wgSpecialPages['GeneratePages'] = 'GeneratePages';
54 -$wgSpecialPages['EditSchema'] = 'EditSchema';
 53+$wgSpecialPages['GeneratePages'] = 'PSGeneratePages';
 54+$wgSpecialPages['EditSchema'] = 'PSEditSchema';
5555 $wgSpecialPageGroups['GeneratePages'] = 'other';
5656 $wgSpecialPageGroups['EditSchema'] = 'other';
5757 // Register parser hook

Status & tagging log