aboutsummaryrefslogtreecommitdiffstats
path: root/includes/SpecialPage.php
Commit message (Collapse)AuthorAgeFilesLines
* Split includes/SpecialPage.phpBartosz Dziewoński2013-12-091-1481/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Separated base classes for special pages (most of them abstract) and several actual special pages, which were previously both in the same file. Added license headings, @ingroup SpecialPage and updated class doc comments; no other changes. Most classes are now in separate files (the list of changes can be seen by diffing AutoLoader.php), with three exceptions: * SpecialListAdmins and SpecialListBots (redirects to Special:ListUsers with a parameter) joined their friend in includes/specials/SpecialListusers.php. * SpecialMycontributions, SpecialMypage, SpecialMytalk, SpecialMyuploads and SpecialAllMyUploads were moved into a new file includes/specials/SpecialMyRedirectPages.php – each of them is literally ten lines of code and any changes are likely to touch them all, separate files seem impractical. * RedirectSpecialArticle and SpecialRedirectToSpecial are in one file with their parent class RedirectSpecialPage (on a side note, I filed bug 58215 to rename them to something less silly). Change-Id: Ida87238401b182924dbe169a6278588bc2fbecfd
* Revert "Add $robotPolicy parameter to SpecialPage::setHeaders()"Parent54462013-12-021-9/+3
| | | | | | | This reverts commit 8c7541da3b12d4727743ed1d3447f6ac6c3b6846. Bug: 57883 Change-Id: I582088528286ff34da164fa4457dd203f11df7ef
* Add $robotPolicy parameter to SpecialPage::setHeaders()tisane2013-12-021-3/+9
| | | | | | | Also fix docs for OutputPage::setRobotPolicy() Bug: 57764 Change-Id: I8b780ca349a2f5d18e857ed707f682d19be0054c
* Fixed spacingumherirrender2013-11-211-1/+0
| | | | | | | | - Removed trailing spaces in comments - Removed multiple empty lines - Removed space after object operator Change-Id: I9fd3256ab490c7cd2034de3fd94e6be6e6d6d8f2
* Merge "Consistently handle anonymous users on logged-in-only special pages"jenkins-bot2013-11-191-0/+43
|\
| * Consistently handle anonymous users on logged-in-only special pagesBartosz Dziewoński2013-11-191-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new helper function SpecialPage#requireLogin() to check if the current user is logged in and, if not, format an error message linking to Special:Userlogin and throw UserNotLoggedIn exception, to be handled by OutputPage later. Reused old error messages. Not all use the new parameter and they're very inconsistent, but this is a matter for another patch. Used it on 7 special pages. I don't think there are any other ones which specifically require having an account, instead of just some rights usually associated with logged-in users. * SpecialChangeEmail * SpecialChangePassword: It allows anonymous users under specific circumstances, but is logged-in-only in general. * SpecialConfirmemail * SpecialEditWatchlist * SpecialPreferences * SpecialResetTokens: It was missing the check, added it. * SpecialWatchlist Change-Id: I43ceaddb370d09784021b3fc2d5d1ff6616fef1f
* | Merge "Remove dead var"jenkins-bot2013-11-191-1/+0
|\ \
| * | Remove dead varjeroendedauw2013-11-191-1/+0
| |/ | | | | | | Change-Id: I8063140d1e5ada1487ec1509a244dd410896bbab
* | Remove no longer needed code for PHP 5.2 compatjeroendedauw2013-11-191-6/+4
| | | | | | | | Change-Id: I9c1f5f12f51274c443084da55447d12b828a9fb0
* | Remove unused exception in SpecialPage::getTitleFor and add testsaude2013-11-161-5/+1
|/ | | | | | | | | | | | The way the existing code was, it seems the exception condition was never hit, as one could enter a bogus special page title in SpecialPage::getTitleFor and it returns a Title object anyway. Some tests are also added for SpecialPage::getTitleFor(), although more refactoring my be required to truly unit test this, vs. indirectly testing other stuff via static methods. Change-Id: I6e427d047a2f8e58677eb65b50866f767078c255
* Merge "Keep returnto, returntoquery on Special:CreateAccount redirect"jenkins-bot2013-10-161-1/+1
|\
| * Keep returnto, returntoquery on Special:CreateAccount redirectMatthew Flaschen2013-10-161-1/+1
| | | | | | | | | | Bug: 55765 Change-Id: I1d05a1b91b2ac4097e09d11510d53fdfce1e0565
* | Add vform format to HTMLForm, use in PasswordResetS Page2013-10-151-1/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new 'vform' display format to HTMLForm which styles forms using it in the new compact stacked vertical format: * Applies class mw-ui-vform to the form. * Gives Submit button 'mw-ui-{button,big,block,primary}' classes and spaced block styling. * Styles the error class. * HTMLForm divs are too nested to get styling "for free", so add .mw-ui-vform-div selector to Agora CSS and apply this class to form divs (maybe not ideal fix). * HTMLCheckField nests the checkbox inside label. * Add method to setShowEmptyLabel(); vform format sets this false as it doesn't want generated HTML for empty labels adding vertical space. In FormSpecialPage, don't set the wrapper legend with its old-school line around the form if in vform style. Build new mediawiki.ui CSS with the .mw-ui-vform-div styling Special:PasswordReset requests the new styling with setDisplayFormat( 'vform' ) and turns off the wrapper legend. (This version of the patch doesn't switch the default format of HTMLForm, individual forms have to choose it.) Notes are at https://www.mediawiki.org/wiki/Agora/Engineering#HTMLForm_Issues Change-Id: Id03d185bbee990595bfc469a61163cc598fc3441
* Add Special:CreateAccount to Special:SpecialpagesThis, that and the other2013-09-191-0/+9
| | | | | Bug: 53447 Change-Id: I4423e5beeb7b72814f4ee839880ec4b835d14640
* Allow listing old files in Special:ListFiles. Add Special:AllMyUploadsBrian Wolff2013-08-281-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves the problem of new users on commons wanting a list of their files, but something like cropbot modifying it and taking it off Special:MyUploads. I'm worried this is a bit hacky to make TablePager work with two queries. If anyone has any suggestions on how to do this in a less hacky way, please say. Some notes: * This totally removes any revdeleted entries instead of dealing with them. Some future iteration can do selective deletion. * Should maybe add links to old versions of files description page somewhere. Not sure where in ui that would fit (The date maybe) (by old file description page I mean something like flagged revs filetimestamp parameter) * The latest version column should perhaps have "latest" and "old" instead of "yes" or "no" * This is slightly different from the suggestion on the bug report as it shows all revisions (instead of say just first revisions). I think showing all revisions makes more sense for the "where are my uploads" use case. Second of all, the checkbox is not on by default. Bug: 30607 Change-Id: I9e58db1f212e3bb361316c05ef32d4b9c31c6490
* Followup Idfee1b4d per TimBrad Jorsch2013-07-261-2/+2
| | | | | | | | | | | | | OAuth was going to return different values for UserIsEveryoneAllowed depending on whether OAuth headers were provided, so the bolding on Special:SpecialPages wouldn't be odd. That wasn't liked, so instead we'll only mark special pages as restricted based on $wgGroupPermissions and not what extensions might do. Also, it was suggested that if an extension can remove 'read' then the cache headers set by RawAction and the API should reflect that. Change-Id: I381553e79c5320083c6d6d9ddd5bc0b146600f9e
* Add User::isEveryoneAllowed functionBrad Jorsch2013-07-121-2/+2
| | | | | | | | | | | | | | | | | | User::groupHasPermission is used for various purposes, from checking whether it makes sense to show a "hide logged-in users" on Special:NewPages to showing different error messages in some places when 'user' or 'autoconfirmed' is allowed the action to avoiding unstubbing $wgUser to check $wgUser->isAllowed( 'read' ) in the common case where 'read' permission is granted to everyone. For the OAuth work, we need to be able to catch that last type of use without interfering with the others. This change introduces User::isEveryoneAllowed() to be used for that type of check, which both makes sure the right granted to '*' isn't revoked from any group and calls a hook to allow extensions to indicate that they might remove the right. Change-Id: Idfee1b4d0613aaf52e143164acd6022459415c49
* Update formattingSiebrand Mazeland2013-05-201-17/+24
| | | | | | | | Fixes for issues CodeSniffer complained about at https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-HEAD/9920/console for 4f98011fdd98328028d152baf27627fea0c28d3e. Change-Id: I2cc0cee6ff8260e74ad8b1721614ae16a360e68d
* Fix fatal, use Message::isDisabled()Siebrand Mazeland2013-05-201-1/+1
| | | | | | | Follow-up to dd85e115075661e9e0bb92c7f6d4ab9604efd980 where this issue was introduced. Change-Id: I46bd11ca7158d1dec4d8a3533d2607dde9928cc2
* Merge "Slight improvements to FormSpecialPage behavior."jenkins-bot2013-05-171-5/+16
|\
| * Slight improvements to FormSpecialPage behavior.parent54462013-04-221-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a default implementation of doing nothing to FormSpecialPage::onSuccess to avoid forms that don't do anything. Added a default implementation of FormSpecialPage::setParameter to store the parameter in a protected variable in case the child class wants to use it. Made FormSpecialPage::getForm first check whether the header message text exists before adding it as header text, for those forms that don't have header text. Change-Id: Ifb49c3b2f4079a5fbe379c44b63ee2dcee9eeb48
* | docs: Consistently use "since" phrasing in @deprecatedTimo Tijhof2013-05-151-1/+1
| | | | | | | | | | | | | | | | | | Most have it already: https://doc.wikimedia.org/mediawiki-core/master/php/html/deprecated.html Ran a find/replace on "@deprecated \d" to fix the odd ones. Change-Id: I5217aaf75264a0036b5426cd8536116b4bb8f535
* | phpcs: Fix WhiteSpace.LanguageConstructSpacing warningsTimo Tijhof2013-05-091-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Squiz.WhiteSpace.LanguageConstructSpacing: Language constructs must be followed by a single space; expected "require_once expression" but found "require_once(expression)" It is a keyword (e.g. like `new`, `return` and `print`). As such the parentheses don't make sense. Per our code conventions, we use a space after keywords like these. We appeared to have an unwritten exception for `require` that doesn't make sense. About 60% of require/include usage was missing the space and/or had superfluous parentheses. It is as silly as print("foo") or return("foo"), it works because keywords have no significance for whitespace between it and the expression that follows, and since experessions can be wrapped in parentheses for clarity (e.g. when doing string concatenation or mathematical operations) the parenthesis before and after basiclaly just ignored. Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
* Add doc for SpecialPage::postTextumherirrender2013-04-211-8/+32
| | | | | | | | A combined doc does not work Add some spaces to function bodys Change-Id: I98db22fe5028c97ad257ddd86524c0356881ff57
* Use wfAppendQuery to append a queryumherirrender2013-04-121-5/+4
| | | | | | | | Also pass a array to wfAppendQuery, which than does the urlencoding. Prefer a wfScript() over the global or string Change-Id: Icada534cb4c99c9441938a2e8dcbc11a142360c6
* Use HTMLForm::setWrapperLegendMsg() in FormSpecialPage::getForm()Alexandre Emsenhuber2013-04-101-1/+1
| | | | | | | There is no need to call $this->msg() directly for the fieldset legend as there is already a method in HTMLForm to do it. Change-Id: I771520ea230301b51cece685f47e6a606ad860be
* Add nosummary, minor and watchthis to Special:MyPage and friendsumherirrender2013-04-101-2/+2
| | | | | | | These are options usable with action=edit and allows better options for the inital edit view from urls or the InputBox extension. Change-Id: I696c47ddf9f29764bc8cc6136c618c56dbc2d726
* Use get_class( $this ) instead of __CLASS__ in RedirectSpecialPage::execute()Alexandre Emsenhuber2013-03-281-1/+1
| | | | | | So that it returns the subclass name and not always "RedirectSpecialPage". Change-Id: Ibee18bc75e423e8874f9254da7cec59839ba15af
* Fix case of some Title methodsAlexandre Emsenhuber2013-03-271-1/+1
| | | | Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
* Spellchecked /includes directoryYuri Astrakhan2013-03-131-6/+6
| | | | | | | | | * 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
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-20/+20
| | | | | | | | | | | 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
* Add the global correctlyPlatonides2013-03-081-0/+1
| | | | Change-Id: I03be0cf1e82fc9f8f00727bed5aca9d9d2758c2e
* Add SpecialPage::getGroupName and use itumherirrender2013-03-071-0/+50
| | | | | | | | | | | | Having all group mapping for Special:SpecialPages in the global $wgSpecialPageGroups is not a good OO style. Created a method SpecialPage::getGroupName, which than can be overridden by each subclasses to the featured group name. Added also SpecialPage::getFinalGroupName to get the groupname on Special:SpecialPages to handle the customization and to keep $wgSpecialPageGroups for b/c Change-Id: I1de3a186f0a59ec5ecb8996c5f805cf164e9637f
* Use American English spelling for behaviorSiebrand Mazeland2013-03-041-3/+3
| | | | | | Spotted in ipbreason-dropdown by Shirayuki. Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
* fix some spacingumherirrender2013-02-041-1/+1
| | | | Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
* (bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgiAlex Monk2013-01-281-3/+3
| | | | | | | Done with this command: grep wfArrayToCGI * -R -l -Z | xargs -0 -l sed -i -e 's/wfArrayToCGI/wfArrayToCgi/g' && git checkout -- HISTORY Change-Id: If7f4d4bfc199289c11c43cf519c2415a1aad1c51
* The final declaration must precede the visibility declarationumherirrender2013-01-261-1/+1
| | | | | | From phpcs Change-Id: I87592615014f39eff2a299cf578e8889afd902f7
* The abstract declaration must precede the visibility declarationumherirrender2013-01-261-3/+3
| | | | | | From phpcs Change-Id: I169c80a911ba75d64ab8a503088903ce3b8a7cca
* Allow setting a form message prefix in FormSpecialPageaude2012-12-251-3/+13
| | | | Change-Id: Iff14a626853c98190a1aba8263b8a7ec79e9b9b5
* Adding fragment support to SpecialPage::getTitleFor()Kaldari2012-12-051-2/+3
| | | | Change-Id: I2007ad5166117b90af5560fd9bb1d0ee26e45cef
* Merge "Simplify cached check in Special:SpecialPages"IAlex2012-11-101-0/+13
|\
| * Simplify cached check in Special:SpecialPagesumherirrender2012-11-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to repeat the condition from QueryPage::isCached and check the misermode self. Moved the method QueryPage::isCached to SpecialPage::isCached for easy calling. Maybe in future some special pages would get cached and define its own condition for that, so making false as default. Simplify a count and add some spaces. Change-Id: I71c9991e136f9c1a6a0123ae5305b39777d9135c
* | Fix unmatched profiling callsNiklas Laxström2012-10-271-3/+1
|/ | | | Change-Id: Iccddc819712b4f3c00e826a21fa131ed1298bb35
* Fix SpecialPage::isRestricted()Tim Starling2012-10-231-1/+1
| | | | | | | | Fix SpecialPage::isRestricted(), broken by I41edb091 (22dd67e) which inverted the group permission check. Seems to only affect Special:SpecialPages. Bug 41294. Change-Id: I8685eaeb4a688cc8e205afdb1639c08e4a2bd3da
* Update docs for return and exception infoSiebrand Mazeland2012-10-091-1/+3
| | | | | | | * Removed some inline tabs in the process. * IDE fixed some incorrect leading spaces, too. Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
* Avoid direct access to $wgGroupPermissionsumherirrender2012-10-091-2/+1
| | | | | | | Created a new method User::groupHasPermission and check also $wgRevokePermissions for the given right Change-Id: I41edb091fa35c8c68b6f95cc5fd208ea99418cdb
* Remove deprecated 1.7 SpecialPage::addPageumherirrender2012-10-051-13/+0
| | | | Change-Id: I6e68f02d1abac935bb6e1baed2d83d2f0ca76d36
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :) Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Merge "Fix for Ic74c7ba7 (c8c50eb): there's no reason to pass $this by ↵Demon2012-07-301-2/+2
|\ | | | | | | reference."
| * Fix for Ic74c7ba7 (c8c50eb): there's no reason to pass $this by reference.Alexandre Emsenhuber2012-07-081-2/+2
| | | | | | | | Change-Id: I9f00738add79c1cb552d6097dc6259101d0476cc