Commit graph

30 commits

Author SHA1 Message Date
Geoffrey Mon
53fa809a62 Pager class for filtering by date range
New abstract class RangeChronologicalPager to provide shared date range
filtering capability (with unit tests)

I18n msgs to use as common labels for date range inputs

Expose some ReverseChronologicalParser::getDateCond logic so we can
convert year/month date filters to datestamp date filters

Bug: T120733
Change-Id: I65fdc00368f406f5fa2492600e95e07ce442c165
2017-05-12 14:55:54 +02:00
Ed Sanders
91e49be2a7 OOUI-ificiation of TablePager nav
Depends on next OOUI release for new icons.

Bug: T163715
Change-Id: Ia750131aae52c35181209277c5b951a447db1b5a
2017-05-03 14:34:20 +01:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
Timo Tijhof
3a2a707546 Clean up remaining get_class() uses
* get_class()        -> __CLASS__ (same as self::class)
* get_called_class() -> static::class
* get_class($this)   -> static::class

Change-Id: I1888a1897ecf4548a2e5a67a942e5c080dd7e3d3
2017-03-07 22:03:47 +00:00
Aaron Schulz
e01fd44388 Move ResultWrapper subclasses to Rdbms
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
2017-03-03 00:44:41 +00:00
Kunal Mehta
a57b64436c Use wikimedia/timestamp
Bug: T100924
Depends-On: I0a067367cda6885fa45631ed7c18799d653dc9bf
Change-Id: I69ba64e364df8af089c1c918cdf32f99454e693a
2017-02-28 21:15:38 -08:00
Max Semenik
f23a964170 Fix type annotations
Change-Id: Ib72c98358b2f0b3b73b6f105adea47346373d46d
2016-12-15 14:11:12 -08:00
jenkins-bot
69ae945e8d Merge "Update weblinks in comments from HTTP to HTTPS" 2016-11-08 21:32:00 +00:00
Fomafix
202f695f67 Update weblinks in comments from HTTP to HTTPS
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.

Also update some defect links.

Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
2016-11-07 15:24:46 +01:00
Kunal Mehta
153d117b60 Don't fatal on invalid timestamps
Database::timestamp() intentionally lets errors bubble up, so catch
invalid user-provided timestamps in
ReverseChronologicalPage::getDateCond(), and avoid using an offset in
that case.

Bug: T149257
Change-Id: Ida85eb44b66e8a0166e7f68a101ff094e04b1c8e
2016-11-03 19:09:13 +00:00
Kaldari
c68c3061b6 Partially reverting I8e684f06 to restore some legacy behavior
Apparently some calls to getDateCond() expect it to not set an offset.
Also, removing some of the new tests that no longer work since they
don't pass all the required parameters. (Before I8e684f06, the year
and month were both required parameters.)

Bug: T145597
Change-Id: I3a90b3da48e49ec9723b7100a7d92146154f74e3
2016-09-13 18:32:47 -07:00
Geoffrey Mon
ae2f10b786 Add day to date filter for ReverseChronologicalPager
* ReverseChronologicalPager::getDateCond now accepts a day parameter
* Make year parameter of getDateCond optional (current year used)
* Make month parameter of getDateCond optional (end of year used)
* Tests for ReverseChronologicalPager::getDateCond

Depends-On: I587f1f4402ba2964ff23c0d4b06e41accbe05c10
Bug: T120733
Change-Id: I8e684f067d792b07137341d63cd2e54a18c51a7d
2016-09-12 07:16:40 +00:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00:00
Amir Sarabadani
efa0d7af44 Clean up array() syntax in docs, part III
Also fixing some typos here and there

Change-Id: I29c29acf87f84ba9993ba75ebf2ad8091d981574
2016-08-13 05:40:40 +04:30
Ricordisamoa
5c20a532b8 Make some TablePager methods actually protected
* getTableClass
* getNavClass
* getSortHeaderClass

Change-Id: I459ca456149635e3300c7ca7cfed4c1edc1c12b1
2016-04-09 06:37:33 +02:00
Reedy
1834ee3d8e Fix numerous class/function casing
Change-Id: I23982bfa0548c9ea3bdb432be7982f1563930715
2016-03-18 23:14:49 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Aaron Schulz
7c07943eab Update more docs and type hints to use IDatabase
Change-Id: I8c8d85b32a8aba21e14d2a2dde4c25eb509186c1
2015-10-06 18:49:52 -07:00
addshore
72bd5c9e56 Add protected getCurrentRow to TablePager
This makes unit testing TablePagers easier

Change-Id: I899ec6b056fb1f007a6caf0be320324cffe08326
2015-08-29 12:13:47 +00:00
umherirrender
393adfb169 Timestamp from Year/Month selector on forms should be wiki time
When searching for a year/month with the year/month selector on
Special:Contributions or action=history the given time should be treated
as wiki time and therefore needs adjust to UTC before search in the
Database.
This has no effect on wikis with UTC like enwiki, but for example on
dewiki with an offset from 1hour/2hour.

