r105814 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105813‎ | r105814 | r105815 >
Date:18:50, 11 December 2011
Author:yuvipanda
Status:deferred
Tags:
Comment:
Fixed tabs and spacing (hopefully)
Modified paths:
  • /trunk/extensions/SelectionSifter/SpecialAssessmentLog.php (modified) (history)
  • /trunk/extensions/SelectionSifter/SpecialFilterRatings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SelectionSifter/SpecialFilterRatings.php
@@ -29,7 +29,7 @@
3030 if( $action == 'addtoselection' ) {
3131 $success = Selection::addEntries( $selection_name, $entries );
3232 $sel_page = new SpecialSelection();
33 -
 33+
3434 $url = $sel_page->getTitle()->getLinkUrl( array( 'name' => $selection_name ) );
3535 $return = array(
3636 'status' => $success,
@@ -40,31 +40,31 @@
4141 return;
4242 }
4343
44 - $fields = array(
45 - 'Project-Name' => array(
46 - 'type' => 'text',
47 - 'label-message' => 'ss-project',
48 - 'tabindex' => '1'
49 - ),
50 - 'Importance' => array(
51 - 'type' => 'text',
52 - 'label-message' => 'ss-importance',
53 - 'tabindex' => '2'
54 - ),
55 - 'Quality' => array(
56 - 'type' => 'text',
57 - 'label-message' => 'ss-quality',
58 - 'tabindex' => '3'
59 - )
60 - );
 44+ $fields = array(
 45+ 'Project-Name' => array(
 46+ 'type' => 'text',
 47+ 'label-message' => 'ss-project',
 48+ 'tabindex' => '1'
 49+ ),
 50+ 'Importance' => array(
 51+ 'type' => 'text',
 52+ 'label-message' => 'ss-importance',
 53+ 'tabindex' => '2'
 54+ ),
 55+ 'Quality' => array(
 56+ 'type' => 'text',
 57+ 'label-message' => 'ss-quality',
 58+ 'tabindex' => '3'
 59+ )
 60+ );
6161
62 - $project = $request->getText( 'wpProject' );
63 - $importance = $request->getText( 'wpImportance' );
64 - $quality = $request->getText( 'wpQuality' );
 62+ $project = $request->getText( 'wpProject' );
 63+ $importance = $request->getText( 'wpImportance' );
 64+ $quality = $request->getText( 'wpQuality' );
6565
6666 $filters = array_filter( array(
67 - 'r_project' => $project,
68 - 'r_importance' => $importance,
 67+ 'r_project' => $project,
 68+ 'r_importance' => $importance,
6969 'r_quality' => $quality
7070 ) );
7171
@@ -72,14 +72,14 @@
7373 $this->outputHeader();
7474 $out->setPageTitle( $this->msg( 'ss-filter-ratings' ) );
7575
76 - $form = new HTMLForm( $fields, $this->getContext() );
77 - $form->setMethod( 'get' );
78 - $form->prepareForm();
 76+ $form = new HTMLForm( $fields, $this->getContext() );
 77+ $form->setMethod( 'get' );
 78+ $form->prepareForm();
7979
80 - $form->displayForm( '' );
81 -
82 - $pager = new RatingsPager( $this, $filters );
 80+ $form->displayForm( '' );
8381
 82+ $pager = new RatingsPager( $this, $filters );
 83+
8484 if ( $pager->getNumRows() ) {
8585 $out->addHTML(
8686 $pager->getNavigationBar() .
@@ -89,13 +89,13 @@
9090 $out->addWikiMsg( 'ss-ratings-empty' );
9191 }
9292
93 - return;
 93+ return;
9494 }
9595 }
9696
9797 class RatingsPager extends TablePager {
98 - protected $conds;
99 - protected $page;
 98+ protected $conds;
 99+ protected $page;
100100
101101 /**
102102 * @param $page SpecialPage
@@ -122,22 +122,22 @@
123123 }
124124
125125 return $headers;
126 - }
 126+ }
127127
128128 function getQueryInfo() {
129129 return array(
130130 'tables' => array( 'ratings' ),
131131 'fields' => array(
132 - 'r_id',
133 - 'r_project',
134 - 'r_namespace',
135 - 'r_article',
136 - 'r_quality',
137 - 'r_importance'
 132+ 'r_id',
 133+ 'r_project',
 134+ 'r_namespace',
 135+ 'r_article',
 136+ 'r_quality',
 137+ 'r_importance'
138138 ),
139139 'conds' => $this->conds
140140 );
141 - }
 141+ }
142142
143143 function getIndexField() {
144144 return 'r_id';
@@ -151,24 +151,24 @@
152152 return false;
153153 }
154154
155 - function formatValue( $name, $value ) {
156 - $row = $this->mCurrentRow;
 155+ function formatValue( $name, $value ) {
 156+ $row = $this->mCurrentRow;
157157
158 - switch( $name ) {
159 - case 'r_project':
160 - $project_title = Title::newFromText( $row->r_project );
161 - return Linker::linkKnown( $project_title, htmlspecialchars( $project_title->getText() ) );
162 - break;
163 - case 'r_quality':
164 - return $value;
165 - break;
166 - case 'r_importance':
167 - return $value;
168 - break;
169 - case 'r_article':
170 - $title = Title::makeTitleSafe( $row->r_namespace, $row->r_article );
171 - return Linker::linkKnown( $title, htmlspecialchars( $title->getText() ) );
172 - break;
173 - }
174 - }
 158+ switch( $name ) {
 159+ case 'r_project':
 160+ $project_title = Title::newFromText( $row->r_project );
 161+ return Linker::linkKnown( $project_title, htmlspecialchars( $project_title->getText() ) );
 162+ break;
 163+ case 'r_quality':
 164+ return $value;
 165+ break;
 166+ case 'r_importance':
 167+ return $value;
 168+ break;
 169+ case 'r_article':
 170+ $title = Title::makeTitleSafe( $row->r_namespace, $row->r_article );
 171+ return Linker::linkKnown( $title, htmlspecialchars( $title->getText() ) );
 172+ break;
 173+ }
 174+ }
175175 }
Index: trunk/extensions/SelectionSifter/SpecialAssessmentLog.php
@@ -25,25 +25,25 @@
2626 $this->outputHeader();
2727 $out->setPageTitle( $this->msg( 'ss-assessment-log' ) );
2828
29 - $fields = array(
30 - 'Project' => array(
31 - 'type' => 'text',
32 - 'label-message' => 'ss-project',
33 - 'tabindex' => '1'
34 - )
35 - );
 29+ $fields = array(
 30+ 'Project' => array(
 31+ 'type' => 'text',
 32+ 'label-message' => 'ss-project',
 33+ 'tabindex' => '1'
 34+ )
 35+ );
3636
37 - $project = $request->getText( 'wpProject' );
 37+ $project = $request->getText( 'wpProject' );
3838
3939 $filters = array_filter( array(
40 - 'l_project' => $project
 40+ 'l_project' => $project
4141 ) );
4242
43 - $form = new HTMLForm( $fields, $this->getContext() );
44 - $form->setMethod( 'get' );
45 - $form->prepareForm();
 43+ $form = new HTMLForm( $fields, $this->getContext() );
 44+ $form->setMethod( 'get' );
 45+ $form->prepareForm();
4646
47 - $form->displayForm( '' );
 47+ $form->displayForm( '' );
4848
4949 $pager = new AssessmentLogPager( $this, $filters );
5050 if( $pager->getNumRows() ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105808Added filtering and UI for AssessmentLogyuvipanda18:23, 11 December 2011

Status & tagging log