r96587 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96586‎ | r96587 | r96588 >
Date:17:10, 8 September 2011
Author:ialex
Status:ok
Tags:
Comment:
No need to use an extension function to define a new log type
Modified paths:
  • /trunk/extensions/SignDocument/SignDocument.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SignDocument/SignDocument.php
@@ -23,8 +23,6 @@
2424 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
2525 */
2626
27 -$wgExtensionFunctions[] = 'wfCreateSignatureLog';
28 -
2927 $wgExtensionCredits['specialpage'][] = array(
3028 'path' => __FILE__,
3129 'name' => 'SignDocument',
@@ -52,21 +50,12 @@
5351 $wgGroupPermissions['*']['createsigndocument'] = false;
5452 $wgGroupPermissions['sigadmin']['createsigndocument'] = true;
5553
56 -/**
57 - * Create the Signature log.
58 - */
59 -function wfCreateSignatureLog() {
60 -
 54+# Add a new log type
 55+$wgLogTypes[] = 'signature';
 56+$wgLogNames['signature'] = 'signaturelogpage';
 57+$wgLogHeaders['signature'] = 'signaturelogpagetext';
 58+$wgLogActions['signature/sign'] = 'signaturelogentry';
6159
62 - # Add a new log type
63 - global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
64 -
65 - $wgLogTypes[] = 'signature';
66 - $wgLogNames['signature'] = 'signaturelogpage';
67 - $wgLogHeaders['signature'] = 'signaturelogpagetext';
68 - $wgLogActions['signature/sign'] = 'signaturelogentry';
69 -}
70 -
7160 /**
7261 * Logs the addition of a signature to a document. If it's an anonymous user,
7362 * it will add it to the logging table but the entry won't display on Special:Log.

Status & tagging log