Commit graph

91 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
Stanislav Malyshev
027972a20f Include completion search into SearchEngine
By default it still uses PrefixSearch and supports PrefixSearchBackend
but it can be deprecated and phased out and SearchEngine extensions used
instead.

New APIs:
- SearchEngine
	public function defaultPrefixSearch( $search );
	public function completionSearch( $search );
	public function completionSearchWithVariants( $search );

Search engines should override:
protected function completionSearchBackend( $search );

Bug: T121430
Change-Id: Ie78649591dff94d21b72fad8e4e5eab010a461df
2016-02-03 23:41:49 +00:00
umherirrender
345356c747 No prefix suggestion of special and media namespace on special pages
As mention in comments of I71f77c3001a12d75b901807c20115cead9c64e93 the
added prefix suggestion can get called recursive.
Avoid this by disable prefix suggestion for media and special namespace,
because a special page cannot be used on that special pages.

Follows I71f77c3001a12d75b901807c20115cead9c64e93

Change-Id: I8978e3bd0783f62bc25b32a0fdaa90361abefcf3
2015-12-13 18:39:14 +01:00
Albert221
f1d8e12c50 Resolve code invoking Title::newFromURL
Bug: T65424
Change-Id: I6c97245faccd8b34557eb3be4150867fd9b37992
2015-12-12 12:00:37 +01:00
umherirrender
95b432758c Allow auto suggestion for subpages of some special pages
The autocomplete search allows special pages to define the list of
subpages to be excepted. Fill up the function to show auto suggestion
for subpages of the following special pages:

Special:AllPages
Special:ChangeContentModel
Special:FileDuplicateSearch
Special:Movepage
Special:PageLanguage
Special:Prefixindex
Special:Recentchangeslinked
Special:Undelete

This makes it easier to navigate to this special pages with a prefilled
title/target field.

Change-Id: I71f77c3001a12d75b901807c20115cead9c64e93
2015-12-06 18:29:08 +01:00
Federico Leva
8d08910bfa Add help link for 8 more special pages
* Links can now be customised on-wiki via system message:
  e928d5bdd0
* Most help pages chosen here are good for any MediaWiki install
  and have been imported on MediaWiki.org. Their license has been
  noted in the appropriate template, only future contributions
  will be in public domain (CC-0) unless we reach old authors.
  An update/discussion was opened at the project talk:
  https://www.mediawiki.org/wiki/Project_talk:PD_help
* The 6 pages on MediaWiki.org have been marked for translation;
  import of previous translations is ongoing. 2 pages are left on Meta
  because importing translatable pages with all translation units may
  be overkill.

Bug: T45591
Change-Id: I5dd91a0b7233556f2da06b65205fee72ea65a55f
2015-05-15 11:25:27 +00:00
umherirrender
ad855f9ae0 Set relevant title on Special:RecentChangesLinked
This adds title related tabs like watch on the special page
Same as on Special:MovePage

Change-Id: I0e8ef723b44069945d4e39566225ec77b2f85e10
2014-08-13 04:44:12 +00:00
Reedy
e3825bf76d Remove duplicate override in SpecialRecentchangeslinked.php
Causes bug in FR

Change-Id: I5efa8953e6e6717ba043fa13a652f1dfcf936bf2
2014-08-12 19:48:29 +01:00
Thiemo Mättig
4c972c834b Fix messed up parameters in Recentchanges hook
Ouch. Sorry.

Bug: 68938
Bug: 68943

Change-Id: I3c02c2ff06a3e8ee02136c876276cb63de03bcc7
2014-08-01 15:41:23 +00:00
Thiemo Mättig
08fee4ce2f Fix deprecated hooks not having a non-deprecated alternative
The implementation in ChangesListSpecialPage::doMainQuery() is
dead code. It's never executed because the relevant subclasses
override the method completely without ever calling
parent::doMainQuery().

This means that the deprecation of the hooks in the subclasses
leaves us with no alternative. Which is a real problem in
Wikibase, see I27716275e966147ee26d81d8ce3f14951937e718.

The same deprecation in ChangesListSpecialPage::getCustomFilters()
works because all suclasses I'm aware of call the parent method.
But please note that extensions may still break if they do this
different. I can not checked them all.

If you want to be sure you should just revert patch
I9cceda5d2dcfc53c852c5682c466b48ad8f31202 that introduced this
non-functional hook. I'm sorry to say that but I wonder how this
passed review.

