Commit graph

354 commits

Author SHA1 Message Date
Happy-melon
4e98714f3f Follow-up r86255: rm duplicated config list 2011-04-17 20:34:25 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Chad Horohoe
efe4525d2c Merge r81448 from REL1_17: reverting RevisionMove feature back out until somebody has the time to work on it again. Reverts r67094 and its followups in trunk: r67099, r67111, r67112, r67115, r67398, r81425, r81427 2011-04-15 23:28:13 +00:00
Chad Horohoe
c4f3fceb0b Revert r77555 and followups r77563, r77572, r78116 (merge DisableAccount to core).
Per CR at the time: this creates a nearly irreversable action that is not nearly well documented enough (even if disabled by default). 

We already have the $wgBlockDisablesLogin kludge in place for this. If we're going to do more work on this idea, it should be well thought out, not another hack.
2011-04-15 22:49:03 +00:00
Happy-melon
e47c62d497 Changes to SpecialPage: deprecate any syntax for defining pages other than $wgSpecialPage['PageName'] = 'ClassName', including SpecialRedirectToSpecial, which is ugly and nasty anyway. 2011-04-14 15:11:30 +00:00
Happy-melon
9e85c48612 Recommit r84805, but without removing UsersPager, which is actually a Good Thing to use for this class of queries. Yay for the end of global-function-based special pages in core. About fifteen left in extensions now... 2011-04-14 13:27:50 +00:00
Brion Vibber
02f82927d2 Revert r84805: broke CentralAuth by removing base UsersPager class used in other special pages 2011-04-12 17:04:56 +00:00
Daniel Friesen
3c48938f9f Instead of creating an OutputPage and then setting a context start initializing OutputPages 'with' a context and send depreciated calls to extensions directly creating OutputPage instances.
Now that we've taken care of the mess of mTitle inside OutputPage and Skin and made RequestContext track Skin instead of $wgUser we don't need the hack in SpecialPage anymore.
2011-04-04 00:37:42 +00:00
Happy-melon
a3933bbe8a Clean out some globals from SpecialPage.php 2011-04-03 23:08:16 +00:00
Happy-melon
bfdcdd1371 Follow-up r85278, r85240:
* Internalise $title in MediaWiki base class
* Fix access fatal in SpecialPage by getting the context from the MediaWiki base class rather than the OutputPage
* Fix a couple of typos in RequestContext which would have thrown errors/fatals if anyone had ever called them.
2011-04-03 21:32:50 +00:00
Daniel Friesen
c08158368c Implement the RequestContext class. Some credit to IAlex, ;) other credit for me and that plethora of bugs and hicoughs I had to deal with in impelenting it.
http://www.mediawiki.org/wiki/Requests_for_comment/Context_object (it's little different though)
2011-04-03 10:41:14 +00:00
Niklas Laxström
7d7d6cb56a Follow-up r85226, r85227: add @since annotations 2011-04-03 08:33:53 +00:00
Daniel Friesen
654abcb539 Followup r85227; Back out changes related to avoiding calls to OutputPage from includable special pages. After some re-examination we replace the OutputPage and OutputPage is coded in a way to avoid poluting global things with things like the use of header(); in set* calls, so setting things on OutputPage while in an includable special page just gets discarded. 2011-04-03 06:26:58 +00:00
Daniel Friesen
b12875c8c4 Followup r85227. Convert all IncludableSpecialPages to use context properly (they are the worse offenders), and fix some bugs related to inculudable special pages and their context. 2011-04-03 05:46:42 +00:00
Daniel Friesen
376bf1794f Start managing output and input context from special pages themselves instead of using globals. We already had a setContext, Special page implementations should be properly utalizing that data. 2011-04-03 04:36:02 +00:00
Daniel Friesen
86583c7c8f Start better utalizing OutputPage as the focal point for things related to the output of the page. Like getTitle use $out->get{User,Skin} instead of $wgUser and $wgUser->getSkin() for things where the user or skin is being used for output generation back to $out instead of using globals with bad structure. 2011-04-03 03:59:47 +00:00
Happy-melon
03cdc155b7 Topple the last bastion of global-function-based special pages. Also fix HTMLCheckField to work with GET forms. 2011-03-26 19:18:39 +00:00
Happy-melon
e943d7ed3f Update SpecialListfiles to subclass SpecialPage. Nearly there! 2011-03-26 17:50:50 +00:00
Happy-melon
97da956169 Convert SpecialListusers to subclass SpecialPage. Only two left now! 2011-03-26 16:40:57 +00:00
Happy-melon
205f6431bb Break svn blame on every single line of SpecialWatchlist.php by converting it to subclass SpecialPage and hence changing the indentation :D. SpecialInterwikiWatchlist.php is virtually a clone of this code, so make it subclass in turn and remove duplication; there is probably more that could be removed.
Only three more global-function special page implementations left.  \o/
2011-03-26 13:04:40 +00:00
Happy-melon
c5a80bfb66 Move WatchlistEditor.php to /specials since inside it is essentially a complete special page. Make it subclass SpecialPage and do all the usual stuff. Rewrite it to use HTMLForm and other exciting things, and give it a good general clean up. 2011-03-24 23:28:39 +00:00
Happy-melon
f050fabd6b Complete the trinity of blocking frontend interfaces by rewriting SpecialIpblocklist:
* Move and rename to SpecialBlockList
* Use an HTMLForm in GET mode for the options form
* Use TablePager to organise the results more nicely
* Standardise the filtration for IPs and IP ranges, so looking at blocks for a range will now also show rangeblocks which contain the range
* General tidy up
2011-03-14 16:09:44 +00:00
Happy-melon
0a8a3b452c Further massive rewrite of the blocking frontend: spin out unblocking into a new SpecialUnblock.php. This leaves IPBlockList as, astonishingly enough, a list of blocks... :D 2011-03-13 21:33:52 +00:00
Happy-melon
7805997608 Divert a river through the Augean Stables that is SpecialBlockip.php.
* Move to SpecialBlock.php, and rename class appropriately
* Complete refactor
* Use HTMLForm in block form.  This changes most of the ids and field names on the form, but allows proper validation, nicer formatting, clears up several fixmes, and is generally Better(TM).
* Spin various parts out into static functions, several of which properly belong in the backend (but Block.php is a worse mess still)
* Invert some of the block options so that every checkbox makes the block more severe (so "check to disable email" is fine, but "check to allow usertalk edit" (default true) is inverted to "check to disable usertalk edit" (default false). 
* revert r40359 (move doMassUserBlock() to core).  No one seems to be using this function, which has nothing to do with the frontend UI in SpecialBlock (it might perhaps belong in Block.php); it is pretty bespoke for CheckUser, doesn't seem to have very much utility elsewhere.
2011-03-12 21:54:35 +00:00
Ilmari Karonen
7b9aaf7832 (bug 14645) Show expensive special pages differently in miser mode on Special:SpecialPages. Patch by Jarry1250 with a few tweaks by me. Tested, saw no errors or warnings. 2011-03-09 00:06:57 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Bryan Tong Minh
5f6862c89e Add a context to SpecialPage, so that subclasses don't need globals anymore. Introduces $mRequest, $mOutput and $mFullTitle, which can be used instead of $wgRequest, $wgOut and $wgTitle. Introduces msg(), which is a wrapper around wfMessage()->title(). 2011-02-10 16:14:56 +00:00
Krinkle
cc676254a4 Small fixes
* Missing space in SpecialPage.php
* Raising z-index of .suggestions (when used in a jQuery UI modal box the suggestion list appeared behind the modal instead of on top (ui modal has z-index: 1000; )
2011-01-25 19:53:21 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Niklas Laxström
8dee564d2a rm stray tab 2011-01-11 13:46:31 +00:00
Chad Horohoe
958d82a003 Followup r68129: rename UndeleteForm to SpecialUndelete per CR. Not used in any extensions 2011-01-05 13:20:39 +00:00
X!
1d0ac4a481 Move wfCreateObject to MWFunction::newObj. This uses the ReflectionClass to
instantiate a variable-length constructor in php 5.1.3 and up, and falls
back to the old, ugly, manual method that was in the old wfCreateObject
function. The instances in the core have been replaced.
2011-01-03 02:10:05 +00:00
Happy-melon
1135821620 Follow-up r79036: update comment. 2010-12-27 00:07:41 +00:00
Happy-melon
1afaa075d3 (bug 268) add Special:PermanentLink/### as an internally-linkable redirect to index.php?oldid=###.
Also refactor SpecialPage::getRedirectQuery() to return an associative array to pass to wfArrayToCGI(), rather than bodging the query string together internally.
2010-12-27 00:03:35 +00:00
Alexandre Emsenhuber
433eee2f1b Follow-up r78786: for consistency, removed array() when there's only one item 2010-12-22 15:06:08 +00:00
Roan Kattouw
56b5aa18ed Merge querypage-work2 branch from trunk. The most relevant changes are:
* QueryPage now uses array-based query building instead of raw SQL
* Converted all QueryPage-based special pages that were using old-style wfSpecialFoo functions to new-style SpecialPage subclasses; this is possible because QueryPage is changed to extend SpecialPage
* Backward compatibility for extensions is partly preserved: getSQL() is fallen back on for QueryPage subclasses that don't implement getQueryInfo(), but getOrder() will be ignored (implement getOrderFields() instead). This also means that dual compatibility (1.18 compat and b/c with pre-1.18) is trivial

Extension changes will be merged after this commit.

These changes make it easier to write an API module for QueryPages (bug 14869); this wasn't done in the branch but will be done in trunk soon.
2010-12-22 14:16:25 +00:00
Alexandre Emsenhuber
d00a25c339 Follow-up r78695: correct class name 2010-12-21 17:41:05 +00:00
Roan Kattouw
d175a20faa Followup r78192: rather than silently ignoring calls to undefined SpecialPage methods, throw an exception 2010-12-21 17:15:25 +00:00
Roan Kattouw
fdc2dc77a3 Fix variable name in doc comment added in r78192 2010-12-13 12:44:34 +00:00
Alexandre Emsenhuber
80913b6147 Fix whitespaces 2010-12-11 20:26:14 +00:00
Alexandre Emsenhuber
3600258e80 * Converted Special:Userlogin to subclass SpecialPage
* Removed useless calls to $wgOut->setArticleRelated() and $wgOut->setRobotPolicy(), they are already handled by SpecialPage::setHeaders()
2010-12-11 17:44:57 +00:00
Alexandre Emsenhuber
11f3ca1305 * Converted Special:Search to subclass SpecialPage
* Removed useless calls to $wgOut->setArticleRelated() and $wgOut->setRobotPolicy(), they are already handled by SpecialPage::setHeaders()
2010-12-10 20:51:06 +00:00
Chad Horohoe
62d9f172ba Fix for r71961 (moved SpecialPage constructor from named to __construct()). Intercept calls to parent::SpecialPage() with __call() so we don't break people still using the old constructor. 2010-12-10 15:15:16 +00:00
Bryan Tong Minh
5127655949 white space fix v2 (follow-up r77671) 2010-12-03 19:23:12 +00:00
Bryan Tong Minh
b1448c3fb6 White space fix 2010-12-03 19:21:15 +00:00
Bryan Tong Minh
b605c6b543 Added Special:Myuploads special page that redirects to Special:Listfiles 2010-12-03 19:18:39 +00:00
Andrew Garrett
cca10f71a8 Merge DisableAccount extension into core, disabled by default because the rights are unassigned 2010-12-02 04:17:11 +00:00
Sam Reed
c14037a2e0 Fix 1 deprecated method call in SpecialPage, and 3 non static methods called statically 2010-11-28 16:04:48 +00:00
Alexandre Emsenhuber
e46dd76fc6 * (bug 25829) Special:Mypage and Special:Mytalk now forward oldid, diff and dir parameters 2010-11-08 10:15:07 +00:00
Alexandre Emsenhuber
b66caf2e6e * (bug 25713) SpecialPage::resolveAlias() now normalise spaces to underscores 2010-11-07 18:59:39 +00:00