r89963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89962‎ | r89963 | r89964 >
Date:14:16, 13 June 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
adding generateAllPages function and testing form submission
Modified paths:
  • /trunk/extensions/PageSchemas/specials/GeneratePages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/specials/GeneratePages.php
@@ -6,22 +6,36 @@
77 */
88
99 class GeneratePages extends IncludableSpecialPage {
10 - function __construct() {
11 - parent::__construct( 'GeneratePages' );
12 - wfLoadExtensionMessages('GeneratePages');
13 - }
 10+ function __construct() {
 11+ parent::__construct( 'GeneratePages' );
 12+ wfLoadExtensionMessages('GeneratePages');
 13+ }
1414
15 - function execute( $par ) {
16 - global $wgRequest, $wgOut;
17 -
18 - $this->setHeaders();
19 -
20 - # Get request data from, e.g.
21 - $param = $wgRequest->getText('param');
22 -
23 - # Do stuff
24 - # ...
25 - $output="Hello world!".$param;
26 - $wgOut->addWikiText( $output );
27 - }
 15+ function execute( $category ) {
 16+ global $wgRequest, $wgOut;
 17+ $this->setHeaders();
 18+
 19+ # Get request data from, e.g.
 20+ $param = $wgRequest->getText('param');
 21+ if ( $param != "" ) {
 22+ $this->generateAllPages($param);
 23+
 24+ }
 25+ $text =<<< END
 26+<form method="post">
 27+ <input type="hidden" name="param" value="$category" /><br />
 28+ <input type="submit" value="Generate Pages" />
 29+</form>
 30+
 31+END;
 32+ $wgOut->addHTML($text);
 33+
 34+ }
 35+
 36+ function generateAllPages ( $category_name ) {
 37+ global $wgRequest, $wgOut;
 38+ $wgOut->addWikiText( $category_name );
 39+
 40+ }
 41+
2842 }

Status & tagging log