r92390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92389‎ | r92390 | r92391 >
Date:11:43, 17 July 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
Changing the way the generate_pages list look to end user.
Also the way , How to populate this list.
Modified paths:
  • /trunk/extensions/PageSchemas/specials/GeneratePages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/specials/GeneratePages.php
@@ -13,6 +13,7 @@
1414
1515 function execute( $category ) {
1616 global $wgRequest, $wgOut;
 17+ global $wgSkin;
1718 $this->setHeaders();
1819 $generate_page_text = wfMsg( 'ps-generate-pages' );
1920 $generate_page_desc = wfMsg( 'ps-generate-pages-desc' );
@@ -37,7 +38,7 @@
3839 array(
3940 'pp_propname' => 'PageSchema'
4041 )
41 - );
 42+ );
4243 while ( $row = $dbr->fetchRow( $res ) ) {
4344 if( $row[2] != null ){
4445 $page_id_cat = $row[0];
@@ -55,7 +56,7 @@
5657 //this is when Special:GeneratePages/Category is accessed first time
5758 //Here check for the valid Category name and allow for generating pages
5859 $title = Title::newFromText( $category, NS_CATEGORY );
59 - $pageId = $title->getArticleID();
 60+ $pageId = $title->getArticleID();
6061 $dbr = wfGetDB( DB_SLAVE );
6162 //get the result set, query : slect page_props
6263 $res = $dbr->select( 'page_props',
@@ -76,10 +77,13 @@
7778 //add code to generate a list of check-box for pages to be generated.
7879 $pageSchemaObj = new PSSchema( $category );
7980 $pageList = array();
80 - wfRunHooks( 'PageSchemasGetPageList', array( $pageSchemaObj, &$pageList )); //will return an array of string, with each value as a title of the page to be created.
 81+ wfRunHooks( 'PageSchemasGetPageList', array( $pageSchemaObj, &$pageList )); //will return an array of string, with each value as a title of the page to be created.
8182 foreach( $pageList as $page ){
82 - $text_2 .= '<input type="checkbox" name="page[]" value="'.$page.'" /> '.$page.' <br />';
83 - }
 83+ //$page_link = $wgSkin->link( $page );
 84+ $page_link = $page->getFullUrl();
 85+ $page_val = PageSchemas::titleString( $page );
 86+ $text_2 .= '<input type="checkbox" name="page[]" value="'.$page_val.'" /> '.$page_link.' <br />';
 87+ }
8488 $text_2 .= '<br /> <input type="submit" value="'.$generate_page_text.'" /> <br /> <br /></form>';
8589 $wgOut->addHTML($text_2);
8690 }else {

Status & tagging log