MediaWiki  REL1_24
PatrolLogFormatter.php
Go to the documentation of this file.
00001 <?php
00031 class PatrolLogFormatter extends LogFormatter {
00032     protected function getMessageKey() {
00033         $key = parent::getMessageKey();
00034         $params = $this->getMessageParameters();
00035         if ( isset( $params[5] ) && $params[5] ) {
00036             $key .= '-auto';
00037         }
00038 
00039         return $key;
00040     }
00041 
00042     protected function getMessageParameters() {
00043         $params = parent::getMessageParameters();
00044 
00045         $target = $this->entry->getTarget();
00046         $oldid = $params[3];
00047         $revision = $this->context->getLanguage()->formatNum( $oldid, true );
00048 
00049         if ( $this->plaintext ) {
00050             $revlink = $revision;
00051         } elseif ( $target->exists() ) {
00052             $query = array(
00053                 'oldid' => $oldid,
00054                 'diff' => 'prev'
00055             );
00056             $revlink = Linker::link( $target, htmlspecialchars( $revision ), array(), $query );
00057         } else {
00058             $revlink = htmlspecialchars( $revision );
00059         }
00060 
00061         $params[3] = Message::rawParam( $revlink );
00062 
00063         return $params;
00064     }
00065 }