Commit Graph

13 Commits

Author SHA1 Message Date
Timo Tijhof
5b7e12705a Remove redundant dependency on 'mediawiki.notify'
As this extension supports MW 1.34 (and MW 1.33) in the master
branch, apply the usual ternary PHP registration and ternary
tricks.

Bug: T233676
Change-Id: I4d18bab53460b397d4f50485c4a149185a1db7b3
2020-05-28 07:27:24 +00:00
James D. Forrester
18552a7142 Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
This increases the compatibility requirement of this extension to
MediaWiki 1.33+

Bug: T232875
Change-Id: I50e652697c9d6e2886d457885b1d7b04a45f376f
2020-05-11 19:06:21 +00:00
Fomafix
0a605f40ab Use PHP syntax features from PHP 7.1
* void return type (https://wiki.php.net/rfc/void_return_type)
* Nullable type (https://wiki.php.net/rfc/nullable_types)

The parent change ensures that PHP 7.1+ is required.

This change reverts commit 8eb162020f.

Change-Id: Ifb8fc52f4b161ea89fef2c84e51e4c8f2b648a49
2020-01-20 13:49:55 +00:00
Fomafix
5fda459531 Remove URL parameter setlang from history when language is unchanged
This change allows to use the ULS language changer without getting a
dialog for restoring the old language.

This change requires that the module is also loaded in this case.

Change-Id: Ie5169e986d0362034ede122b0bc29ce7a4aa481e
2019-12-19 20:32:25 +01:00
Fomafix
8eb162020f Remove type hints which are not supported by PHP 7.0
ULS currently supports MediaWiki 1.32+ which supports PHP 7.0+.

This change can reverted when the minimum required MediaWiki version is
1.34+.

Change-Id: I8115c4ae74c8aa91899899b1fb304ccbf1066ad8
2019-12-19 17:36:32 +01:00
Abijeet
ff02e63a45 Update setlang to display confirmation dialog to change language
setlang will now display a dialog to confirm with the user that
they would like to change their interface language. The preferred
language will only be updated if the user confirms.

The dialog will be displayed if the setlang parameter is present in
the query string and,

* A user is logged in, and their preferred language is not the same
  as the one passed via setlang.
* For an anonymous user if the wgULSAnonCanChangeLanguage is true,
  and the current interface language is not the same as the one
  passed via setlang.

Bug: T63115
Change-Id: I882297d99a594fd82fd0aec3b4664e8bfd1eac3a
2019-12-19 14:54:34 +00:00
Fomafix
71aefc8d4b Drop support for MediaWiki 1.31 and earlier
MediaWiki 1.33 is released. The next version MLEB 2019.07 will be
compatible with MediaWiki 1.32 and 1.33.

Change-Id: I9487706125fe84d02cb8d3fec0a10e1f10006e64
2019-07-08 22:51:08 +02:00
Fomafix
760674d965 Add type hints to used objects and arrays in hooks
Also mark only local used functions as private function.

Change-Id: I5fa27d0be492a4a936e6b30b2a16655ed3746fdd
2019-05-17 04:27:56 +00:00
Kosta Harlan
96f3515eef Use getInstanceForUpdate when saving user settings
Bug: T222300
Change-Id: Ia5e292bea544e5415ebcbbdd75705ee3b547e034
2019-05-02 04:50:50 +00:00
Timo Tijhof
6928b7ec8d Merge ext.uls.eventlogger into ext.uls.common
This could've been done longer ago (by defining ext.uls.common
in Hooks.php), but didn't notice it before.

The ext.uls.eventlogger was (if configured) loaded on all page
loads. Same as ext.uls.init (but without config condition).

ext.uls.ext is an empty shim around ext.uls.common, which is thus
also loaded on all pages. Merge this into there given has no
reason for being its own module. They are always loaded together.

Change-Id: Icdda6f27470a1d56a37275164c06541514a488a0
2019-04-17 10:52:04 +00:00
Fomafix
6fadfa783b Remove addModules( 'ext.uls.init' )
The modules 'ext.uls.init'/'ext.uls.common' provides only a library and
no own funtionality. The modules get automatically loaded through
dependencies by other modules when needed as library. An explicit
loading on all page is not necessary. For example the MediaWiki API
help page does not have any ULS elements.

Bug: T145186
Change-Id: Ida99704ca2846e6adf154255bee3148e80c957d8
2019-04-17 04:37:44 +00:00
Timo Tijhof
ea671b1f24 ext.uls.eventlogger: Use mw.track() and remove EventLogging dep
Given the code no longer uses any EventLogging methods directly,
but rather mw.track(), this means it also doesn't need to declare
any dependencies, including for older MediaWiki versions this
will work as-is.

Change-Id: I8cdcef54321d0887c509fc3683acf132c113e628
2019-04-17 04:04:01 +00:00
Reedy
f8e9ed1299 Move some more php files under includes
Change-Id: I55d536e05c50a90f0805a6dc4252cc003ee0c7bb
2019-03-02 20:11:49 +00:00