Index: trunk/extensions/GPoC/SpecialSelection.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | public function execute( $par ) { |
34 | 34 | global $wgOut, $wgRequest; |
35 | 35 | |
36 | | - $name = $par; |
| 36 | + $name = $wgRequest->getVal('name'); |
37 | 37 | $action = $wgRequest->getVal('action'); |
38 | 38 | |
39 | 39 | $entries = Selection::getSelection( $name ); |
— | — | @@ -49,8 +49,15 @@ |
50 | 50 | $wgOut->disable(); |
51 | 51 | $this->makeCSV( $entries, $name ); |
52 | 52 | } |
| 53 | + |
| 54 | + $csv_link = $this->getFullTitle()->getFullUrl( array( |
| 55 | + 'action' => 'csv', |
| 56 | + 'name' => $name |
| 57 | + ) ); |
53 | 58 | $template = new SelectionTemplate(); |
54 | 59 | $template->set( 'articles', $entries ); |
| 60 | + $template->set( 'name', $name ); |
| 61 | + $template->set( 'csv_link', $csv_link ); |
55 | 62 | |
56 | 63 | $wgOut->addTemplate( $template ); |
57 | 64 | } |
Index: trunk/extensions/GPoC/templates/SelectionTemplate.php |
— | — | @@ -6,11 +6,13 @@ |
7 | 7 | class SelectionTemplate extends QuickTemplate { |
8 | 8 | public function execute() { |
9 | 9 | $articles = $this->data['articles']; |
| 10 | + $name = $this->data['name']; |
| 11 | + $csv_link = $this->data['csv_link']; |
10 | 12 | ?> |
11 | 13 | |
12 | 14 | <div id=""> |
13 | 15 | <?php if( count($articles) > 0 ) { ?> |
14 | | -<h3>Results</h3> |
| 16 | +<h3>Articles in Selection <?php echo $name; ?></h3> <small><a href="<?php echo $csv_link; ?>">Export CSV</a></small> |
15 | 17 | <table> |
16 | 18 | <tr> |
17 | 19 | <th>Article</th> |
— | — | @@ -25,7 +27,7 @@ |
26 | 28 | <?php } ?> |
27 | 29 | </table> |
28 | 30 | <?php } else { ?> |
29 | | -<p>No results found</p> |
| 31 | +<p>No such selection found</p> |
30 | 32 | <?php } ?> |
31 | 33 | </div> |
32 | 34 | |