Change-Id: I7ba3ea64cb145c06011a856e5b56399da4f42339
2014-06-30 17:08:15 +02:00
Bartosz Dziewoński
a4aa71c6cf ChangesListSpecialPage: Implement two new hooks superseding 4 old ones
Old hooks (called by SpecialWatchlist, SpecialRecentChanges and
SpecialRecentChangesLinked) have been deprecated, but I'm not planning
to remove them anytime soon. (They have lots of usages in extensions
as of this writing.)

The new hooks (and their deprecated friends) are:

* ChangesListSpecialPageFilters:
  * Replaces: SpecialRecentChangesFilters and SpecialWatchlistFilters
  * The signature for this one is exactly the same as signatures for
    the other two. We might want to pass something else than $this
    here…

* ChangesListSpecialPageQuery
  * Replaces: SpecialRecentChangesQuery and SpecialWatchlistQuery
  * These hooks have wildly different signatures. The new one is a
    superset of the old ones, in a more reasonable order, with the
    addition of the name of the special page we're doing right now.

Change-Id: I9cceda5d2dcfc53c852c5682c466b48ad8f31202
2014-04-11 22:53:35 +02:00
Siebrand Mazeland
374cce86c8 Update formatting for includes/specials/
Change-Id: I478dedd0b692eae002a0ca9b0ec15cb2c357411f
2014-03-23 11:19:12 +00:00
Siebrand Mazeland
b6adafc146 Fix CodeSniffer errors and warnings
For the files touched in I06ee0f01d8 as logged at
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-strict-HEAD/7798/console

Change-Id: I811884f7a5ada4d0551552d0a2c2775d6b17b59f
2014-03-12 12:50:43 +01:00
Bartosz Dziewoński
fc20c30d20 ChangesListSpecialPage: Separate all functionality for generating feeds
I should have done it at the beginning instead of trying to
extract it from recent changes.

Same for SpecialRecentChanges and SpecialRecentChangesLinked
(subclasses).

Created a new API module for it: ApiFeedRecentChanges.
It's somewhat un-API-like and hackish, but all feed modules are.

Old URLs redirect to new ones, so this should be fully
backwards-compatible assuming sane feed reader clients.

Change-Id: I06ee0f01d896bc66545a1800b24693ce7524e433
2014-03-12 12:31:41 +01:00
Bartosz Dziewoński
b941fcb094 ChangesListSpecialPage and subclasses: Reorder functions
No functional nor cleanup changes, just reordering. This should
make further refactoring (and reviewing it) easier.

In ChangesListSpecialPage placed them in "call-graph" order
instead of somewhat randomly.

In subclasses placed ChangesListSpecialPage functions first in the
same order, feed-related things later, and internal functions last.

Change-Id: I0cccfdb7c5ecd99a92d09d835211153279d71846
2014-01-16 19:30:15 +01:00
umherirrender
65a4ae9fe9 Change Title::getInterwiki() in conditions to Title::isExternal()
Change-Id: Icce26e6194ae96f262029554e05b49117d5e112e
2014-01-02 11:59:10 +01:00
Kunal Mehta
bc798535fd Deprecate SpecialPage::getTitle
Callers should use SpecialPage::getPageTitle, which is
exactly identical.

This is so that in the future we can turn SpecialPage
into a ContextSource, which requires getTitle to return
getContext()->getTitle.

Change-Id: Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40
2013-12-24 12:53:11 -08:00
Patrick Westerhoff
51d73d9808 Integrate feed-specific setup into general setup
The special page setup was previously handled separately for feed output
to restrict the request arguments to a small subset of possible filter
options. This behavior was removed in 52b59f0685.

This makes the main difference between the normal and the feed setup that
custom filter options were not loaded for feed output. Support for custom
filter options was introduced with fcbdd58326 but did not touch the feed
setup, preventing filters from being initialized when requesting a feed
(see bug 57201).

After adding support for custom filters to the feed setup, the only
remaining difference is a different default limit, and the support for
subpage syntax for non-feed output.

This commit merges the feed setup with the standard setup.

Furthermore, in `SpecialRecentchangeslinked`, the extra argument parsing
was made also redundant with 52b59f0685.

Bug: 57201
Change-Id: Ia8ba28efb96da9df5d7252278d46ff88a143368c
2013-12-19 18:16:49 +01:00
Bartosz Dziewoński
f2e55d1273 Rename SpecialRecentchangeslinked class to SpecialRecentChangesLinked
For consistency with SpecialRecentChanges.

This introduces no incompatibilities as PHP classes are case-insensitive.

