r14838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14837‎ | r14838 | r14839 >
Date:10:25, 20 June 2006
Author:rotem
Status:old
Tags:
Comment:
Using the new log additions mechanism, instead of four different hooks.
Modified paths:
  • /trunk/extensions/Newuserlog/Newuserlog.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Newuserlog/Newuserlog.php
@@ -42,10 +42,13 @@
4343 );
4444
4545 # Add a new log type
46 - $wgHooks['LogPageValidTypes'][] = 'wfNewuserlogAddLogType';
47 - $wgHooks['LogPageLogName'][] = 'wfNewuserlogAddLogName';
48 - $wgHooks['LogPageLogHeader'][] = 'wfNewuserlogAddLogHeader';
49 - $wgHooks['LogPageActionText'][] = 'wfNewuserlogAddActionText';
 46+ global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
 47+ $wgLogTypes[] = 'newusers';
 48+ $wgLogNames['newusers'] = 'newuserlogpage';
 49+ $wgLogHeaders['newusers'] = 'newuserlogpagetext';
 50+ $wgLogActions['newusers/newusers'] = 'newuserlogentry';
 51+ $wgLogActions['newusers/create'] = 'newuserlog-create-entry';
 52+ $wgLogActions['newusers/create2'] = 'newuserlog-create2-entry';
5053
5154 # Run this hook on new account creation
5255 $wgHooks['AddNewAccount'][] = 'wfNewuserlogHook';
@@ -76,27 +79,4 @@
7780
7881 return true;
7982 }
80 -
81 -function wfNewuserlogAddLogType( &$types ) {
82 - if ( !in_array( 'newusers', $types ) )
83 - $types[] = 'newusers';
84 - return true;
85 -}
86 -
87 -function wfNewuserlogAddLogName( &$names ) {
88 - $names['newusers'] = 'newuserlogpage';
89 - return true;
90 -}
91 -
92 -function wfNewuserlogAddLogHeader( &$headers ) {
93 - $headers['newusers'] = 'newuserlogpagetext';
94 - return true;
95 -}
96 -
97 -function wfNewuserlogAddActionText( &$actions ) {
98 - $actions['newusers/newusers'] = 'newuserlogentry';
99 - $actions['newusers/create'] = 'newuserlog-create-entry';
100 - $actions['newusers/create2'] = 'newuserlog-create2-entry';
101 - return true;
102 -}
10383 ?>

Status & tagging log