r93844 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93843‎ | r93844 | r93845 >
Date:17:58, 3 August 2011
Author:yuvipanda
Status:deferred
Tags:
Comment:
Export CSV link available in the UI
Modified paths:
  • /trunk/extensions/GPoC/SpecialSelection.php (modified) (history)
  • /trunk/extensions/GPoC/templates/SelectionTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GPoC/SpecialSelection.php
@@ -32,7 +32,7 @@
3333 public function execute( $par ) {
3434 global $wgOut, $wgRequest;
3535
36 - $name = $par;
 36+ $name = $wgRequest->getVal('name');
3737 $action = $wgRequest->getVal('action');
3838
3939 $entries = Selection::getSelection( $name );
@@ -49,8 +49,15 @@
5050 $wgOut->disable();
5151 $this->makeCSV( $entries, $name );
5252 }
 53+
 54+ $csv_link = $this->getFullTitle()->getFullUrl( array(
 55+ 'action' => 'csv',
 56+ 'name' => $name
 57+ ) );
5358 $template = new SelectionTemplate();
5459 $template->set( 'articles', $entries );
 60+ $template->set( 'name', $name );
 61+ $template->set( 'csv_link', $csv_link );
5562
5663 $wgOut->addTemplate( $template );
5764 }
Index: trunk/extensions/GPoC/templates/SelectionTemplate.php
@@ -6,11 +6,13 @@
77 class SelectionTemplate extends QuickTemplate {
88 public function execute() {
99 $articles = $this->data['articles'];
 10+ $name = $this->data['name'];
 11+ $csv_link = $this->data['csv_link'];
1012 ?>
1113
1214 <div id="">
1315 <?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>
1517 <table>
1618 <tr>
1719 <th>Article</th>
@@ -25,7 +27,7 @@
2628 <?php } ?>
2729 </table>
2830 <?php } else { ?>
29 -<p>No results found</p>
 31+<p>No such selection found</p>
3032 <?php } ?>
3133 </div>
3234

Status & tagging log