Index: trunk/extensions/GPoC/TableDisplay.php |
— | — | @@ -14,9 +14,27 @@ |
15 | 15 | return true; |
16 | 16 | } |
17 | 17 | |
| 18 | + private static function formatTable( $projectName, $projectStats ) { |
| 19 | + // Column Headers |
| 20 | + $col_headers = array_keys($projectStats['top']); |
| 21 | + $output = "{| class='wikitable' \n|+ $projectName article ratings\n"; |
| 22 | + $output .= "|-\n ! scope='col' | \n"; |
| 23 | + foreach( $col_headers as $col_header ) { |
| 24 | + $output .= "! scope='col' | $col_header \n"; |
| 25 | + } |
| 26 | + foreach( $projectStats as $importance => $qualityRatings ) { |
| 27 | + $output .= "|- \n ! scope='row' | $importance\n"; |
| 28 | + foreach( $qualityRatings as $quality => $qualityCount ) { |
| 29 | + $output .= "| $qualityCount \n"; |
| 30 | + } |
| 31 | + } |
| 32 | + $output .= "|}"; |
| 33 | + return $output; |
| 34 | + } |
| 35 | + |
18 | 36 | public static function AssessmentStatsRender( $parser, $project ) { |
19 | 37 | $projectStats = Statistics::getProjectStats( $project ); |
20 | | - $output = print_r( $projectStats, true ); |
| 38 | + $output = TableDisplay::formatTable( $project, $projectStats ); |
21 | 39 | return $output; |
22 | 40 | } |
23 | 41 | } |
Index: trunk/extensions/GPoC/models/Statistics.php |
— | — | @@ -47,6 +47,10 @@ |
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
| 51 | + // Make '' into 'unclassified' |
| 52 | + $project_statistics['unclassified'] = $project_statistics['']; |
| 53 | + unset( $project_statistics[''] ); |
| 54 | + |
51 | 55 | return $project_statistics; |
52 | 56 | } |
53 | 57 | |