Commit graph

53 commits

Author SHA1 Message Date
Alexandre Emsenhuber
9d00a6acc3 Misc fixes in RevisionDelete.php.
* Use Linker::linkKnown() for links to revisions, we know that the page exists and other classes might be false since they might be old revisions
* Escape the result of Language::userTimeAndDate(), just in case
* Rewrote some code to do early return instead of nested if()'s
* Define variables only when they will actually be used

Change-Id: Ie1f16029020f980abba35d6322b89c95326f107b
2012-06-07 10:44:10 +02:00
Alexandre Emsenhuber
d55ccfd4d2 Use local context to get messages and don't use implicit Message object to string conversion.
Fix for I1d391e72 (3695486) and Idb00a337 (8a73db8) plus two changes of wfMsgHtml('diff') that were already there.

Change-Id: Ie52e1060058f4d1935c991a7d0e1f651069d4ed5
2012-06-02 18:32:17 +02:00
pmolina
411b2b1c6d (bug 37185) Removed hard coded parentheses in RevisionDelete.php
Change-Id: Idb00a337fa202d653b61ddd28c32aecef3e66419
2012-06-02 13:12:36 -03:00
Alexandre Emsenhuber
aa6ba56bf4 Use local context to get messages and time formatting methods of Language class
Also pass the context to the LogFormatter instance.

Change-Id: I30d88822d8ede5c138dd5403a998dd722f950bbe
2012-05-12 23:27:22 +02:00
Alexandre Emsenhuber
e7ab34cf1d Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: If65d7313e1e05163ce6cc46d17daa310cb41888c
2012-04-28 20:41:55 +02:00
Aaron Schulz
2754304fef Added user Id sanity check to setUsernameBitfields() for bug 34755.
Change-Id: I44288d199d86045151f8184f7abaa3df886d9d99
2012-03-29 16:32:00 -07:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00:00
Alexandre Emsenhuber
61a88f8c18 Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() 2012-02-26 17:19:11 +00:00
Sam Reed
60081e9852 More __METHOD__ into db related methods 2012-02-24 17:00:52 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Antoine Musso
9bcf1b9f13 Fix some missing doc groups 2012-02-09 09:34:47 +00:00
Aaron Schulz
1a40d93949 In LogFormatter:
* Changed LogFormatter to support displaying redacting log items if the context user can see them. The default mode is still "show only public items".
* Fixed static calls to non-static getRestrictedElement() function.
* Cleaned up LogFormatter that build up vars only to then throw them away and replace them with rev-deleted placeholders.
In RevDel_LogItem:
* Use LogFormatter instead of raw LogPage::actionText call as such calls are broken and just displayed things like the string "move" (the log action name) instead of "x moved a to b: reason" and such. Fixes r96546.
2012-02-07 23:12:17 +00:00
Sam Reed
df182df59b Fix one usage of User::getSkin() in phase3 2011-12-14 12:52:20 +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
John Du Hart
93e50f7eed Following r100264, update usages in core 2011-11-16 04:37:17 +00:00
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Aaron Schulz
eac8538cd6 * Added pageJoinCond() and userJoinCond() to Revision and exposed them publicly
* Removed commented-out code
2011-10-27 19:55:00 +00:00
Aaron Schulz
976c6abcfc Fixed 'Fatal error: Cannot access protected property Revision::$mDeleted in C:\wamp\www\MW_trunk\includes\revisiondelete\RevisionDelete.php on line 146' 2011-10-26 05:12:07 +00:00
Alexandre Emsenhuber
6312e40476 * Call Linker methods statically
* Removed now-useless parameter RevisionDeleter::getLogLinks(), updated the only caller
2011-10-21 16:54:25 +00:00
Aaron Schulz
b3e0ca374d * Simplified r100286 by just using the field 'user_name' and removed the COALESCE
* Simplified contribs pager with Revision::selectFields()
2011-10-20 03:03:45 +00:00
Aaron Schulz
99984c809e JOIN to get user_name in Contributions, HistoryPage, RevisionList, RevisionDelete, and MergeHistory 2011-10-20 00:04:14 +00:00
Sam Reed
abe7663d8c Documentation
Swap a lot of "@returns" to "@return"
2011-10-13 18:44:26 +00:00
Alexandre Emsenhuber
0da17a29c3 * Added User paremeter to Revision::userCan(), Revision::userCanBitfield(), LogEventsList::userCan(), LogEventsList::userCanBitfield(), File::userCan() and its subclasses so that they can check against any user instead of always $wgUser.
* Updated callers that have a context or may use another user than $wgUser
* Revision::getUser(), Revision::getUserText(), Revision::getComment() and Revision::getText() also have a User as parameter, but it will be used only when Revision::FOR_THIS_USER is passed in the first parameter
2011-10-12 15:09:04 +00:00
Niklas Laxström
3b906b320e Improve r97239 with comments from Aaron. Also fixed another typo that was lurking there. 2011-09-16 06:23:48 +00:00
Niklas Laxström
c69761dc84 * Fixed indentation
* Fixed assumption about message keys that was no longer true
* Ping r97207
* Clarified the part about null
2011-09-16 06:15:44 +00:00
Aaron Schulz
3cc92e6e69 RevisionDeleter::getChanges() documentation cleanup 2011-09-15 21:22:11 +00:00
Daniel Friesen
391736c081 Use IContextSource instead of RequestContext inside type hints and instanceof checks. All we need is something that implements IContextSource and it's possible we may want to implement types of RequestContext that don't directly extend RequestContext but are perfectly valid to be passed to classes. 2011-09-15 15:19:49 +00:00
Niklas Laxström
a9c243b7b5 RevisionDeleter:
* Fixed comment of getChanges and made it public
* Removed getLogMessage and expandMessageArray, now unused
LogFormatter:
* Cache parsed parameters locally, since this function is going to be called few times for every log entry
DefaultSettings:
* Could not find any use of suppress/file log
LogPage:
* Removed old formatting code, now unused
WikiPage:
* Converted (suppress|delete)/delete logs to new format