Change-Id: Iccd41d19a360827b9c80b66582ca0daa7ed7576c
2015-05-15 15:57:28 +02:00
Aaron Schulz
69998a7e0d Converted some profiling to scopedProfileIn
Change-Id: I63eb315155ef03d20a2d228c2be07a24baa0c278
2015-01-07 21:03:02 -08:00
umherirrender
df24b7209d Fixed spacing
- Added newline at end of file
- Removed double spaces/newlines
- Added space after if/function and parentheses/brackets
- Removed space before comma/cast
- Fixed indent of some lines

Change-Id: I29867ffdffdfb7d2b56997e9393497c7dc12f7d3
2014-09-29 20:46:19 +02:00
Kunal Mehta
25fa587753 TablePager: Use wfScript() instead of $wgScript
Change-Id: Ib12bd3dfa102dc673789c27506becc2fd8138f56
2014-09-13 07:04:34 +00:00
Bartosz Dziewoński
6a637fb0bc IndexPager: Introduce constants for values of $mDefaultDirection
I've spent several hours looking at related code and I still can't
remember which direction is 'true' and which is 'false'.

Change-Id: I58694f7a0892c986e7215f59b56b014cece8d40d
2014-09-03 19:54:34 +02:00
Bartosz Dziewoński
987a860df4 TablePager: Redo arrow icons from scratch as CSS backgrounds
Redrawn the images with SVG versions.

Intentionally did not preserve the value of the 'alt' attribute of the old
images, it doesn't seem very useful to me. Instead, added 'title'
attributes on the sort links that describe their action. This should be
more useful than the old version for both visual and aural mediums.

Bug: 69277
Change-Id: Ibaec75e81d3eb8338d911ac84d91570047f475f5
2014-08-31 00:48:45 +02:00
Bartosz Dziewoński
69a039aeeb IndexPager: Don't generate rel=first and rel=last
These values for the "rel" attribute (aliases for 'begin' and 'end',
respectively) have only appeared as proposals for the HTML4
specification, but were then explicitly dropped.

The story of them and more links are available on
<http://microformats.org/wiki/existing-rel-values> (search for
'first', 'last', 'begin', 'end'). The gist is that they were
intentionally dropped and therefore should not be used.

Change-Id: I33afd1364bf9ccf79c11a2a050ad0c4ff52c447a
2014-08-31 00:48:44 +02:00
Bartosz Dziewoński
7443cd97bf TablePager: Load images via CSS backgrounds rather than HTML <img>s
Moved files from directory: skins/common/images → resources/src/mediawiki/images
and renamed:

* arrow_disabled_last_25.png  → pager-arrow-disabled-fastforward-ltr.png
* arrow_disabled_first_25.png → pager-arrow-disabled-fastforward-rtl.png
* arrow_disabled_right_25.png → pager-arrow-disabled-forward-ltr.png
* arrow_disabled_left_25.png  → pager-arrow-disabled-forward-rtl.png
* arrow_last_25.png           → pager-arrow-fastforward-ltr.png
* arrow_first_25.png          → pager-arrow-fastforward-rtl.png
* arrow_right_25.png          → pager-arrow-forward-ltr.png
* arrow_left_25.png           → pager-arrow-forward-rtl.png

The new names are not very intuitive, but there's a mostly reasonable
system behind them and we need names like this to have them
automatically flipped for RTL styles.

Bug: 69277
Change-Id: Ica34cdd5fcc9340a94fb5e60bb34c30266953dcb
2014-08-31 00:48:44 +02:00
Bartosz Dziewoński
1683741e71 TablePager: Modernize style loading
* Create a CSS module for pager styling (table and navigation),
  pulling in existing styles for shared.css. Load it on all pages
  where the pager itself is shown.
* Build a ParserOutput object encapsulating the return HTML and
  required modules, rather than only providing the HTML. Added some
  hacks for backwards-compatibility with old-style calls and
  soft-deprecated them (there are many usages in extensions).

Other cleanup:
* Remove styles in oldshared.css, they were all overwritten by
  shared.css or by styles for .mw-datatable.
* Remove inline styles where possible, explain them where impossible.
* On SpecialListFiles, display navigation bar above the table as well
  as below (this seems to be the convention for other pages).

Change-Id: Iae976f854b96b5c61691918787c4dff7db089c28
2014-08-31 00:48:43 +02:00
Bartosz Dziewoński
7d04663398 Split includes/Pager.php
Change-Id: I67fcffca4e3de081a895deb1a285a5545940ece9
2014-08-23 14:25:02 +02:00