r107365 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107364‎ | r107365 | r107366 >
Date:07:29, 27 December 2011
Author:amire80
Status:reverted
Tags:
Comment:
Refactored workflow states column adding code.
Modified paths:
  • /trunk/extensions/Translate/specials/SpecialLanguageStats.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialMessageGroupStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/specials/SpecialMessageGroupStats.php
@@ -107,12 +107,7 @@
108108 function getTable() {
109109 $table = $this->table;
110110
111 - global $wgTranslateWorkflowStates;
112 - if ( $wgTranslateWorkflowStates ) {
113 - $this->states = self::getWorkflowStates( $this->target );
114 - $this->statemap = array_flip( $wgTranslateWorkflowStates );
115 - $table->addExtraColumn( wfMessage( 'translate-stats-workflow' ) );
116 - }
 111+ $this->workflowStatesColumn();
117112 $out = '';
118113
119114 if ( $this->purge ) {
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php
@@ -229,11 +229,26 @@
230230 }
231231
232232 /**
 233+ * Adds a workflow states column if its needed.
 234+ */
 235+ function workflowStatesColumn() {
 236+ global $wgTranslateWorkflowStates;
 237+ if ( $wgTranslateWorkflowStates ) {
 238+ $this->states = self::getWorkflowStates( $this->target );
 239+ $this->statemap = array_flip( $wgTranslateWorkflowStates );
 240+ $table->addExtraColumn( wfMessage( 'translate-stats-workflow' ) );
 241+ }
 242+ return;
 243+ }
 244+
 245+
 246+ /**
233247 * Returns the table itself.
234248 * @return \string HTML
235249 */
236250 function getTable() {
237251 $table = $this->table;
 252+
238253 $out = '';
239254
240255 if ( $this->purge ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r107368Revert r107365.amire8008:19, 27 December 2011
r107372Flwup r107365 - avoid wwarningsnikerabbit09:05, 27 December 2011

Status & tagging log