Commit graph

128 commits

Author SHA1 Message Date
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Aaron Schulz
7798b70e7e Define which SpecialPage classes expect write vs read mode
Bug: T123591
Change-Id: I521ebdd5e8eb8f7f4df927dc38732170aef2ac19
2016-01-14 14:40:37 -08:00
Florian
cdf10cac69 Special:Block: Disallow to add an expiry time in the past
Like the protect action, adding a block with an expiry time in the
past doesn't make any sense and should throw an error message, instead of
creating a useless block.

Bug: T123069
Change-Id: Ib168ace80ada248f0209af896ab8b8ecfac3ef29
2016-01-14 13:38:42 +00:00
jenkins-bot
0e289eae34 Merge "Add largest allowed range as parameter to block form message" 2016-01-06 18:42:17 +00:00
Gergő Tisza
e00fb51c3d Add largest allowed range as parameter to block form message
Change-Id: I17bcd5de01bb301193d849ec060fc3b5be6b14ab
2016-01-02 12:47:34 -08:00
umherirrender
3e0f3cfd43 Show user names as subpages of special pages in autocomplete search
The autocomplete search allows special pages to define the list of
subpages to be excepted. Use user names on the following special pages,
because these special pages can be called with a user name as subpage.

Special:Block
Special:Contributions
Special:DeletedContributions
Special:Emailuser
Special:Listfiles
Special:Unblock
Special:Userrights

This makes it easier to navigate to this special pages with a prefilled
user name field.

Hidden user names are always not shown, because the suggestion is cached
between priviliged user and non-priviliged user.

Change-Id: I7db575bf66caaa5136489ed99f1655673b55adaf
2015-12-29 11:49:58 +01:00
umherirrender
7fc0a99bcf Move some styles of convenience links to mediawiki.special
Moved the style of convenience links for special pages to the
mediawiki.special module to keep it out of shared.css

Change-Id: I57ba598c48f8c1ea4bca978b6bf83d157d9dad1c
2015-10-13 20:20:13 +00:00
Alex Monk
8682b8b90e Purge remaining oversight references from code
i18n change coming in a separate commit

Change-Id: I46b9311cd01e95e524587ce40dcbae62f58dc5a8
2015-09-16 18:21:44 +00:00
Bartosz Dziewoński
ca877c8796 SpecialBlock: Simplify HTMLForm submit callback handling
We can just use onSubmit() instead of our own custom stuff.
The comment stating that we can't is wrong; perhaps it used
to be correct, back when it was written.

Change-Id: Ib18fb7292a67b471e9ad13cf38038287b9bd2bd2
2015-07-27 17:14:32 +00:00
umherirrender
f32e0cdd3a Use Linker::linkKnown for some links to MediaWiki pages from navigation
The title used for Linker::link in all places are mediawiki pages, which
are known to be exists (and blue), because there are definied in en.json

Change-Id: Ib3b6e4f4f6cef059a502aaabfcfc17730b4445a6
2015-06-19 18:55:30 +02:00
jenkins-bot
fd62703d50 Merge "Fix edit link for messages in $wgForceUIMsgAsContentMsg" 2015-05-23 14:27:19 +00:00
umherirrender
e51eaf619f Fix edit link for messages in $wgForceUIMsgAsContentMsg
Some special pages or actions have a link for users with editinterface
rights to edit the message used in scroll down menu.
When the message is parsed for the scroll down menu the config
$wgForceUIMsgAsContentMsg is used, but that was not used for the edit
link.

Add a new function Message::getTitle and use it in all places in core.

Most benefit will have the edit link for MediaWiki:Licenses on
Special:Upload, because commons.wikimedia.org has that message in
$wgForceUIMsgAsContentMsg.

Change-Id: Ib800b9adcc9ae88ef53228b66838bf61d2065f0f
2015-05-15 20:38:32 +02:00
Federico Leva
e928d5bdd0 Allow to customise addHelpLink() target via system message
Method similar to SpecialPage::outputHeader() to avoid registering
tons of system messages and to have -summary and -helppage tidily
listed together in Special:AllMessages by default.

Bug: T45591
Change-Id: Ic849dde00be7379c1909a8486cf20f48c5aea5cf
2015-05-15 10:14:28 +02:00
Brad Jorsch
ac6f81d9ad Clean up handling of 'infinity'
There's a bunch of stuff that probably only works because the database
representation of infinity is actually 'infinity' on all databases
besides Oracle, and Oracle in general isn't maintained.

Generally, we should probably use 'infinity' everywhere except where
directly dealing with the database.

* Many extension callers of Language::formatExpiry() with $format !==
  true are assuming it'll return 'infinity', none are checking for
  $db->getInfinity().
* And Language::formatExpiry() would choke if passed 'infinity', despite
  callers doing this.
* And Language::formatExpiry() could be more useful for the API if we
  can override the string returned for infinity.
* As for core, Title is using Language::formatExpiry() with TS_MW which
  is going to be changing anyway. Extension callers mostly don't exist.
