Index: trunk/extensions/PageSchemas/specials/GeneratePages.php |
— | — | @@ -6,22 +6,36 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | 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 | + } |
14 | 14 | |
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 | + |
28 | 42 | } |