Commit graph

56 commits

Author SHA1 Message Date
Reedy
cf90246692 CreditsAction: Minor code tweaks
Change-Id: Ie3bff75102e01ed6e174ee21541b598b746a99dd
2021-10-21 20:22:35 +01:00
Alexander Vorwerk
fbe979ecd9 CreditsAction: inject UserFactory
Bug: T253078
Change-Id: I6da98794da609e34ce123291ac94742f00d767aa
2021-08-13 17:39:35 +02:00
DannyS712
09b892f722 Inject services into a bunch more actions
- CreditsAction
- MarkpatrolledAction
- RawAction
- RevertAction

Bug: T253078
Change-Id: Ie83e4e9b6220b88bd273656f21704f9c72a7b4ac
2021-07-29 02:40:09 +00:00
jenkins-bot
85e9fb15c8 Merge "Fix linking of external users from action=credits" 2021-05-26 16:20:41 +00:00
Umherirrender
6c7ecc27cf Fix linking of external users from action=credits
Use Linker::userLink which handles the external user part.

Before: In the section for "anon users", the link for external user
was linking to Special:Contributions on the local wiki, which is the
wrong link and potentially invalid.

After: Links go to the external wiki, like on action=history.

Change-Id: I75faa874daf4411a8e126a6f049b5cef9dafb2b0
2021-05-26 15:59:35 +00:00
mainframe98
a6a051340c Create mediawiki.actions.styles module for misc action styles
These are styles for actions that do not have a dedicated style module.
Given that the amount of css it contains it marginal, creating a
dedicated module for each action would be overkill.

Bug: T278504
Change-Id: Id03c81e7d5ebf179731649aa230def2e8e21ac02
2021-03-31 15:39:51 +00:00
James D. Forrester
abdc94a3da Swap out uses of User->isLoggedIn() with ->isRegistered()
Bug: T270450
Change-Id: I90ff94a553ebae9a4ef97c25c333f067f19c327d
2020-12-22 03:13:37 +00:00
Reedy
c80e4a3375 Revert "Handle interwiki usernames in action=credits"
This reverts commit 6fbddcec19.

Reason for revert: Caused T259962

Bug: T259962
Change-Id: Ida2c64d5d27b293f13c2f1f6c35672c6c0f7cb0b
2020-08-08 11:07:14 +00:00
Ammar Abdulhamid
6fbddcec19 Handle interwiki usernames in action=credits
* Also add tests for the class

Bug: T187518
Change-Id: If6e8b47842d91d6dfa023b1c9429e668dcf307e5
2020-08-06 14:55:24 -04:00
Reedy
229b2c15e8 Fix a plethora of class and function call case mismatches
Bug: T231412
Change-Id: I597a25de3294a6673424f30475760280ef209a8a
2020-05-26 14:14:46 +01:00
ArtBaltai
726a2650d3 Remove direct access to Action::page and Article::page properties
Bug: T239975
Change-Id: Id0d4d1e099edbdd67cabbed423dfff68cc48d323
2020-03-27 04:10:51 +00:00
DannyS712
65a7875aee Hard deprecate Article::getUserText
Update remaining uses in core
No uses in deployed extensions

Bug: T248291
Change-Id: Ia09e185cf00729e1275e471442d72637330e8c77
2020-03-26 01:26:11 +00:00
Reedy
c13fee87d4 Collapse some nested if statements
Change-Id: I9a97325d738d09370d29d35d5254bc0dadc57ff4
2019-04-04 19:02:22 +00:00
Brian Wolff
729be8690b Fix CreditsAction when user has no real name set but real names enabled
Change-Id: Ief347739a1231fa8bd814694bdb5b4f44ba41a77
2017-09-28 02:36:31 +00:00
Kunal Mehta
0cb2a09b6d Always put type information before variable name for @var tags
Like other tags, @var should have the type information before the
variable name.

<https://docs.phpdoc.org/references/phpdoc/tags/var.html>

Change-Id: I9eca6957b1990fa8cc687103dc02ee38af5f9086
2017-09-04 11:06:51 -07:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
Haikal Izzuddin
2c657ec256 Replace Linker::link() usage with LinkRenderer
Bug: T149346
Change-Id: Ie384566617f18ad6c3bf836b39702365d59f714d
2016-12-01 12:04:38 -08:00
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
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Kunal Mehta
f6b5b8c899 includes/actions/: Use Config instead of globals
Changed InfoAction::pageCounts to be non-static, so
it's able to access $this to get the Config object.

Also replaced instances of $wgScript with wfScript().

