$url: string value as output (out parameter, can modify)
$query: query options passed to Title::getFullURL()
-'LogPageValidTypes': action being logged.
-$type: array of strings
+'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes
+&$type: array of strings
-'LogPageLogName': name of the logging page(s).
-$typeText: array of strings
+'LogPageLogName': name of the logging page(s). DEPRECATED: Use $wgLogNames
+&$typeText: array of strings
-'LogPageLogHeader': strings used by wfMsg as a header.
-$headerText: array of strings
+'LogPageLogHeader': strings used by wfMsg as a header. DEPRECATED: Use $wgLogHeaders
+&$headerText: array of strings
+
+'LogPageActionText': strings used by wfMsg as a header. DEPRECATED: Use $wgLogActions
+&$actionText: array of strings
'MarkPatrolled': before an edit is marked patrolled
$rcid: ID of the revision to be marked patrolled
*/
$wgHooks = array();
+/**
+ * The logging system has two levels: an event type, which describes the
+ * general category and can be viewed as a named subset of all logs; and
+ * an action, which is a specific kind of event that can exist in that
+ * log type.
+ */
+$wgLogTypes = array( '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' );
+
+/**
+ * Lists the message key string for each log type. The localized messages
+ * will be listed in the user interface.
+ *
+ * Extensions with custom log types may add to this array.
+ */
+$wgLogNames = array(
+ '' => 'log',
+ 'block' => 'blocklogpage',
+ 'protect' => 'protectlogpage',
+ 'rights' => 'rightslog',
+ 'delete' => 'dellogpage',
+ 'upload' => 'uploadlogpage',
+ 'move' => 'movelogpage' );
+
+/**
+ * Lists the message key string for descriptive text to be shown at the
+ * top of each log type.
+ *
+ * Extensions with custom log types may add to this array.
+ */
+$wgLogHeaders = array(
+ '' => 'alllogstext',
+ 'block' => 'blocklogtext',
+ 'protect' => 'protectlogtext',
+ 'rights' => 'rightslogtext',
+ 'delete' => 'dellogpagetext',
+ 'upload' => 'uploadlogpagetext',
+ 'move' => 'movelogpagetext' );
+
+/**
+ * Lists the message key string for formatting individual events of each
+ * type and action when listed in the logs.
+ *
+ * Extensions with custom log types may add to this array.
+ */
+$wgLogActions = array(
+ 'block/block' => 'blocklogentry',
+ 'block/unblock' => 'unblocklogentry',
+ 'protect/protect' => 'protectedarticle',
+ 'protect/unprotect' => 'unprotectedarticle',
+
+ // TODO: This whole section should be moved to extensions/Makesysop/SpecialMakesysop.php
+ 'rights/rights' => 'rightslogentry',
+ 'rights/addgroup' => 'addgrouplogentry',
+ 'rights/rngroup' => 'renamegrouplogentry',
+ 'rights/chgroup' => 'changegrouplogentry',
+
+ 'delete/delete' => 'deletedarticle',
+ 'delete/restore' => 'undeletedarticle',
+ 'delete/revision' => 'revdelete-logentry',
+ 'upload/upload' => 'uploadedimage',
+ 'upload/revert' => 'uploadedimage',
+ 'move/move' => '1movedto2',
+ 'move/move_redir' => '1movedto2_redir' );
+
/**
* Experimental preview feature to fetch rendered text
* over an XMLHttpRequest from JavaScript instead of
* @static
*/
function validTypes() {
- static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' );
- wfRunHooks( 'LogPageValidTypes', array( &$types ) );
- return $types;
+ global $wgLogTypes;
+ return $wgLogTypes;
}
/**
* @static
*/
function logName( $type ) {
- static $typeText = array(
- '' => 'log',
- 'block' => 'blocklogpage',
- 'protect' => 'protectlogpage',
- 'rights' => 'rightslog',
- 'delete' => 'dellogpage',
- 'upload' => 'uploadlogpage',
- 'move' => 'movelogpage'
- );
- wfRunHooks( 'LogPageLogName', array( &$typeText ) );
+ global $wgLogNames;
- if( isset( $typeText[$type] ) ) {
- return str_replace( '_', ' ', wfMsg( $typeText[$type] ) );
+ if( isset( $wgLogNames[$type] ) ) {
+ return str_replace( '_', ' ', wfMsg( $wgLogNames[$type] ) );
} else {
// Bogus log types? Perhaps an extension was removed.
return $type;
}
/**
+ * @fixme: handle missing log types
* @static
*/
function logHeader( $type ) {
- static $headerText = array(
- '' => 'alllogstext',
- 'block' => 'blocklogtext',
- 'protect' => 'protectlogtext',
- 'rights' => 'rightslogtext',
- 'delete' => 'dellogpagetext',
- 'upload' => 'uploadlogpagetext',
- 'move' => 'movelogpagetext'
- );
- wfRunHooks( 'LogPageLogHeader', array( &$headerText ) );
-
- return wfMsg( $headerText[$type] );
+ global $wgLogHeaders;
+ return wfMsg( $wgLogHeaders[$type] );
}
/**
* @static
*/
function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false, $translate=false ) {
- global $wgLang, $wgContLang;
- static $actions = array(
- 'block/block' => 'blocklogentry',
- 'block/unblock' => 'unblocklogentry',
- 'protect/protect' => 'protectedarticle',
- 'protect/unprotect' => 'unprotectedarticle',
-
- // TODO: This whole section should be moved to extensions/Makesysop/SpecialMakesysop.php
- 'rights/rights' => 'rightslogentry',
- 'rights/addgroup' => 'addgrouplogentry',
- 'rights/rngroup' => 'renamegrouplogentry',
- 'rights/chgroup' => 'changegrouplogentry',
-
- 'delete/delete' => 'deletedarticle',
- 'delete/restore' => 'undeletedarticle',
- 'delete/revision' => 'revdelete-logentry',
- 'upload/upload' => 'uploadedimage',
- 'upload/revert' => 'uploadedimage',
- 'move/move' => '1movedto2',
- 'move/move_redir' => '1movedto2_redir'
- );
- wfRunHooks( 'LogPageActionText', array( &$actions ) );
+ global $wgLang, $wgContLang, $wgLogActions;
$key = "$type/$action";
- if( isset( $actions[$key] ) ) {
+ if( isset( $wgLogActions[$key] ) ) {
if( is_null( $title ) ) {
- $rv=wfMsg( $actions[$key] );
+ $rv=wfMsg( $wgLogActions[$key] );
} else {
if( $skin ) {
}
if( count( $params ) == 0 ) {
if ( $skin ) {
- $rv = wfMsg( $actions[$key], $titleLink );
+ $rv = wfMsg( $wgLogActions[$key], $titleLink );
} else {
- $rv = wfMsgForContent( $actions[$key], $titleLink );
+ $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
}
} else {
array_unshift( $params, $titleLink );
if ( $translate && $key == 'block/block' ) {
$params[1] = $wgLang->translateBlockExpiry($params[1]);
}
- $rv = wfMsgReal( $actions[$key], $params, true, !$skin );
+ $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
}
}
} else {