* Block already normalizes its mExpiry field (and ->getExpiry()),
  but some stuff is comparing it with $db->getInfinity() anyway. A few
  external users set mExpiry to $db->getInfinity(), but this is mostly
  because SpecialBlock::parseExpiryInput() returns $db->getInfinity()
  while most callers (including all extensions) are assuming 'infinity'.
* And for that matter, Block should use $db->decodeExpiry() instead of
  manually doing it, once we make that safe to call with 'infinity' for
  all the extensions passing $db->getInfinity() to Block's contructor.
* WikiPage::doUpdateRestrictions() and some of its callers are using
  $db->getInfinity(), when all the inserts using that value are using
  $db->encodeExpiry() which will convert 'infinity'.

This also cleans up a slave-lag issue I noticed in ApiBlock while
testing.

Bug: T92550
Change-Id: I5eb68c1fb6029da8289276ecf7c81330575029ef
2015-03-13 11:19:53 -04:00
JuneHyeon Bae
511525a136 Refactor out 'infinity' variants
Refactor out 'infinity' vartiant values which used in blocking and
protecting actions. This patchset adds GlobalFunction wfIsInfinity.

Bug: T68646
Change-Id: I60cc55a5bbd43c72916a1c2ea3807457d4e33765
2015-03-12 16:38:02 +00:00
jenkins-bot
5907e840cc Merge "Add top help link to MediaWiki.org in several pages via indicator" 2015-03-04 16:15:53 +00:00
Nemo bis
376c0a13df Add top help link to MediaWiki.org in several pages via indicator
All the chosen targets are translatable public domain help pages
on MediaWiki.org. Mostly special pages and actions for privileged
users for now.

Adapted from the Translate extension, credit to Niklas Laxström
(TranslateUtils::addSpecialHelpLink).

Depends on 6f5b29ff4e, whose commit
message has a typo addIndicator() instead of setIndicator().

Bug: T45591
Change-Id: I2934b1708a0d207dcf3d940264f140613646f203
2015-03-04 10:59:03 +01:00
JuneHyeon Bae
3191a0b042 Warn when user trying to block nonexistent user
Now, Special:Block/Some_User and Special:Block/No_Such_User act the
same. So show warning when user opened 'Special:Block/No_such_user'
page.

Bug: T37687
Change-Id: I60292e1016b64224a6146add58106c9028e7914c
2015-02-23 19:14:27 +00:00
umherirrender
c891ff00ed Migrate block log to new log system
This allows use of gender on Special:Log.
Old messages are kept for use in IRC.
A test was added to ensure an unchanged IRC message.

Bug: T57402
Change-Id: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
2015-02-07 21:02:10 +01:00
Legoktm
7e27759603 Merge "Make HTMLForm::formatErrors non-static to can parse message in context" 2014-12-19 16:59:27 +00:00
umherirrender
cbdc6e53fe Make HTMLForm::formatErrors non-static to can parse message in context
One call in core already called it non-static

Avoid:
[GlobalTitleFail] MessageCache::parse called by
Message::toString/Message::parseText/MessageCache::parse with no title
set

Change-Id: Ic91e715177c0a4578825640a31ec68ecba3176e0
2014-12-19 16:31:55 +01:00
Niklas Laxström
a8e049e52a Remove double escaping in Special:Block
This function is used in two extensions, which also pass it to
HtmlForm, so no underescaping there either.

Change-Id: I93325051b3a6ef8fc242437a736b5c84bda56b7d
2014-12-18 20:04:27 +00:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
jenkins-bot
e4b551ca0e Merge "Add mediawiki.userSuggest to Special:Block/Unblock/BlockList" 2014-11-27 05:20:18 +00:00
umherirrender
201702e20c Add mediawiki.userSuggest to Special:Block/Unblock/BlockList
This gives a suggestion list when typing a username

Bug: T50240
Change-Id: Ic76a3e5af22f8764023d005d76dfa563d35e5e4d
2014-11-24 20:34:04 +00:00
umherirrender
b18197dd81 Allow maxlength attribute on HTMLSelectAndOtherField
A reason on a SelectAndOtherField can have two parts, one of the scroll
down box and a free text field. The free text field is actually
unlimited.
This patch allows the maxlength on that field. To respect the concat of
the two parts, also javascript code is added, which adds a dynamic
maxlength to respect also the text from the scroll down box.

The HTMLSelectAndOtherField is only used on Special:Block,
where the maxlength attribute is now set to 255 (length of the database
field ipb_reason).

Change-Id: I5c164b41ab047e7ecf9d92db6eddcc980e2db048
2014-11-16 21:35:51 +01:00
Douglas Gardner
e8943e51ed change [[Special:Block]] to destructive
Bug: 66145
Change-Id: I1ae04e15ea8046d50a58952f627a3e7d8bd941a4
2014-10-08 00:07:58 +01:00
umherirrender
135fcc4dc7 Truncate block reason for whole multibyte characters
This applies to Special:BlockList, or to the block message shown to the
user, or API results. Log is not effected, because it already truncates
on its own.

Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
2014-07-28 17:37:56 +00:00
umherirrender
768ac15c70 Cleanup some docs (includes/[s-z])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
2014-07-24 19:43:44 +02:00
umherirrender
4fba87e53d Remove tabindex from Special:Block
There is a autofocus on the Target field, which sets the start of
tabbing and than all the other fields are tabbed in the correct native
order. No need for extra tabindex order.
Tested with IE11 and FF28

