Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -394,17 +394,6 @@ |
395 | 395 | // show change protection link |
396 | 396 | } elseif ( ( $s->log_action == 'protect' || $s->log_action == 'modify' ) && $wgUser->isAllowed( 'protect' ) ) { |
397 | 397 | $revert = '(' . $skin->makeKnownLinkObj( $title, wfMsg( 'protect_change' ), 'action=unprotect' ) . ')'; |
398 | | - // show user tool links for self created users |
399 | | - // @todo The extension should be handling this, get it out of core! E.g. Use the hook below. |
400 | | - } elseif ( $s->log_action == 'create2' ) { |
401 | | - if( isset( $paramArray[0] ) ) { |
402 | | - $revert = $this->skin->userToolLinks( $paramArray[0], $s->log_title, true ); |
403 | | - } else { |
404 | | - # Fall back to a blue contributions link |
405 | | - $revert = $this->skin->userToolLinks( 1, $s->log_title ); |
406 | | - } |
407 | | - # Suppress $comment from old entries, not needed and can contain incorrect links |
408 | | - $comment = ''; |
409 | 398 | // Show unmerge link |
410 | 399 | } elseif ( $s->log_action == 'merge' ) { |
411 | 400 | $merge = SpecialPage::getTitleFor( 'Mergehistory' ); |
Index: trunk/extensions/Newuserlog/Newuserlog.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | |
15 | 15 | $wgExtensionCredits['other'][] = array( |
16 | 16 | 'name' => 'Newuserlog', |
17 | | - 'version' => '2008-01-09', |
| 17 | + 'version' => '2008-01-24', |
18 | 18 | 'description' => 'adds a [[Special:Log/newusers|log of account creations]] to [[Special:Log]]', |
19 | 19 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Newuserlog', |
20 | 20 | 'author' => 'Ævar Arnfjörð Bjarmason' |
— | — | @@ -35,6 +35,8 @@ |
36 | 36 | # Run this hook on new account creation |
37 | 37 | global $wgHooks; |
38 | 38 | $wgHooks['AddNewAccount'][] = 'wfNewuserlogHook'; |
| 39 | + # Run this hook on Special:Log |
| 40 | + $wgHooks['LogLine'][] = 'wfNewuserlogLogLine'; |
39 | 41 | } |
40 | 42 | |
41 | 43 | function wfNewuserlogHook( $user = null ) { |
— | — | @@ -73,3 +75,29 @@ |
74 | 76 | |
75 | 77 | return true; |
76 | 78 | } |
| 79 | + |
| 80 | +/** |
| 81 | + * Create user tool links for self created users |
| 82 | + * @param string $log_type |
| 83 | + * @param string $log_action |
| 84 | + * @param object $title |
| 85 | + * @param array $paramArray |
| 86 | + * @param string $comment |
| 87 | + * @param string $revert user tool links |
| 88 | + * @return bool true |
| 89 | + */ |
| 90 | +function wfNewuserlogLogLine( $log_type = '', $log_action = '', $title = null, $paramArray = array(), &$comment = '', &$revert = '' ) { |
| 91 | + if ( $log_action == 'create2' ) { |
| 92 | + global $wgUser; |
| 93 | + $skin = $wgUser->getSkin(); |
| 94 | + if( isset( $paramArray[0] ) ) { |
| 95 | + $revert = $skin->userToolLinks( $paramArray[0], $title->getDBkey(), true ); |
| 96 | + } else { |
| 97 | + # Fall back to a blue contributions link |
| 98 | + $revert = $skin->userToolLinks( 1, $title->getDBkey() ); |
| 99 | + } |
| 100 | + # Suppress $comment from old entries, not needed and can contain incorrect links |
| 101 | + $comment = ''; |
| 102 | + } |
| 103 | + return true; |
| 104 | +} |