if ( $rcComment == '' ) {
$rcComment = $this->comment;
} else {
- $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment;
+ $rcComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() .
+ $this->comment;
}
}
if ( $rcComment == '' ) {
$rcComment = $this->comment;
} else {
- $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment;
+ $rcComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() .
+ $this->comment;
}
}
global $wgLogNames;
if( isset( $wgLogNames[$type] ) ) {
- return str_replace( '_', ' ', wfMsg( $wgLogNames[$type] ) );
+ return str_replace( '_', ' ', wfMessage( $wgLogNames[$type] )->text() );
} else {
// Bogus log types? Perhaps an extension was removed.
return $type;
*/
public static function logHeader( $type ) {
global $wgLogHeaders;
- return wfMsgExt( $wgLogHeaders[$type], array( 'parseinline' ) );
+ return wfMessage( $wgLogHeaders[$type] )->parse();
}
/**
- * Generate text for a log entry.
+ * Generate text for a log entry.
* Only LogFormatter should call this function.
*
* @param $type String: log type
if( isset( $wgLogActions[$key] ) ) {
if( is_null( $title ) ) {
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'language' => $langObj ) );
+ $rv = wfMessage( $wgLogActions[$key] )->inLanguage( $langObj )->escaped();
} else {
$titleLink = self::getTitleLink( $type, $langObjOrNull, $title, $params );
- if( preg_match( '/^rights\/(rights|autopromote)/', $key ) ) {
- $rightsnone = wfMsgExt( 'rightsnone', array( 'parsemag', 'language' => $langObj ) );
-
- if( $skin ) {
- $username = $title->getText();
- foreach ( $params as &$param ) {
- $groupArray = array_map( 'trim', explode( ',', $param ) );
- foreach( $groupArray as &$group ) {
- $group = User::getGroupMember( $group, $username );
- }
- $param = $wgLang->listToText( $groupArray );
- }
- }
-
- if( !isset( $params[0] ) || trim( $params[0] ) == '' ) {
- $params[0] = $rightsnone;
- }
-
- if( !isset( $params[1] ) || trim( $params[1] ) == '' ) {
- $params[1] = $rightsnone;
- }
- }
-
if( count( $params ) == 0 ) {
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'language' => $langObj ), $titleLink );
+ $rv = wfMessage( $wgLogActions[$key] )->rawParams( $titleLink )->inLanguage( $langObj )->escaped();
} else {
$details = '';
array_unshift( $params, $titleLink );
// Cascading flag...
if( $params[2] ) {
- $details .= ' [' . wfMsgExt( 'protect-summary-cascade', array( 'parsemag', 'language' => $langObj ) ) . ']';
+ $details .= ' [' . wfMessage( 'protect-summary-cascade' )->inLanguage( $langObj )->text() . ']';
}
}
- $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'language' => $langObj ), $params ) . $details;
+ $rv = wfMessage( $wgLogActions[$key] )->rawParams( $params )->inLanguage( $langObj )->escaped() . $details;
}
}
} else {
* @return String
*/
protected static function getTitleLink( $type, $lang, $title, &$params ) {
- global $wgContLang, $wgUserrightsInterwikiDelimiter;
-
if( !$lang ) {
return $title->getPrefixedText();
}
. Linker::userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
}
break;
- case 'rights':
- $text = $wgContLang->ucfirst( $title->getText() );
- $parts = explode( $wgUserrightsInterwikiDelimiter, $text, 2 );
-
- if ( count( $parts ) == 2 ) {
- $titleLink = WikiMap::foreignUserLink( $parts[1], $parts[0],
- htmlspecialchars( $title->getPrefixedText() ) );
-
- if ( $titleLink !== false ) {
- break;
- }
- }
- $titleLink = Linker::link( Title::makeTitle( NS_USER, $text ) );
- break;
case 'merge':
$titleLink = Linker::link(
$title,
* @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param $target Title object
* @param $comment String: description associated
- * @param $params Array: parameters passed later to wfMsg.* functions
+ * @param $params Array: parameters passed later to wfMessage function
* @param $doer User object: the user doing the action
*
* @return int log_id of the inserted log entry