Index: branches/robchurch/logs/includes/DefaultSettings.php |
— | — | @@ -2268,6 +2268,7 @@ |
2269 | 2269 | $wgLogActionCallbacks = array( |
2270 | 2270 | 'block' => array( 'BlockLogFormatter', 'makeActionText' ), |
2271 | 2271 | 'patrol' => array( 'PatrolLog', 'makeActionText' ), |
| 2272 | + 'rights' => array( 'CoreLogFormatter', 'formatRights' ), |
2272 | 2273 | ); |
2273 | 2274 | |
2274 | 2275 | /** |
Index: branches/robchurch/logs/includes/CoreLogFormatter.php |
— | — | @@ -9,6 +9,30 @@ |
10 | 10 | */ |
11 | 11 | class CoreLogFormatter { |
12 | 12 | |
| 13 | + /** |
| 14 | + * Build the action text for a user rights log item |
| 15 | + * |
| 16 | + * @param LogItem $item Item to format |
| 17 | + * @return string |
| 18 | + */ |
| 19 | + public static function formatRights( $item ) { |
| 20 | + global $wgUser, $wgContLang; |
| 21 | + $skin = $wgUser->getSkin(); |
| 22 | + $target = $wgContLang->ucfirst( $item->getTarget()->getText() ); |
| 23 | + $data = $item->getParameters(); |
| 24 | + |
| 25 | + $params[] = $skin->userLink( 1, $target ) |
| 26 | + . $skin->userToolLinks( 1, $target ); |
| 27 | + $params[] = ( isset( $data[0] ) && trim( $data[0] ) !== '' ) |
| 28 | + ? $data[0] |
| 29 | + : wfMsg( 'rightsnone' ); |
| 30 | + $params[] = ( isset( $data[1] ) && trim( $data[1] ) !== '' ) |
| 31 | + ? $data[1] |
| 32 | + : wfMsg( 'rightsnone' ); |
| 33 | + |
| 34 | + return LogFormatter::getActionText( $item, $params ); |
| 35 | + } |
| 36 | + |
13 | 37 | } |
14 | 38 | |
15 | 39 | ?> |
\ No newline at end of file |
Index: branches/robchurch/logs/includes/LogPage.php |
— | — | @@ -112,10 +112,6 @@ |
113 | 113 | $titleLink = $skin->makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' ); |
114 | 114 | $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), $params[0] ); |
115 | 115 | break; |
116 | | - case 'rights': |
117 | | - $text = $wgContLang->ucfirst( $title->getText() ); |
118 | | - $titleLink = $skin->makeLinkObj( Title::makeTitle( NS_USER, $text ) ); |
119 | | - break; |
120 | 116 | default: |
121 | 117 | $titleLink = $skin->makeLinkObj( $title ); |
122 | 118 | } |
— | — | @@ -123,17 +119,6 @@ |
124 | 120 | } else { |
125 | 121 | $titleLink = $title->getPrefixedText(); |
126 | 122 | } |
127 | | - if( $key == 'rights/rights' ) { |
128 | | - if ($skin) { |
129 | | - $rightsnone = wfMsg( 'rightsnone' ); |
130 | | - } else { |
131 | | - $rightsnone = wfMsgForContent( 'rightsnone' ); |
132 | | - } |
133 | | - if( !isset( $params[0] ) || trim( $params[0] ) == '' ) |
134 | | - $params[0] = $rightsnone; |
135 | | - if( !isset( $params[1] ) || trim( $params[1] ) == '' ) |
136 | | - $params[1] = $rightsnone; |
137 | | - } |
138 | 123 | if( count( $params ) == 0 ) { |
139 | 124 | if ( $skin ) { |
140 | 125 | $rv = wfMsg( $wgLogActions[$key], $titleLink ); |