http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95819

Revision: 95819
Author:   yaron
Date:     2011-08-30 22:26:13 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
More cleanup

Modified Paths:
--------------
    trunk/extensions/PageSchemas/specials/PS_GeneratePages.php

Modified: trunk/extensions/PageSchemas/specials/PS_GeneratePages.php
===================================================================
--- trunk/extensions/PageSchemas/specials/PS_GeneratePages.php  2011-08-30 
22:25:12 UTC (rev 95818)
+++ trunk/extensions/PageSchemas/specials/PS_GeneratePages.php  2011-08-30 
22:26:13 UTC (rev 95819)
@@ -5,6 +5,7 @@
  * @author Ankit Garg
  */
 
+
 class PSGeneratePages extends IncludableSpecialPage {
        function __construct() {
                parent::__construct( 'GeneratePages' );
@@ -15,9 +16,10 @@
 
                $this->setHeaders();
                $param = $wgRequest->getText('param');
-               if ( $param != "" && $category != "" ) {
-                       $this->generatePages( $param, $wgRequest->getValues( 
'page' ) );
-                       $text = '<p>All pages will be generated! </p>';
+               if ( !empty( $param ) && !empty( $category ) ) {
+                       // Generate the pages!
+                       $this->generatePages( $param, $wgRequest->getArray( 
'page' ) );
+                       $text = Html::element( 'p', null, wfMsg( 
'ps-generatepages-success' ) );
                        $wgOut->addHTML( $text );
                        return true;
                }
@@ -40,14 +42,14 @@
                // Check for a valid category, with a page schema defined.
                $pageSchemaObj = new PSSchema( $category );
                if ( !$pageSchemaObj->isPSDefined() ) {
-                       $text = "<p>Error: there is no page schema defined for 
that category in the wiki. </p>";
+                       $text = Html::element( 'p', null, wfMsg( 
'ps-generatepages-noschema' ) );
                        $wgOut->addHTML( $text );
                        return true;
                }
 
                $generate_page_desc = wfMsg( 'ps-generatepages-desc' );
                $text = "<p>$generate_page_desc</p>\n";
-               $text = '<form method="post"><input type="hidden" name="param" 
value="'.$category.'" /><br />';
+               $text = '<form method="post"><input type="hidden" name="param" 
value="'.$category.'" /><br />' . "\n";
                //add code to generate a list of check-box for pages to be 
generated.
                $pageList = array();
 
@@ -58,9 +60,10 @@
                        $pageURL = $page->getFullUrl();
                        $pageName = PageSchemas::titleString( $page );
                        $pageLink = Html::element( 'a', array( 'href' => 
$pageURL ), $pageName );
-                       $text .= '<input type="checkbox" name="page[]" value="' 
. $pageName . '" checked="checked" />' . $pageLink . ' <br />';
+                       $text .= Html::input( 'page[]', $pageName, 'checkbox', 
array( 'checked' => true ) );
+                       $text .= "\n" . $pageLink . "<br />\n";
                }
-               $generate_page_text = wfMsg( 'ps-generatepages' );
+               $generate_page_text = wfMsg( 'generatepages' );
                $text .= '<br /> <input type="submit" 
value="'.$generate_page_text.'" /> <br /> <br /></form>';
                $wgOut->addHTML( $text );
                return true;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to