Bug: 61257
Change-Id: Ic0d7365447733a23fa87c1d9b91c0f4f0f61bb39
2014-05-10 16:21:37 +00:00
umherirrender
0cb17f950a Remove B/C classes WatchlistEditor and IPBlockForm
There was a rename of these classes in 1.18
For backward compatibility the old name was extending the new one.

Change-Id: I8251fb00ced5c3b474f29b245d89d0d3fb2c14da
2014-05-10 17:08:58 +02:00
Siebrand Mazeland
ad957a706d Pass phpcs-strict on includes/specials/ (1/3)
Change-Id: Ib4522f22551ed5501e1ab7767b8f481fe6cd72d2
2014-05-09 21:33:58 +02:00
withoutaname
07382d63fe Fix typo for system message name
Change-Id: Ic23f71ab9f6018152f89f35a944c9daae9f94970
2014-05-06 08:53:25 -07:00
umherirrender
f971300427 Fixed some @params documentation (includes/[specialpage|specials])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Icf6f36bb53322b39cd5c89523dbd0e4ab10b9ec9
2014-04-19 10:16:52 +02:00
umherirrender
edc924869f Changed some comments from /// to /** @var */
Change-Id: I55b30099e4464c272c35bcabbddbb0b1364a5d65
2014-04-07 05:01:19 +00:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
jenkins-bot
5df5a5b4a8 Merge "Make autoblocks update with the parent block" 2014-01-31 18:59:09 +00:00
jenkins-bot
5de1521fc9 Merge "Allow extensions to set a custom error message in the BlockIp hook" 2014-01-20 15:22:03 +00:00
Kunal Mehta
ebdfe504d9 Allow extensions to set a custom error message in the BlockIp hook
Change-Id: I2e3773e22c78370e6ca1de49e7b0976b68d8d76b
2014-01-19 15:23:39 -08:00
umherirrender
8616f1b970 Add $wgHideUserContribLimit config setting
Replace const in Special:Block by a config setting in
DefaultSettings.php
Setting to false will disable the limit (instead of setting to a
very high number).

The value is unchanged, but now it is possible to change it in
LocalSettings.php
Also add the value to the message to give better feedback to the
performer of the action.

Change-Id: I3fd39c1c9dfa65a24a3451800dc623b40162aeb5
2014-01-18 19:33:50 +00:00
m4tx
c2c81563b4 Fix user-friendlyness of block confirmation screen
* "Confirm block" checkbox is now highlighted
* Added "check the box if you're sure" message to the errors at the top

Bug: 58783
Change-Id: I2b496d763a14fe47d7458525cb1e8bb9fa5788f6
2014-01-04 14:19:58 +01:00
Tyler Anthony Romeo
6040f3af90 Make autoblocks update with the parent block
Change SpecialBlock so that when a block already exists, it just updates
the existing block rather than deleting and inserting a new row. Also,
Block::update() was changed to update existing autoblocks with the new
block parameters.

Bug: 48813
Change-Id: I5403f6e1d7f8f07273cd5da8068b928fdddcdfc9
2014-01-03 04:06:52 -05:00
Kunal Mehta
4441875b19 Add SpecialBlockModifyFormFields hook
For extensions to add more fields to Special:Block

Change-Id: I00fbc7af1e50e1f76208a3692f152058d2d1879e
2013-12-15 16:12:10 -08:00
umherirrender
d8c1083e04 Always pass user to LogPage::addEntry
This avoids getting $wgUser in LogPage::addEntry

Change-Id: Ie105cef4ebc3d69aeaef5ee40ce6ee0087a74c69
2013-09-13 21:14:36 +02:00
Brad Jorsch
18062eb3b0 Add user rights 'viewmywatchlist', 'editmywatchlist'
These are needed for OAuth grants.

Note that, even if 'editmywatchlist' is not granted, various actions
will still allow for adding but not removing of pages.

Change-Id: Ie33446a228dd6ed0114730935c1bf65667f5ce01
2013-06-26 10:20:40 -04:00
Alexandre Emsenhuber
215894fda9 Factorise call to getSuggestedDurations() in SpecialBlock::getFormFields()
So that it is not needed to parse the message two times per request.

Change-Id: I07f48dc35f4904d043844c2a3370bc27cdd5fb45
2013-04-29 15:48:57 +02:00
Siebrand Mazeland
87ec7ad22e Update formatting
Change-Id: I0e334d910a311f067276215b6bff94cd814fc3b3
2013-04-20 10:02:19 +02:00
Siebrand Mazeland
b84a680a32 Update/add documentation
Change-Id: I897d5833cdaf7dc2d3bca5bb5551958611f22bd9
2013-04-14 21:18:38 +02:00
Siebrand Mazeland
80f4ee1720 Update code formatting
Used PHPStorm's code formatting feature, with manual checks and updates.

Change-Id: I0496eba007056bc9c4b09163387f11d6cea2a55d
2013-03-27 13:03:33 +00:00