Commit graph

96 commits

Author SHA1 Message Date
Siebrand Mazeland
7521a3ffa4 Follow-up r113939: Add divs to addWikiText(). 2012-03-17 21:19:31 +00:00
Aaron Schulz
701152e10f * r113886: use <div> instead of span to wrap element that has p tags.
* Also fixed an older instance of the same problem.
2012-03-15 17:50:55 +00:00
Sam Reed
60081e9852 More __METHOD__ into db related methods 2012-02-24 17:00:52 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Max Semenik
ad5292af60 Follow-up r110750: move constants to a different class per CR 2012-02-07 09:40:08 +00:00
Max Semenik
5dd5b558e3 Fixed r63018: made it possible to delte half-baked images w/o descriptions, clearer error message 2012-02-06 15:21:10 +00:00
Alexandre Emsenhuber
0bf95761a2 Removed useless call to Title::getArticleID(); let WikiPage::doDeleteArticle() do this itself 2012-01-03 16:20:56 +00:00
Alexandre Emsenhuber
cf0755c968 Per GrafZahl, fix for r103202: forgot to change two instances of $title to $this->title 2011-12-31 08:29:22 +00:00
Jeroen De Dauw
a62e242a30 revert r106095, fix apparently not this simple 2011-12-13 21:34:16 +00:00
Jeroen De Dauw
29e81897f9 logName -> getName 2011-12-13 21:17:32 +00:00
John Du Hart
93e50f7eed Following r100264, update usages in core 2011-11-16 04:37:17 +00:00
Alexandre Emsenhuber
c35b82a036 * Factorise common code in ImagePage::delete() and allow normal page deletion if $wgUploadMaintenance is true
* Moved $wgUploadMaintenance check after permissions and read only, so that the user doesn't think the error is temporary if he both doesn't have the permission and $wgUploadMaintenance is true
* Show normal error page when $wgUploadMaintenance and added a message for the error title
* Moved watchlist updating to FileDeletForm::execute(), it has nothing to do in doDelete() (would also be executed for api requests, etc.)
* Added $user parameter to FileDeletForm::doDelete() to pass the user doing the action
* Use WikiPage instead of Article
2011-11-15 18:08:34 +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
1e6deabe74 Cleanup to deletion related code:
* Use the new 'cannotdelete-title' message for the title on error instead of "internal error"
* Don't use OutputPage::showFatalError() but add the content by "normal" methods (related to the item above)
* Don't use the $DeleteReason and $DeleteReasonList member variables in Article and FileDeleteForm but local variables since they are not used anywhere else
* Moved down some variable definitions near where they are used so that they are only set when they will actually be used
* Same for the setPageTitle() call with 'delete-confirm' message in Article::delete() that is now in Article::confirmDelete()
* Added missing "true" as fourth parameter of WikiPage::doDeleteArticle() call that was missing
* Factorised getTitle() and getUser() calls
* Salt token with array( 'delete', 'page title' )
2011-11-03 08:55:04 +00:00
Alexandre Emsenhuber
f2d0453f9d * Made PermissionsError exception accept an optional second parameter for the description of the errors (as returned by Title::getUserPermissionsErrors())
* PermissionsError now calls OutputPage::showPermissionsErrorPage() to display the error (this is needed to make the item above work correctly)
* Removed the override of the HTML title in OutputPage::showPermissionsErrorPage() so that it shows "Permission errors - Sitename" instead of simply "Permission errors" for consistency with the other things
* Pass the error array returned by Title::getUserPermissionsErrors() to PermissionsError where available
* Converted direct calls to OutputPage::showPermissionsErrorPage() to throw an PermissionsError error instead
* Added 'action-rollback' message that will be displayed when accessing action=rollback without sufficient rights
* Changed getRestriction() in subclasses of Action to return null when they previously returned 'read' so that user rights can be check with Title::getUserPermissionsErrors()
* Reordered checks to do first user rights, then block (if needed) and finally read only (also if needed) so that users don't think the error is temporary when they both don't have right and the database is locked
2011-11-02 15:30:55 +00:00
Sam Reed
52cd34acf5 More documentation 2011-10-29 01:53:28 +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
85cfb00304 Allow LogEventsList::showLogExtract() to get a Title object instead of having to do Title -> string -> Title conversion 2011-09-24 17:52:53 +00:00
Alexandre Emsenhuber
c23ccacba3 * Call Linker methods statically
* Moved wfReadOnly() check after permissions so that users don't think the error is temporary if they and don't have permissions and the database is locked
* Removed "unexpected value of 'oldimage'" message which seems to say there's an internal error somewhere instead that the oldimage parameter is not in correct format
2011-09-23 16:15:30 +00:00
Sam Reed
ead951a4ad Couple more pieces of wikia upstreaming 2011-08-19 23:30:12 +00:00
Roan Kattouw
d8a2733757 Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are now no calls to wfExpandUrl() in core that rely on PROTO_CURRENT being the default. Also switch to using getCanonicalUrl() for.... rel="canonical" :D (I picked the right name, I KNEW IT) 2011-08-19 15:46:08 +00:00
Matěj Grabovský
da59f326d5 Follow-up r90482: escape some more wikitext 2011-06-22 14:59:05 +00:00
Krinkle
2d03eedf8a WatchAction requires token (BREAKING CHANGE)
* (bug 27655) Require token for watching/unwatching pages
* Previously done for API (bug 29070) in r88522
* As with markpatrolled, the tokens are not compatible and made that way on purpose. The API requires the POST method and uses a universal token per-session. Since the front-end is all GET based (also per convention like in markpatrolled and rollback) they are stronger salted (title / action specific)
* ajax.watch used the API already and was switched in r88554.
* The actual watching/unwatching code was moved from WatchAction->onView to WatchAction::doWatch. This was done to allow the API to do the action without needing to generate a token like the front-end needs (or having to duplicate code). It is now similar to RecentChange::markPatrolled (in that it  also a "central" function that does not care about tokens, it's called after the token-handling)
* JavaScript / Gadgets that utilize action=watch in their scripts:
** Effects should be minimal as they should be using the API (see r88522 and wikitech-l)
** If they use index.php and scrap the link from the page, they can continue to do so.

* There are links to the watch action all over the place. I've tried to catch most of them, but there may be some I miss. Migration in most cases is just a matter of adding an array item to the $query for:
 'token' => WatchAction::getWatchToken( $title, $user [, $action] )
or changing:
 Action::factory( 'watch', $article )->execute();
to:
 WatchAction::doWatch( $title, $user );

While replacing the usages in some cases an instance of Article() no longer had to be created, in others $wgUser had to be retrieved from global (which was implied before but needs to be given directly now)

Other notes:
* Article->unwatch() and Article->watch(), which were deprecated as of 1.18 and are no longer used in core, may be broken in scenarios where the Request does not have a 'token' but is making a call to $article->watch()
* Some extensions need to be fixed, I'm currently running a grep search and will fix them a.s.a.p 


[1] http://www.mediawiki.org/wiki/ResourceLoader/Default_modules?mw.user#tokens
2011-06-06 00:09:03 +00:00
Roan Kattouw
ab24b1f826 Fix regression in r84638, causing ArticleDeleteComplete to be called twice on file deletions. doDeleteArticle() already calls it, there's no need for FileDeleteForm::doDelete() to call it again 2011-06-02 15:42:23 +00:00
Sam Reed
8e80b8c3c1 Tidy up some unused variables and such 2011-04-23 21:40:52 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Ryan Lane
308203304d Moving deletion hooks into doArticleDelete so that other code can sanely delete articles. Fixed other core code that was wrapping the calls with hook calls. 2011-03-23 21:54:59 +00:00
Sam Reed
604ae0ca1c Update deprecated method calls
Remove some unused stuff
2010-10-31 16:20:48 +00:00
Chad Horohoe
cc6a650bf8 Refactor GAID_FOR_UPDATE into Title::GAID_FOR_UPDATE. Yay less file-scope code (extensions will follow) 2010-09-30 19:13:25 +00:00
Platonides
5f4494499b Follow up r32776.
$log->addEntry got added an extra indentation, which was wrong.
Functionality was right. It goes *outside* the if
2010-08-29 19:11:23 +00:00
Sam Reed
88403ed2c5 More unused.... 2010-08-19 11:42:06 +00:00
Max Semenik
7b690a17b1 Uncommented line from r63018 2010-02-26 20:18:48 +00:00
Max Semenik
ae7912737c (bug 17560) Half-broken deletion moved image files to deletion archive without updating DB 2010-02-26 20:14:28 +00:00
Alexandre Emsenhuber
1d0d879be0 * Document a bit
* Fix some doxygen warnings
2010-01-13 21:25:03 +00:00
Raimond Spekking
7b014c2c17 Fix a Fatal: Call to a member function isLoggedIn() on a non-object in /var/www/w/includes/FileDeleteForm.php on line 115 2009-11-27 17:46:35 +00:00
Matěj Grabovský
4a099928f7 (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages even to non-logged in users 2009-11-14 11:07:46 +00:00
Raimond Spekking
ce47c67697 i18n tweak: Use 'colon-separator' instead of hardcoded colon 2009-11-02 19:06:16 +00:00
Raimond Spekking
90091addcb Partly revert r57148. The search&replace was a bit too wide. It catches a message key too. Instead of right keys only.
Needs syncing with WMF because it shows <deletedhistory> on the live site.
2009-11-02 17:12:37 +00:00
Aaron Schulz
ea1a0e5860 Bolden suppression check label as it is for non-image pages 2009-10-15 10:36:29 +00:00
Aaron Schulz
c2f7ea4d7b * Renamed deletedcontent to deletedtext
* Removed deletedrevision and used deletedhistory/deletedtext instead
2009-09-30 19:50:35 +00:00
Siebrand Mazeland
5adb6cb276 Follow-up to r51559 per CR: initialise $q to prevent PHP notice. 2009-06-07 10:34:02 +00:00
Siebrand Mazeland
88d789e939 * replace some use of deprecated makeKnownLinkObj() by link() in core
* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability
2009-06-06 22:42:48 +00:00
Alexandre Emsenhuber
8e2e5d473e Fix for r51493, r51084 and realted: use Title::makeTitle() rather than Title::newFromText() 2009-06-05 13:12:15 +00:00
Siebrand Mazeland
e17b75e76a Follow-up to r51084:
* address case sensitivity issue raised by Splarka on CR
* also change to edit link on Special:Block
2009-06-05 07:33:57 +00:00
Siebrand Mazeland
f8f8dd2cb2 Fix a usability issue on protect and [file ]delete forms. "Edit ... reasons" link now contains action=edit to save a click. 2009-05-27 20:35:16 +00:00
Andrew Garrett
0fcc017391 Fix broken calls to ArticleDelete hook. 2009-01-29 01:04:00 +00:00
Raimond Spekking
3fd4899655 Replaced some hardcoded colons with the colon-separator message 2009-01-07 22:49:54 +00:00