Index: trunk/extensions/PageSchemas/specials/GeneratePages.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | |
15 | 15 | function execute( $category ) { |
16 | 16 | global $wgRequest, $wgOut; |
| 17 | + global $wgSkin; |
17 | 18 | $this->setHeaders(); |
18 | 19 | $generate_page_text = wfMsg( 'ps-generate-pages' ); |
19 | 20 | $generate_page_desc = wfMsg( 'ps-generate-pages-desc' ); |
— | — | @@ -37,7 +38,7 @@ |
38 | 39 | array( |
39 | 40 | 'pp_propname' => 'PageSchema' |
40 | 41 | ) |
41 | | - ); |
| 42 | + ); |
42 | 43 | while ( $row = $dbr->fetchRow( $res ) ) { |
43 | 44 | if( $row[2] != null ){ |
44 | 45 | $page_id_cat = $row[0]; |
— | — | @@ -55,7 +56,7 @@ |
56 | 57 | //this is when Special:GeneratePages/Category is accessed first time |
57 | 58 | //Here check for the valid Category name and allow for generating pages |
58 | 59 | $title = Title::newFromText( $category, NS_CATEGORY ); |
59 | | - $pageId = $title->getArticleID(); |
| 60 | + $pageId = $title->getArticleID(); |
60 | 61 | $dbr = wfGetDB( DB_SLAVE ); |
61 | 62 | //get the result set, query : slect page_props |
62 | 63 | $res = $dbr->select( 'page_props', |
— | — | @@ -76,10 +77,13 @@ |
77 | 78 | //add code to generate a list of check-box for pages to be generated. |
78 | 79 | $pageSchemaObj = new PSSchema( $category ); |
79 | 80 | $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. |
81 | 82 | 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 | + } |
84 | 88 | $text_2 .= '<br /> <input type="submit" value="'.$generate_page_text.'" /> <br /> <br /></form>'; |
85 | 89 | $wgOut->addHTML($text_2); |
86 | 90 | }else { |