Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265622

Change subject: Mark uploads with a change tag 'gwtoolset'
......................................................................

Mark uploads with a change tag 'gwtoolset'

Depends on I99a8fd67c84219d2715d3d88cc21500614431179, older MediaWiki
versions will simply ignore the additional parameter.

Bug: T121877
Change-Id: Iba7a69dfc8dc958605e486458358d6073f2eba63
---
M GWToolset.php
M i18n/en.json
M i18n/qqq.json
M includes/Handlers/UploadHandler.php
M includes/Hooks/Hooks.php
5 files changed, 28 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/22/265622/1

diff --git a/GWToolset.php b/GWToolset.php
index 0874c74..478aef0 100644
--- a/GWToolset.php
+++ b/GWToolset.php
@@ -97,6 +97,8 @@
 $wgHooks['CanonicalNamespaces'][] = 'GWToolset\Hooks::onCanonicalNamespaces';
 $wgHooks['UnitTestsList'][] = 'GWToolset\Hooks::onUnitTestsList';
 $wgHooks['CodeEditorGetPageLanguage'][] = 
'GWToolset\Hooks::onCodeEditorGetPageLanguage';
+$wgHooks['ListDefinedTags'][] = 'GWToolset\Hooks::onListDefinedTags';
+$wgHooks['ChangeTagsListActive'][] = 'GWToolset\Hooks::onChangeTagsListActive';
 
 // add jobs
 $wgJobClasses['gwtoolsetGWTFileBackendCleanupJob'] = 
'GWToolset\Jobs\GWTFileBackendCleanupJob';
diff --git a/i18n/en.json b/i18n/en.json
index 7241861..25fecf2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -16,6 +16,7 @@
        "group-gwtoolset": "GWToolset users",
        "group-gwtoolset-member": "{{GENDER:$1|GWToolset user}}",
        "grouppage-gwtoolset": "{{ns:project}}:GWToolset users",
+       "tag-gwtoolset": "GWToolset",
        "gwtoolset-back-to-top": "top of the page",
        "gwtoolset-batchjob-creation-failure": "Could not create a batch job of 
type \"$1\".",
        "gwtoolset-could-not-close-xml": "Could not close the XML reader.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 61ffe96..b5916c1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,6 +18,7 @@
        "group-gwtoolset": "{{doc-group|gwtoolset}}\nGWToolset is short for 
GLAMWiki Toolset.",
        "group-gwtoolset-member": "{{doc-group|gwtoolset|member}}\nGWToolset is 
short for GLAMWiki Toolset.",
        "grouppage-gwtoolset": "{{doc-group|gwtoolset|page}}\nGWToolset is 
short for GLAMWiki Toolset.",
+       "tag-gwtoolset": "Tag on GWToolset uploads",
        "gwtoolset-back-to-top": "Text for the top of the page link.",
        "gwtoolset-batchjob-creation-failure": "Message that appears when the 
extension could not create a batch job. Parameters:\n* $1 - the type of batch 
job.",
        "gwtoolset-could-not-close-xml": "Hint to the developer that appears 
when could not close the XMLReader.",
diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index 2191d4b..63eb38f 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -898,7 +898,8 @@
                        $options['comment'],
                        $options['text'],
                        $options['watch'],
-                       $this->_User
+                       $this->_User,
+                       array( 'gwtoolset' )
                );
 
                // Page may very well exist now where it previously didn't
diff --git a/includes/Hooks/Hooks.php b/includes/Hooks/Hooks.php
index 0c2b810..35a0d97 100644
--- a/includes/Hooks/Hooks.php
+++ b/includes/Hooks/Hooks.php
@@ -44,4 +44,26 @@
                }
                return true;
        }
+
+       /**
+        * Register change tags.
+        *
+        * @param array &$tags
+        * @return bool
+        */
+       public static function onListDefinedTags( &$tags ) {
+               $tags[] = 'gwtoolset';
+               return true;
+       }
+
+       /**
+        * Mark active change tags.
+        *
+        * @param array &$tags
+        * @return bool
+        */
+       public static function onChangeTagsListActive( &$tags ) {
+               $tags[] = 'gwtoolset';
+               return true;
+       }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/265622
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba7a69dfc8dc958605e486458358d6073f2eba63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to