r51634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51633‎ | r51634 | r51635 >
Date:10:51, 9 June 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Translate/_autoload.php (modified) (history)
  • /trunk/extensions/Translate/groups/Wikiblame.php (added) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/Wikiblame.php
@@ -0,0 +1,47 @@
 2+<?php
 3+/**
 4+ * Support Wikiblame: http://wikipedia.ramselehof.de/wikiblame.php.
 5+ *
 6+ * @addtogroup Extensions
 7+ *
 8+ * @copyright Copyright © 2009, Siebrand Mazeland
 9+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 10+ *
 11+ */
 12+
 13+class WikiblameMessageGroup extends MessageGroup {
 14+ protected $label = 'Wikiblame';
 15+ protected $id = 'out-wikiblame';
 16+ protected $type = 'wikiblame';
 17+
 18+ protected $fileDir = '__BUG__';
 19+
 20+ public function getPath() { return $this->fileDir; }
 21+ public function setPath( $value ) { $this->fileDir = $value; }
 22+
 23+ protected $optional = array();
 24+
 25+ public $header = '<?php
 26+/** Wikiblame
 27+ *
 28+ */';
 29+
 30+ public function getMessageFile( $code ) {
 31+ if ( isset( $this->codeMap[$code] ) ) {
 32+ $code = $this->codeMap[$code];
 33+ }
 34+ return "$code.php";
 35+ }
 36+
 37+ protected function getFileLocation( $code ) {
 38+ return $this->fileDir . '/' . $this->getMessageFile( $code );
 39+ }
 40+
 41+ public function getReader( $code ) {
 42+ return new PhpVariablesFormatReader( $this->getFileLocation( $code ) );
 43+ }
 44+
 45+ public function getWriter() {
 46+ return new PhpVariablesFormatWriter( $this );
 47+ }
 48+}
Property changes on: trunk/extensions/Translate/groups/Wikiblame.php
___________________________________________________________________
Name: svn:eol-style
149 + native
Name: svn:keywords
250 + Id
Index: trunk/extensions/Translate/_autoload.php
@@ -84,6 +84,7 @@
8585 $wgAutoloadClasses['MantisMessageGroup'] = $dir . 'groups/Mantis.php';
8686 $wgAutoloadClasses['NoccMessageGroup'] = $dir . 'groups/Nocc.php';
8787 $wgAutoloadClasses['OpenLayersMessageGroup'] = $dir . 'groups/OpenLayers.php';
 88+$wgAutoloadClasses['WikiblameMessageGroup'] = $dir . 'groups/Wikiblame.php';
8889
8990 # complex messages
9091 $wgAutoloadClasses['ComplexMessages'] = $dir . 'groups/ComplexMessages.php';

Status & tagging log