r91729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91728‎ | r91729 | r91730 >
Date:15:18, 8 July 2011
Author:yuvipanda
Status:deferred
Tags:
Comment:
Initial AssessmentLog commit
Modified paths:
  • /trunk/extensions/GPoC/GPoC.php (modified) (history)
  • /trunk/extensions/GPoC/SpecialAssessmentLog.php (added) (history)
  • /trunk/extensions/GPoC/models/Log.php (modified) (history)
  • /trunk/extensions/GPoC/models/Rating.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GPoC/models/Log.php
@@ -21,4 +21,18 @@
2222 __METHOD__
2323 );
2424 }
 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+ }
2539 }
Index: trunk/extensions/GPoC/models/Rating.php
@@ -202,4 +202,9 @@
203203 );
204204 // Article moves not logged
205205 }
 206+
 207+ public static function getLogs() {
 208+ $dbr = wfGetDB( DB_SLAVE );
 209+
 210+ }
206211 }
Index: trunk/extensions/GPoC/GPoC.php
@@ -25,6 +25,7 @@
2626 $wgAutoloadClasses['AssessmentChangeLog'] = $dir . 'models/Log.php';
2727 $wgAutoloadClasses['TableDisplay'] = $dir . 'TableDisplay.php';
2828 $wgAutoloadClasses['AssessmentsExtractor'] = $dir . 'AssessmentsExtractor.php';
 29+$wgAutoloadClasses['SpecialAssessmentLog'] = $dir . 'SpecialAssessmentLog.php';
2930
3031 $wgHooks['ArticleSaveComplete'][] = 'GPoCHooks::ArticleSaveComplete';
3132 $wgHooks['LoadExtensionSchemaUpdates'][] = 'GPoCHooks::SetupSchema';
@@ -34,4 +35,6 @@
3536
3637 $wgHooks['TitleMoveComplete'][] = 'GPoCHooks::TitleMoveComplete';
3738
 39+$wgSpecialPages['AssessmentLog'] = 'SpecialAssessmentLog';
 40+
3841 // 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
127 + native

Status & tagging log