Change-Id: I5855074deed52fd7492f033c8a8fced8af647602
2013-12-18 20:00:34 +00:00
umherirrender
f5809f3031 Avoid strip markes on transcluded Special:RecentChanges[Linked]
OutputPage::wrapWikiText results in a Parser::parse call, which should
not be done recursively. Using workaround from the warning under
https://www.mediawiki.org?oldid=807703#OutputPage-.3EaddWikiText.28.29

This only was happen, when the special page has no result or for
RecentChangesLinked a bad title was given.

Bug: 56167
Change-Id: I334bc6c36800af80e311301d46c7d48be1b6a055
2013-10-31 10:41:13 +00:00
jenkins-bot
eb52fff1c4 Merge "RecentChanges, RecentChangesLinked, Watchlist: message when no items" 2013-07-01 14:31:50 +00:00
MatmaRex
e0c3170455 RecentChanges, RecentChangesLinked, Watchlist: message when no items
Use consistent message in RecentChanges, RecentChangesLinked, and
Watchlist when there are no items to be shown.

Previously RecentChanges just showed empty space and
RecentChangesLinked and Watchlist used two different messages.
Harmonized both the text and the code.

Message added: 'recentchanges-noresult'
Messages removed: 'recentchangeslinked-noresult', 'watchnochange'

Change-Id: Idf9f7a8422d9ad13dc46c69ee284b04cbbe211b7
2013-07-01 16:27:04 +02:00
jenkins-bot
db77dcc731 Merge "Add user rights 'viewmywatchlist', 'editmywatchlist'" 2013-06-26 23:19:28 +00:00
Derk-Jan Hartman
7e0072fd17 Remove unnecessary clears
This is a followup to Ibb9371ee.

Bug: 33438
Change-Id: I0b39138967f2d29d5e50db0a5990d175fcc81a8e
2013-06-26 23:53:46 +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
MatmaRex
feb4ffcf72 Don't reinvent the wheel in SpecialRecentchangeslinked::getExtraOptions
Just call parent::getExtraOptions() first and then simply add the one
additional field. The 'SpecialRecentChangesPanel' hook wasn't called
from SpecialRecentchangeslinked previously, I've wrapped the call in
an if to keep the behavior the same.

Changes this causes:
* If $wgAllowCategorizedRecentChanges is true, Recentchangeslinked
  will include the category filter form as well.
* The target filter on Recentchangeslinked will be displayed at the
  end of the form, below the tag filter.

Change-Id: I4436a63356adb1e0b0daa1aa52c179974a036fa1
2013-05-24 21:29:44 +02:00
umherirrender
e51885d86e Fixed spacing in specials folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I7873c656b16f6e905bb5abb2c2db6f6e84c11430
2013-04-20 10:20:51 +02:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
umherirrender
453264f904 fix some spacing
Change-Id: I2a59eb22bb8acf01b560507a48d6be55d9c87de7
2013-01-31 20:06:37 +00:00
umherirrender
824fad9956 fix some spacing
Change-Id: I78a97ad87e0bfe724fc851daf6ffeeed81887800
2013-01-26 19:15:35 +01:00
umherirrender
31f3f93d9f Use array for join condition
Change-Id: I52875ebd5fc67e74439faf703b8119fedd70bfc9
2013-01-19 12:20:37 +01:00
mrbluesky
bb8ae34172 (bug 28401) Make RC en RCL honour options for rss/atom
RecentChanges and RecentChangesLinked should link to atom/rss feeds using the same options as specified for the pages themselves. E.g. if somebody is looking at Special:RecentChanges&hideliu=1&namespace=1 the feed(s) should link to Special:RecentChanges&feed=atom&hideliu=1&namespace=1. All options available on RC and RCL are already supported by their feeds, except the maximum number of changes in feeds is bound by $wgFeedLimit.

Change-Id: I8fb00ccd7efdd962a8a42f0bce3eac5177e2cfbd
2012-12-16 10:34:23 +00:00
umherirrender
0c68faf403 Add RecentChange::selectFields and use it
This avoids * in SELECTs

Change-Id: I218c93f23b650e597db1ae2055dc536f2cc195a3
2012-11-08 19:25:59 +01:00
umherirrender
bcd458df61 RecentChangesLinked: 'tagfilter' option already set in parent
Inside SpecialRecentChanges::getDefaultOptions() the 'tagfilter' option
is already set, so there is no need to do it a second time.

Change-Id: If89cf65a19676a4c6efa82883544b74e08961c62
2012-10-21 17:26:23 +02:00
umherirrender
e27944217b Show tagfilter, when transclude RC special pages
This reverts bug 23293, because with tagfilter, I see no UNIQ things.

