Index: trunk/extensions/GPoC/models/Log.php |
— | — | @@ -21,4 +21,18 @@ |
22 | 22 | __METHOD__ |
23 | 23 | ); |
24 | 24 | } |
| 25 | + |
| 26 | + public static function getLogs() { |
| 27 | + $dbr = wfGetDB( DB_SLAVE ); |
| 28 | + $logs = $dbr->select( |
| 29 | + 'assessment_changelog', |
| 30 | + '*' |
| 31 | + ); |
| 32 | + $entries = array(); |
| 33 | + foreach( $logs as $entry ) { |
| 34 | + $entry = (array)$entry; |
| 35 | + array_push( $entries, $entry ); |
| 36 | + } |
| 37 | + return $entries; |
| 38 | + } |
25 | 39 | } |
Index: trunk/extensions/GPoC/models/Rating.php |
— | — | @@ -202,4 +202,9 @@ |
203 | 203 | ); |
204 | 204 | // Article moves not logged |
205 | 205 | } |
| 206 | + |
| 207 | + public static function getLogs() { |
| 208 | + $dbr = wfGetDB( DB_SLAVE ); |
| 209 | + |
| 210 | + } |
206 | 211 | } |
Index: trunk/extensions/GPoC/GPoC.php |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | $wgAutoloadClasses['AssessmentChangeLog'] = $dir . 'models/Log.php'; |
27 | 27 | $wgAutoloadClasses['TableDisplay'] = $dir . 'TableDisplay.php'; |
28 | 28 | $wgAutoloadClasses['AssessmentsExtractor'] = $dir . 'AssessmentsExtractor.php'; |
| 29 | +$wgAutoloadClasses['SpecialAssessmentLog'] = $dir . 'SpecialAssessmentLog.php'; |
29 | 30 | |
30 | 31 | $wgHooks['ArticleSaveComplete'][] = 'GPoCHooks::ArticleSaveComplete'; |
31 | 32 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'GPoCHooks::SetupSchema'; |
— | — | @@ -34,4 +35,6 @@ |
35 | 36 | |
36 | 37 | $wgHooks['TitleMoveComplete'][] = 'GPoCHooks::TitleMoveComplete'; |
37 | 38 | |
| 39 | +$wgSpecialPages['AssessmentLog'] = 'SpecialAssessmentLog'; |
| 40 | + |
38 | 41 | // Configuration |
Index: trunk/extensions/GPoC/SpecialAssessmentLog.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + */ |
| 5 | + |
| 6 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 7 | + echo( "not a valid entry point.\n" ); |
| 8 | + die( 1 ); |
| 9 | +} |
| 10 | + |
| 11 | +class SpecialAssessmentLog extends SpecialPage { |
| 12 | + |
| 13 | + public function __construct() { |
| 14 | + parent::__construct( 'AssessmentLog' ); |
| 15 | + } |
| 16 | + |
| 17 | + public function execute( $par ) { |
| 18 | + global $wgOut, $wgRequest; |
| 19 | + |
| 20 | + $entries = AssessmentChangeLog::getLogs(); |
| 21 | + |
| 22 | + $element = Html::element( 'div', array(), print_r( $entries, true) ); |
| 23 | + |
| 24 | + $wgOut->addHTML( $element ); |
| 25 | + } |
| 26 | +} |
Property changes on: trunk/extensions/GPoC/SpecialAssessmentLog.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 27 | + native |