Nikerabbit has uploaded a new change for review.

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

Change subject: Use non-deprecated hooks
......................................................................

Use non-deprecated hooks

Change-Id: I170da086e7ae0efa7a034998136bd0a54140adf8
---
M CleanChanges.php
M Filters.php
D Resources.php
M extension.json
4 files changed, 36 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CleanChanges 
refs/changes/48/270248/1

diff --git a/CleanChanges.php b/CleanChanges.php
index d607f75..78e26df 100644
--- a/CleanChanges.php
+++ b/CleanChanges.php
@@ -21,7 +21,6 @@
  * @ingroup Extensions
  *
  * @author Niklas Laxström
- * @copyright Copyright © 2008-2012, Niklas Laxström
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
@@ -29,7 +28,7 @@
 $wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'Clean Changes',
-       'version' => '2014-12-29',
+       'version' => '2015-09-06',
        'author' => 'Niklas Laxström',
        'descriptionmsg' => 'cleanchanges-desc',
        'url' => 'https://www.mediawiki.org/wiki/Extension:CleanChanges',
@@ -46,9 +45,9 @@
 /* Hook into code */
 $wgHooks['FetchChangesList'][] = 'NCL::hook';
 $wgHooks['MakeGlobalVariablesScript'][] = 'NCL::addScriptVariables';
-$wgHooks['SpecialRecentChangesQuery'][] = 'CCFilters::user';
+$wgHooks['ChangesListSpecialPageQuery'][] = 'CCFilters::user';
 $wgHooks['SpecialRecentChangesPanel'][] = 'CCFilters::userForm';
-$wgHooks['SpecialRecentChangesQuery'][] = 'CCFilters::trailer';
+$wgHooks['ChangesListSpecialPageQuery'][] = 'CCFilters::trailer';
 $wgHooks['SpecialRecentChangesPanel'][] = 'CCFilters::trailerForm';
 
 $wgCCUserFilter = true;
diff --git a/Filters.php b/Filters.php
index 13e0858..bd3cdb5 100644
--- a/Filters.php
+++ b/Filters.php
@@ -3,23 +3,27 @@
 class CCFilters {
 
        /**
-        * @param array $conds
-        * @param array $tables
-        * @param array $join_conds
-        * @param FormOptions $opts
-        * @return bool
+        * Hook: ChangesListSpecialPageQuery
         */
-       public static function user( &$conds, &$tables, &$join_conds, 
FormOptions $opts ) {
+       public static function user(
+               $name,
+               &$tables,
+               &$fields,
+               &$conds,
+               &$query_options,
+               &$join_conds,
+               FormOptions $opts
+       ) {
                global $wgRequest, $wgCCUserFilter;
 
                if ( !$wgCCUserFilter ) {
-                       return true;
+                       return;
                }
 
                $opts->add( 'users', '' );
                $users = $wgRequest->getVal( 'users' );
                if ( $users === null ) {
-                       return true;
+                       return;
                }
 
                $idfilters = array();
@@ -35,20 +39,16 @@
                        $conds[] = 'rc_user IN (' . $dbr->makeList( $idfilters 
) . ')';
                        $opts->setValue( 'users', $users );
                }
-
-               return true;
        }
 
        /**
-        * @param $items array
-        * @param $opts FormOptions
-        * @return bool
+        * Hook: SpecialRecentChangesPanel
         */
        public static function userForm( &$items, FormOptions $opts ) {
                global $wgRequest, $wgCCUserFilter;
 
                if ( !$wgCCUserFilter ) {
-                       return true;
+                       return;
                }
 
                $opts->consumeValue( 'users' );
@@ -56,38 +56,40 @@
                $default = $wgRequest->getVal( 'users', '' );
                $items['users'] = Xml::inputLabelSep( wfMessage( 
'cleanchanges-users' )->text(), 'users',
                        'mw-users', 40, $default  );
-               return true;
+               return;
        }
 
        /**
-        * @param array $conds
-        * @param array $tables
-        * @param array $join_conds
-        * @param FormOptions $opts
-        * @return bool
+        * Hook: ChangesListSpecialPageQuery
         */
-       public static function trailer( &$conds, &$tables, &$join_conds, 
FormOptions $opts ) {
+       public static function trailer(
+               $name,
+               &$tables,
+               &$fields,
+               &$conds,
+               &$query_options,
+               &$join_conds,
+               FormOptions $opts
+       ) {
                global $wgRequest, $wgCCTrailerFilter;
 
                if ( !$wgCCTrailerFilter ) {
-                       return true;
+                       return;
                }
 
                $opts->add( 'trailer', '' );
                $trailer = $wgRequest->getVal( 'trailer' );
-               if ( $trailer === null ) return true;
+               if ( $trailer === null ) {
+                       return;
+               }
 
                $dbr = wfGetDB( DB_SLAVE );
                $conds[] = 'rc_title ' . $dbr->buildLike( $dbr->anyString(), 
$trailer );
                $opts->setValue( 'trailer', $trailer );
-
-               return true;
        }
 
        /**
-        * @param array $items
-        * @param FormOptions $opts
-        * @return bool
+        * Hook: SpecialRecentChangesPanel
         */
        public static function trailerForm( &$items, FormOptions $opts ) {
                /**
@@ -96,7 +98,7 @@
                global $wgLang, $wgRequest, $wgCCTrailerFilter;
 
                if ( !$wgCCTrailerFilter ) {
-                       return true;
+                       return;
                }
 
                $opts->consumeValue( 'trailer' );
@@ -127,6 +129,5 @@
                Xml::closeElement( 'select' );
 
                $items['tailer'] = array( wfMessage( 'cleanchanges-language' 
)->escaped(), $str );
-               return true;
        }
 }
diff --git a/Resources.php b/Resources.php
deleted file mode 100644
index 2a8b36c..0000000
--- a/Resources.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-global $wgResourceModules;
-
-$resourcePaths = array(
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'CleanChanges'
-);
-
-$wgResourceModules['ext.cleanchanges'] = array(
-       'scripts' => 'resources/cleanchanges.js',
-) + $resourcePaths;
-
-$wgResourceModules['ext.cleanchanges.uls'] = array(
-       'scripts' => 'resources/cleanchanges.uls.js',
-       'styles' => 'resources/cleanchanges.uls.css',
-) + $resourcePaths;
diff --git a/extension.json b/extension.json
index dde7d17..316c90e 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
        "name": "Clean Changes",
-       "version": "2014-12-29",
+       "version": "2015-09-06",
        "author": "Niklas Laxström",
        "url": "https://www.mediawiki.org/wiki/Extension:CleanChanges";,
        "descriptionmsg": "cleanchanges-desc",
@@ -21,7 +21,7 @@
                "MakeGlobalVariablesScript": [
                        "NCL::addScriptVariables"
                ],
-               "SpecialRecentChangesQuery": [
+               "ChangesListSpecialPageQuery": [
                        "CCFilters::user",
                        "CCFilters::trailer"
                ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I170da086e7ae0efa7a034998136bd0a54140adf8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CleanChanges
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to