By the way, the fix for bug 23293 was not the best, because it modify
for two pages the query and for the third only the display part.

This also realign the ChangeTags::modifyDisplayQuery calls and fix the
way, SpecialNewImages gets 'ts_tags' into the select

Change-Id: I09cfa5697561970399622920214a569e9a712080
2012-08-21 17:35:13 +02:00
Alexandre Emsenhuber
647dc25fb9 Use local context to get messages
Change-Id: I3e1ded54b6effdc6aa37010952829c28581af7f3
2012-05-01 09:57:04 +02:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00:00
Sam Reed
abf0a5ceb2 Add braces
Cache result of variable calls

Minor RELEASE-NOTES-1.19 updates
2012-01-22 00:58:47 +00:00
Alexandre Emsenhuber
f8e2b347a5 * Changed OutputPage's handling of subtitles to use an array and implode it with "<br />" so that callers don't have to bother whether there's already a subtitle when adding new ones
* Make OutputPage::setSubtitle(), OutputPage::addSubtitle() and OutputPage::appendSubtitle() accept a Message object in addition to a string
* Added new method OutputPage::addSubtitle() to replace appendSubtitle() and marked it as deprecated
* Clear the subtitles when showing an error page
* Always show the subtitle from Article::viewRedirect() when showing a page; left the parameter for use in EditPage
* Make Article::setOldSubtitle() add two subtitles and has to set "display:inline;" for the three possible divs to avoid too many spacing
* Removed the six different backlink subtitles and added one new message 'backlinksubtitle' to replace them and added OutputPage::addBacklinkSubtitle() to factorise common code
* Changed EditPage's view source to show "View source for <Page>" with the same backlink in subtitle for consistency with other back links and page titles
2011-11-08 18:01:22 +00:00
Alexandre Emsenhuber
b212bace90 Per Nikerabbit's comment on r100621:
* Removed OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() and make OutputPage::setPageTitle() and OutputPage::setHTMLTitle() accept a Message object
* Updated core calls (including some that I missed last time because of non-matching case)
* Added Message::setContext() and use it in RequestContext so that I don't need to duplicate the call in OutputPage
* Yes, I'm calling $this->msg() on places and then setting the context one more time in OutputPage::setPageTitle() or OutputPage::setHTMLTitle(), but at least I won't be confused about which objects $
2011-10-27 20:23:16 +00:00
Alexandre Emsenhuber
ae45908c59 Added OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() as modified versions of OutputPage::setPageTitle() and OutputPage::setHTMLTitle() that take an message name and its parameters; updated all calls in core that can use the two new functions 2011-10-24 17:24:38 +00:00
Alexandre Emsenhuber
7d9c7fde30 * Changed Special:RecentChanges and Special:RecentChangesLinked to use the local context instead of global variables
* Added context to ChangesList
* Added new factory for ChangesList and subclasses in ChangesList::newFromContext() and modified ChangesList::newFromUser() to call it with the main context since anyway User::getSkin() return the Skin from the main context, so this won't change anything but the User::getOption() call
* Updates Special:RecentChanges and Special:Watchlist to use that new function
* Call Linker methods statically
* Use Linker::linkKnown() instead of Linker::link() where possible
* In Special:Watchlist: Use wfMessage() instead of OutputPage::addWikiMsgArray() with the third parameter
2011-07-17 09:25:50 +00:00
Sam Reed
bdc31bb9bc Change usages of $wgUser->getSkin() in special pages to use $this->getSkin()
Fix trailing whitespace
2011-07-01 02:25:19 +00:00
Sam Reed
16842c0b73 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (2/3), so hopefully reviewable in CR...
2011-06-17 16:05:05 +00:00
Sam Reed
c73746981c Param documentation updates/added 2011-05-26 19:21:50 +00:00
Mark A. Hershberger
6826aed670 w/s diff. mostly eol w/s and using only tabs of width 4 to indent. 2011-03-18 20:37:11 +00:00
Alexandre Emsenhuber
983d0b0d3e Pass the url to ChangesFeed::getFeedObject() instead of grabbing it from $wgTitle
(no use of that function in extensions)
2011-02-17 19:26:38 +00:00
Sam Reed
39c005ca79 bug 25517 Assignment in conditions should be avoided/ http://www.mediawiki.org/wiki/Manual:Coding_conventions#Assignment_expressions 2010-11-01 00:07:17 +00:00