MediaWiki  REL1_22
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         return $key;
00039     }
00040 
00041     protected function getMessageParameters() {
00042         $params = parent::getMessageParameters();
00043 
00044         $target = $this->entry->getTarget();
00045         $oldid = $params[3];
00046         $revision = $this->context->getLanguage()->formatNum( $oldid, true );
00047 
00048         if ( $this->plaintext ) {
00049             $revlink = $revision;
00050         } elseif ( $target->exists() ) {
00051             $query = array(
00052                 'oldid' => $oldid,
00053                 'diff' => 'prev'
00054             );
00055             $revlink = Linker::link( $target, htmlspecialchars( $revision ), array(), $query );
00056         } else {
00057             $revlink = htmlspecialchars( $revision );
00058         }
00059 
00060         $params[3] = Message::rawParam( $revlink );
00061         return $params;
00062     }
00063 }