Added DeleteLogFormatter, handles part of suppression log as well.
Updated messages.
This also addresses bug 18578.
2011-09-14 10:36:24 +00:00
Aaron Schulz
2d67d84549 Renamed Rev_List/Rev_Item classes to RevisionListBase/RevisionItemBase 2011-09-09 21:25:21 +00:00
Alexandre Emsenhuber
e7dc5b1691 * Changed dynamic calls to Linker methods into static ones
* Also preferably pass a Language object instead of a Skin one or boolean indicating whether it's for content. No other calls to these methods in core or extensions.
2011-07-10 18:12:11 +00:00
Aaron Schulz
026aeb8452 Fix for r91344: removed straggling instances of $this->special in item classes 2011-07-02 17:27:48 +00:00
Aaron Schulz
2b3af1695e Added filterByIds() function to Rev_List and made ID based filtering optional. It's still mandatory for RevDel_List however. 2011-07-02 09:30:55 +00:00
Aaron Schulz
1c71a6f02a Removed dead $undeletedRevisions code (useless since r87804) 2011-07-02 09:08:22 +00:00
Aaron Schulz
3e4107b171 * Added generic Rev_List revision listing class and refactored RevDelete_List stuff to use it
* Fixed bug in revdelete where all list Items where assumed to be of the same type (no longer holds since r87804). This was causing "Undefined property: stdClass::$rev_timestamp" errors for deleted revs.
* Cleaned up RevisionDeleter::getRelationType()
* Minor cleanups to SpecialRevisionDelete
2011-07-02 09:04:32 +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
Alexandre Emsenhuber
7245d8dca6 * Made Special:RevisionDelete use the local variables stored in the RequestContext object instead of global ones and removed the $skin member
* Also updated classes in includes/revisiondelete that were using the $skin member of Special:RevisionDelete
* Handle action=revisiondelete (or rather action=historysubmit&revisiondelete=1) with an Action object that sets the RequestContext object of the SpecialPage object, and in this case get the target Title object through the context instead of $wgTitle
2011-06-11 08:30:19 +00:00
Sam Reed
696100b6a9 Remove unused variables/globals
Swap while to foreach
2011-05-26 19:20:35 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Platonides
8518183d2f Even it shouldn't happen, let's remove the var_dump() from the code.
Follow up to r87804
2011-05-20 18:01:17 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Brion Vibber
0344ea9fff * (bug 21279) Special:RevisionDelete now uses revision ID for deleted-page revisions when ar_rev_id is available.
- saved Special:RevisionDelete links from before page deletion still work as-is after deletion
- old log entries for rev-delete adjustments no longer magically switch to linking to Special:RevisionDelete with archive & ar_timestamp (they remain the same, as the links continue to work)

If you call Special:RevisionDelete using the older-style &type=archive links (using ar_timestamp as id) it will still save the same form to log for now; this may be fixed later for cases where the ar_rev_id is available.

Requires FakeResultWrapper fixes from r87803.
2011-05-10 01:11:52 +00:00
Chad Horohoe
783d4e0862 Remove @static from all over the place. That's what the static keyword is for, this being PHP5 and all 2011-04-21 00:07:09 +00:00
Aaron Schulz
ac9ac287ee Do the filearchive updates too; index is there now 2011-03-12 11:51:33 +00:00
Happy-melon
b14cde3ca7 First little bit of cleaning out the Augean stables of SpecialBlockip.php: spin out the suppressUserName/unsuppressUserName functions into their own file, to keep them with the rest of the RevDel stuff. 2011-03-11 23:33:36 +00:00
Sam Reed
fb79ce2e32 More function documentation 2011-02-19 22:08:26 +00:00
Sam Reed
4530507815 More function documentation 2011-02-19 21:56:54 +00:00
Sam Reed
7341bc2f56 Fix up few remaining fixme things from r69910 2010-12-14 15:44:16 +00:00
Roan Kattouw
d9103b92f5 Followup r64047: pass static callbacks in array form, not string form 2010-12-13 16:39:48 +00:00