Change-Id: I4a6a3224e762f13640af04a73e2934b887dffedd
2014-08-13 20:34:32 +00:00
umherirrender
02dc9da399 Cleanup some docs (includes/[a-d])
- 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: I7b65fe04db431342cc58b469dc48f41a50c4e891
2014-07-24 19:42:45 +02:00
umherirrender
829886b10a Fixed some @params documentation
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.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
Reedy
d0554cd521 Revert "Update type hint for CreditsAction::getAuthor()"
This reverts commit 8a9a1eff3e.

Change-Id: I689645c812b1a28821a3d6854bc7737fc677e29e
2013-12-30 18:11:20 +00:00
Siebrand Mazeland
8a9a1eff3e Update type hint for CreditsAction::getAuthor()
This function calls $page->getUserText() and $page->getTimestamp(). These
functions are not specified in the interface Page (which actually specifies
nothing at all). Page is only implemented by WikiPage and Article. Article
does not implement getUserText() and getTimestamp(). WikiPage does.
CreditsAction::getAuthor() cannot ever be given an Article, because that
would cause a fatal error "call to undefined method".

Change-Id: I0ba29622b7307845345ce645cb63b53614aaf2ab
2013-12-30 18:03:09 +00:00
Siebrand Mazeland
6b237ebf55 Update docs for files in includes/actions/
Change-Id: I99655ad3df4bc252e3c176e4f465f5ecd615c55f
2013-11-14 20:09:19 +01:00
Siebrand Mazeland
6ea188fee5 Update formatting
Change-Id: I3cbe1f5e48730fbbe57e4b20a0c202edddc93c95
2013-11-14 12:20:43 +01:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
Siebrand Mazeland
bb06eee756 Fix PHPDoc
Was incorrectly documenting Article instead of Page. Also changed $article
to $page to avoid confusion.

Change-Id: I366769a201b5fda1c8d59119bdac908fd7727cbf
2013-04-01 18:39:01 +02:00
jenkins-bot
bbd9c84e10 Merge "Documentation improvements in includes/actions" 2013-03-12 15:11:12 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
a09a89b48e Documentation improvements in includes/actions
- Separate file and class documentation
- Add some missing class documentation
- Fix erroneous documentation

Change-Id: I35c846ad63e837165b79456dc89d330498aebf64
2013-03-05 16:39:35 +01:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02:00
Alex Monk
8945408808 (bug 40820) Revert my changes to includes/actions/CreditsAction.php
Also don't show contributors on action=info

Change-Id: I48b70b3d6b94e295aca23d506c7cce9185df4bcc
2012-10-07 15:05:26 +01:00
Alex Monk
c32c322cdd A few action=info bugfixes and enhancements.
(bug 39533) Merge action=credits into action=info.
(bug 39951) Remove redundant 'Page protection' text.
(bug 39953) Don't show irrelevant protection statuses.
(bug 39954) Use proper section headers.
(bug 39955) Link page creator and latest editor values.

Change-Id: I68308aac96b89c2aec296e2a4fa385fd1d42ab5a
2012-10-04 15:29:51 +00:00
Alexandre Emsenhuber
42e7cffd3b Use local context to get message
Change-Id: Ieeb4b20591baa3b6ceebdef55953648142622b44
2012-03-25 22:10:09 +02:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Jeroen De Dauw
8bdd53ee05 fix xss 2012-01-30 12:24:24 +00:00
Chad Horohoe
394a5ba7a7 Reduce some duplication in Action::getRestriction(), all but 2 (plus one extension) return null anyway 2011-12-06 17:40:12 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Alexandre Emsenhuber
2b3f7ae7b4 * Use local context instead of global variables, made static function in CreditsAction non-static so that they can use the context
* Added missing Action::msg() method
2011-10-07 17:49:45 +00:00
Alexandre Emsenhuber
582ad7e513 Removed useless check since the variable always exists and null would be catched by the second part 2011-09-16 19:39:53 +00:00
Robin Pepermans
d4facc4734 Do r91966 in a different way, per Brion: use unicode-bidi:embed; instead of white-space:nowrap; 2011-07-12 21:28:44 +00:00
Robin Pepermans
ac129add2b (bug 12205) Bidirectional names in action=credits are split and displayed incorrectly when wrapped to the next line. 2011-07-12 14:58:58 +00:00
Aaron Schulz
930ccf282c * Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
2011-06-29 22:09:51 +00:00
Happy-melon
d8b6ca8c0f Follow-up r90877: spot the copy-and-pasted code... :D 2011-06-27 16:22:01 +00:00
Happy-melon
93cece6d9e Follow-up r86044 CR (correct subtitle message for action=credits), and some documentation. 2011-06-27 14:05:23 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Sam Reed
50d5b074d0 And some more parameter documentation!! 2011-05-28 16:31:00 +00:00
Alexandre Emsenhuber
b345db080f I have no idea where that count() pass in r87165 2011-04-30 15:14:12 +00:00