Commit graph

142 commits

Author SHA1 Message Date
umherirrender
15ff79312d Fixed spacing and removed unneeded parenthesis
Added spaces after/before parenthesis
Removed unneeded parenthesis around some statements
Broke a long line

Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
2013-05-17 16:12:08 +00:00
Brad Jorsch
75a9233868 (bug 47950) Fix IndexPager detection of "is first" state
IndexPager currently assumes that if an offset is supplied, then it is
not at the first entry. This is trivially false in many cases, e.g. if
the offset is an older-than date and that date is in the future.

The only way to really determine whether we're at the first entry when
an offset is supplied is to query for 1 row in the opposite direction.
This patch does just that.

Bug: 47950
Change-Id: I05fec226abb609b78a62f2a23f35d5b52a48ab1a
2013-05-01 17:09:17 -04:00
jenkins-bot
ef30e0b49d Merge "Move list generation out of TablePager::getLimitSelect()" 2013-04-26 15:20:47 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
Brian Wolff
59624e535e Only allow fields from isFieldSortable to be sorted on.
Prevents people from doing stupid things like:
https://commons.wikimedia.org/w/index.php?title=Special%3AListFiles&limit=50&user=bawolff&sort=img_description&asc=&desc=1
Which don't have indexes.

Change-Id: I7aeb89032e89283dd7dfe5d7bf12872203ca5520
2013-04-19 08:24:42 +02:00
Alexandre Emsenhuber
8413b4ba33 Move list generation out of TablePager::getLimitSelect()
Added TablePager::getLimitSelectList() to get the list of values to
show for the drop-down so that it can be used to generate a custom
<select> or to be used on a form generated with HTMLForm.

Also changed HTML generation to use XmlSelect class.

Change-Id: I13ac9f17c95445b04f3cf6feec6ae36f0b9cb03d
2013-04-18 14:59:04 +02:00
Alexandre Emsenhuber
fcdbf55b44 Fix HTML output of TablePager
- Use Html class instead of Xml
- Change some raw string to use Html class

Change-Id: If749904450a33e572716a447a40ab34342beb191
2013-04-04 19:19:22 +02: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
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
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
2013-03-11 13:15:01 -04:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
de7380b56e Change intval( User::getOption() ) to User::getIntOption()
Also changed some getOption with int or bool cast

Change-Id: Ia551a50e9de047c62be84065481fdf8c02e2ef96
2013-03-04 14:08:48 +00:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
mwalker
b5b55ec026 Fixing bug where end limit would not be calculated
In the pager object, if the query was constructed
such that the index was a fully qualified field then
the 'past the end' index reference would not get
computed.

This is because $mIndexField stores the FQ field name
but $mPastTheEndRow is indexed on the non FQ name.
Therefore a warning would be generated due to a non
existent array key.

