From 27e91915587d300372783cb3490629897e2015df Mon Sep 17 00:00:00 2001 From: Frank Duncan <frank.d.duncan@gmail.com> Date: Sun, 19 Jul 2020 06:46:45 -0500 Subject: [PATCH] Cleaning up whitespace --- README.md | 6 +-- extension.json | 60 +++++++++++++++--------------- i18n/en.json | 10 ++--- include/ActivityLogFormatter.php | 2 +- include/hooks/ActivityLogHooks.php | 2 +- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index ea0a670..74df4ed 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Extension:ActivityLog The ActivityLog extension allows system administrators to set up logging for -arbitrary hooks. These log messages are currently sent to the main Log page +arbitrary hooks. These log messages are currently sent to the main Log page at `Special:Log`. ## Installation @@ -15,7 +15,7 @@ wfLoadExtension('ActivityLog'); ## Usage `$wgActivityLogHooksToWatch` is an associative array that configures how -ActivityLog will log [MediaWiki events](https://www.mediawiki.org/wiki/Manual:Hooks). +ActivityLog will log [MediaWiki events](https://www.mediawiki.org/wiki/Manual:Hooks). ``` php $wgActivityLogHooksToWatch['ArticleViewHeader'] = true; @@ -28,7 +28,7 @@ $wgActivityLogHooksToWatch['ArticleViewHeader'] = 'example string' // callback is invoked with hook arguments ($article, $outputDone, $pcache in this case) $wgActivityLogHooksToWatch['ArticleViewHeader'] = function ($article) { - // callback returns an array with the user (User), target (Title), a messageKey (String), + // callback returns an array with the user (User), target (Title), a messageKey (String), // following any additional parameters you might want that you can reference in the message return array($article->getContext()->getUser(), $article->getTitle(), $messageKey, $_SERVER['HTTP_REFERER']); diff --git a/extension.json b/extension.json index 2001262..51e3146 100644 --- a/extension.json +++ b/extension.json @@ -1,40 +1,40 @@ { - "name": "ActivityLog", - "version": "0.0.1", - "author": [ + "name": "ActivityLog", + "version": "0.0.1", + "author": [ "Open Tech Strategies" - ], + ], "license-name": "GPL-2.0-or-later", - "url": "https://github.com/OpenTechStrategies/torque", - "descriptionmsg": "activitylog-desc", - "type": "other", + "url": "https://github.com/OpenTechStrategies/torque", + "descriptionmsg": "activitylog-desc", + "type": "other", "LogActions": { "activitylog/activity": "activitylog-activity" }, - "LogActionsHandlers": { - "activitylog/*": "ActivityLogFormatter" - }, - "LogHeaders": { - "activitylog": "activitylogpagetext" - }, - "LogNames": { - "activitylog": "activitylogpage" - }, - "LogTypes": [ - "activitylog" - ], - "MessagesDirs": { - "ActivityLog": [ - "i18n" - ] - }, - "AutoloadClasses": { - "ActivityLogHooks": "include/hooks/ActivityLogHooks.php", - "ActivityLogFormatter": "include/ActivityLogFormatter.php" - }, - "Hooks": { + "LogActionsHandlers": { + "activitylog/*": "ActivityLogFormatter" + }, + "LogHeaders": { + "activitylog": "activitylogpagetext" + }, + "LogNames": { + "activitylog": "activitylogpage" + }, + "LogTypes": [ + "activitylog" + ], + "MessagesDirs": { + "ActivityLog": [ + "i18n" + ] + }, + "AutoloadClasses": { + "ActivityLogHooks": "include/hooks/ActivityLogHooks.php", + "ActivityLogFormatter": "include/ActivityLogFormatter.php" + }, + "Hooks": { "BeforeInitialize": "ActivityLogHooks::onBeforeInitialize" - }, + }, "Config": { "ActivityLogHooksToWatch": [] } diff --git a/i18n/en.json b/i18n/en.json index 5b38e1d..0034f5c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,12 +1,12 @@ { - "@metadata": { - "authors": [ + "@metadata": { + "authors": [ "Open Tech Strategies" ] - }, + }, "activitylog-desc": "Extension to add arbitrary hooks as log messages to Special:Log", - "activitylogpage": "Activity log", - "activitylogpagetext": "A log of acitivity specified by hooks.", + "activitylogpage": "Activity log", + "activitylogpagetext": "A log of acitivity specified by hooks.", "logentry-activitylog-activity": "$1 performed an Activity", "logentry-activitylog-simpleactivity": "$1 performed activity $4" } diff --git a/include/ActivityLogFormatter.php b/include/ActivityLogFormatter.php index 18dba7f..f027219 100644 --- a/include/ActivityLogFormatter.php +++ b/include/ActivityLogFormatter.php @@ -1,5 +1,5 @@ <?php - + class ActivityLogFormatter extends LogFormatter { protected function getActionMessage() { diff --git a/include/hooks/ActivityLogHooks.php b/include/hooks/ActivityLogHooks.php index 859edbd..b4cbe7a 100644 --- a/include/hooks/ActivityLogHooks.php +++ b/include/hooks/ActivityLogHooks.php @@ -33,7 +33,7 @@ class ActivityLogExecutor { foreach($rest as $param) { $parameters["$idx::"] = $param; } - + $entry->setParameters($parameters); $logid = $entry->insert(); -- GitLab