Change-Id: I52e1cbc8f7dad07de1ba5ba3bdfa2d107dfb4d93
2012-09-26 05:04:36 +00:00
Siebrand Mazeland
8886399d83 Add missing unit of measure in inline CSS.
Change-Id: I0baceb98302d1af58270d13713b4366eda7c6dc3
2012-08-16 11:07:34 +02:00
Brian Wolff
d033fe3a5d (bug 33037) Special:newfiles treat its subpage parameter as a limit
This restores the older behaviour of Special:newfiles. This allows
people to easily include variable sized galleries via
{{Special:newfiles/12}} syntax (people could of course previously do
{{special:newfiles|limit=12}} but less people know that.

Also makes IndexPager::setLimit validate the limit in the same way
it validates the limit coming from a url, and makes it so that
calling setLimit takes precedence over its built in determine the limit
code.

p.s. This is my first commit in our great glourious git future, so
let me know if i did anything wrong

Change-Id: I7fc148e56e43b7c453a1a9559ef74b8b3119c6fe
2012-08-07 11:54:53 -07:00
Alexandre Emsenhuber
1578780002 (bug 25095) Special:Categories should also include the first relevant item when "from" is filled
Second attempt after that the first one was reverted in I119160d59c4fca0d069adef60151b30d53b582a1.

Change-Id: If301c7cac3fafbcdd6f3ff8e0e822b0db29f09a2
2012-08-02 10:10:19 +02:00
Aaron
84ce626df6 Moved getDatabase() from contribs pager to Pager class.
Change-Id: I9443ecd18cdaca614aa446b5457c837a039dafe3
2012-07-13 11:47:01 -07:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
Alexandre Emsenhuber
c0ea2e70fc No need to wrap the result of DatabaseBase::select() in a ResultWrapper object.
Change-Id: I2cceb363b4573a850a7a63c93d2ca9899e477a7f
DatabaseBase::select() already returns a ResultWrapper object, so its useless to wrap it again.
2012-07-04 10:57:57 +02:00
mlitn
c8e0ec3f4b Introduce a new hook that allows extensions to add to My Contributions
Meanwhile also:
- refactored reallyDoQuery in Pager.php, to make outside intervention possible
- extend reallyDoQuery in SpecialContributions.php, adding in the hook and composing the final results array based on the combined results of all queries added through the hook

Change-Id: Ifd63cdf1950f914a3fba1757a905385aca311eda
2012-07-03 10:48:29 -07:00
Aaron Schulz
604148f1be Revert "Introduce a new hook that allows extensions to add to My Contributions".
In formatRow(): the hook change breaks FlaggedRevs, and also $ret may not
always be defined. The patch could use some extra work.

This reverts commit 0944502d4c

This reverts commit d0131e8a19.

Change-Id: I05d980e19d99e1c461199705b04de9e307daa907
2012-06-27 21:27:32 -07:00
mlitn
0944502d4c Introduce a new hook that allows extensions to add to My Contributions
Meanwhile also:
- refactored reallyDoQuery in Pager.php, to make outside intervention possible
- extend reallyDoQuery in SpecialContributions.php, adding in the hook and composing the final results array based on the combined results of all queries added through the hook
- remain backwards compatible on method-level
- fix FakeResultWrapper::fetchRow, which (contrary to ResultWrapper::fetchRow) didn't always return an array

Change-Id: I74c3784d6d93b992d72f2db24cc29f30e458c1e3
2012-06-23 01:37:18 +02:00
Alexandre Emsenhuber
0274a2839a Use local context to get messages
Change-Id: I0cde09a0339fd05c0eb8df9b2abfbfea973f61fe
2012-06-06 22:21:49 +02:00
umherirrender
41988661e4 GROUP BY and ORDER BY supports arrays in Database class
Change-Id: Ib431b07ffa2ce6843e21536de2ff19c648e0a595
2012-05-13 00:06:48 +02:00
Alexandre Emsenhuber
d1f8640a3b Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ia45d0756cd84138da267bf1cbd1a58be7f28c6d1
2012-05-11 10:34:29 +02:00
jeroendedauw
190952379e code style tweaks
Change-Id: I992459cd740678d0eb0b2dd70de6c092d7dba67e
2012-04-05 20:29:30 +02:00
Antoine Musso
e58513eb9c (bug 34736) empty limit on special pages causes navigation issues
On special pages, the older link showed a limit='' query parameter which
made the page show nothing ('' is evalued to a limit of 0 articles).

The cause is r105809 which changed the way we interprets parameters in
wfArrayToCGI() and wfCGIToArray(). Previously, An empty string value would skip
the key, after r105809, we need to use null.
2012-02-27 10:17:01 +00:00
Siebrand Mazeland
ec4bb05069 (bug 34702) Localised parentheses are now used in more special pages. 2012-02-26 13:08:41 +00:00
Siebrand Mazeland
fa53862b3f Wow. Messy. Follow-up r112426, r112424: Fix incorrect calls. Should have been escaped() instead of escape(). 2012-02-26 12:11:35 +00:00
Siebrand Mazeland
7e7079374f Follow-up r112424: Per IAlex on IRC: Use escape() instead of plain() for improved security. 2012-02-26 12:07:21 +00:00
Siebrand Mazeland
fbe974a6f8 Follow-up r112410, r112412: Cheaper processing using plain(). 2012-02-26 11:49:01 +00:00
Siebrand Mazeland
68643f5079 (bug 34702) Use localised parentheses in Special:Contributions. 2012-02-25 20:42:08 +00:00
Jeroen De Dauw
8054075513 fix doc, this is not an array 2012-02-23 22:58:11 +00:00
Jeroen De Dauw
b996890e4e docs++ 2012-02-23 22:26:38 +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
Jeroen De Dauw
780b62663e spacing fix 2012-01-24 00:25:00 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Brion Vibber
1200ae7dae Revert r104353, r104354, r104356, r104358, r104383: changes to pagers breaking existing links as noted in CR. 2011-12-06 19:32:29 +00:00
John Du Hart
d8dd0c6507 Followup r104353, updating Special:ProtectedTitles
Adds HTML form fields for namespaces and restriction levels
Adds getVal() to HTMLForm
2011-11-28 00:31:05 +00:00
John Du Hart
54dd841a6f This is the rework I was talking about in r104318 for 1.19. Instead of having Pager subclasses build HTML forms by hand build HTMLForm into the Pager class. Much less painful, no?
This is simply a first pass, there's many more classes to convert.
2011-11-27 18:23:50 +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
Aaron Schulz
c8575ffd7a FU r101629, made Pager only call doBatchLookups() if there are rows 2011-11-02 17:33:00 +00:00
Aaron Schulz
dab142d5f0 Moved contribs rev parent ID batch query into doBatchLookups() 2011-10-20 02:26:59 +00:00
Aaron Schulz
ddaa5d800e * Added a proper Pager::doBatchLookups() function
* Made HistoryPager use a link batch via Pager::doBatchLookups()
2011-10-20 00:43:43 +00:00
Happy-melon
a73791be74 Documentation and type hinting. 2011-10-06 13:22:53 +00:00
Daniel Friesen
8ca8e37db7 More RequestContext -> IContextSource. 2011-10-02 17:42:21 +00:00
Daniel Friesen
aa6573c7ab Merge r98679 from the pageoutput branch into trunk. 2011-10-02 16:37:32 +00:00
Alexandre Emsenhuber
00b6d465f1 * Made IndexPager extend ContextSource
* Updated special pages using IndexPager or one if its subclasses to pass the context object and use it instead of global variables
* Call Linker methods statically
* Changed LogPager::getUser() to LogPager::getAuthor() to avoid conflict with ContextSource::getUser()
2011-09-20 20:00:05 +00:00