aboutsummaryrefslogtreecommitdiffstats
path: root/includes/CategoryViewer.php
Commit message (Collapse)AuthorAgeFilesLines
* Improve page display title handling for category pagesNiklas Laxström2018-09-101-6/+4
| | | | | | | | | | | | | | | | | | | | One use case of display title is to localise page names with Translate extension or without. While the page title changes, the subheadings still say something like "Pages in category Foo/de". Also converted one raw HTML message to be a parsed message. First version of this patch caused an issue when previewing because page title in h1 is not the same as page display title. This issue is fixed by promoting page display title as it's own member in OutputPage. Also added getUnprefixedDisplayTitle that attempts to strip away the namespace prefix to mimic Title::getText() but which works with display title instead. Bug: T43720 Bug: T46197 Change-Id: I6097a873297eb57759252fc56ad6d02c44e4c366
* Mass conversion of $wgContLang to serviceAryeh Gregor2018-08-111-10/+5
| | | | | | | Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
* Use \u{00A0} instead of   or  Fomafix2018-06-241-1/+1
| | | | | | | | | | | | | Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of the HTML/XML entities   or   or  . With the UTF-8 character the generated HTML is shorter and better to read. Also change the special value for the label in HTMLForm from   to U+00A0 but also support   for backward compability. Bug: T154300 Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
* Avoid triggering Category::refreshCounts() on HTTP GET requestsAaron Schulz2018-04-191-4/+0
| | | | | | Trigger count refreshes more often during updates instead. Change-Id: I0f4575e648109befb86a2c8f08b491a132fe56c3
* Fix inconsistent i18n escaping in category paging links.Brian Wolff2017-10-111-4/+4
| | | | | | | | | | | prev-page and next-page were being escaped when they were a link, but not when they were plain text. They should be escaped in both cases. This issue was discovered with an experimental phan plugin I'm working on. Change-Id: I6caac76299b21a54cd7cb732ad93187e3d37c99e
* Remove empty lines at begin of function, if, foreach, switchUmherirrender2017-07-011-1/+0
| | | | | | Organize phpcs.xml a bit Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
* Fix bogus field reference in Category::getCountMessage() callbackAaron Schulz2017-04-191-10/+1
| | | | | | | Follows-up 922e68f739f143. (T162121) Bug: T162941 Change-Id: I40623203e97f7155c2af171a37b1128a59415315
* Reduce contention during view-based category count refreshesAaron Schulz2017-04-051-1/+7
| | | | | Bug: T162121 Change-Id: I05b539922508d5e73979ccc8ea1c148b16dd13db
* Replaced all deprecated Linker methods with proper ones in core(1)Yuriy Shnitkovskiy2017-01-201-2/+3
| | | | Change-Id: Ie3a718dc1eae1507f8829fcf419c64c6846d2cb6
* Fix wrong class name for ImageGalleryBase in commentsdivadsn2016-12-311-1/+1
| | | | | | This change is part of change 329773. Change-Id: I2766e2ff3e64a84f52a5d7fa065bbc38280866c1
* Replace Linker::link() with LinkRenderer in includes directoryYuriy Shnitkovskiy2016-12-011-1/+5
| | | | | | | | | * CategoryViewer * OutputPage * Preferences Bug: T149346 Change-Id: I9f9bcd9b461884817e8ceefbc6757c436221e331
* Merge "Revert "Use display name in category page subheadings if provided""jenkins-bot2016-11-081-19/+6
|\
| * Revert "Use display name in category page subheadings if provided"Liuxinyu9702262016-11-081-19/+6
| | | | | | | | | | | | | | | | | | This reverts commit 8ccde8984913896d59a3c2b529768cfe74100afd. For the reason, see T43720#2531092 Bug: T149510 Change-Id: Id1ace9599642a36b333c63eaeebab0537466e7bd
* | Fix display of categoriesKunal Mehta2016-09-281-0/+2
| | | | | | | | | | | | | | | | Fixes regression from 1885a1ac462c08, which accidentally removed page_namespace and page_title as select fields. Bug: T146873 Change-Id: I19cff0cf5bc015da7311196749a9201a8e458b49
* | Reduce queries in CategoryViewer via addGoodLinkObjFromRow()Aaron Schulz2016-09-221-4/+17
| | | | | | | | Change-Id: Id782b50f166efbee6c9f8b9b263f09fc5fb5e3f2
* | Rename DB_SLAVE constant to DB_REPLICAAaron Schulz2016-09-051-1/+1
|/ | | | | | | | | 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
* Merge "Use display name in category page subheadings if provided"jenkins-bot2016-07-281-6/+19
|\
| * Use display name in category page subheadings if providedNiklas Laxström2016-06-081-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One use case of display title is to localise page names with Translate extension or without. While the page title changes, the subheadings still say something like "Pages in category Foo/de". A display title is now used if provided. There is one questionable thing what to do with namespaces and display title. In this case I think it is better to have the namespace prefix displayed (or not) according to what the site admin wants, because we cannot safely strip the namespace prefix from display title. By using the page title from OutputPage, we already get a name which is safe for HTML with no further processing. The name is passed as a raw parameter which breaks magic words (if any) trying to access the value. It is easy to fix this by using FULLPAGENAME magic word instead. Also converted one raw HTML message to be a parsed message. Bug: T43720 Change-Id: Ide7d4a9ee5c76b6360b53aefd76a2e17a139173f
* | Improving some function documentation in CategoryViewer.phpKaldari2016-07-141-9/+10
|/ | | | Change-Id: Ic4ad35d95aa157db627ef9b213007691f465c260
* Add class to div wrapper around category listsEd Sanders2016-04-291-2/+6
| | | | | | Allows VE to target non-editable content to keep on the page. Change-Id: If687b84d9ad33a0315a8ba4260bc3532691f05ed
* CategoryViewer: Do opportunistic category recounts for mismatched file ↵Bartosz Dziewoński2016-02-291-3/+6
| | | | | | | | | | | | | | counts, too There are some categories on Commons that have no files, but are recorded to have some, e.g. [1] appears to have 15 files [2]. We have logic to fix these, but it wasn't being checked for file counts (only pages and subcats). [1] https://commons.wikimedia.org/wiki/Category:Police_of_Mexico,_D._F._vehicles [2] https://commons.wikimedia.org/w/index.php?title=Category:Police_of_Mexico,_D._F._vehicles&action=info Change-Id: If88fc15347eb592e957452884c2179d7c237bd2c
* Convert all array() syntax to []Kunal Mehta2016-02-171-39/+39
| | | | | | | | | | 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
* Move category refreshes to a deferred updateAaron Schulz2015-12-291-1/+1
| | | | | Bug: T92357 Change-Id: Ic0d53c0ca01195cc5dd1f5a28602b3d4403e9fa5
* Fix whitespace issues around parenthesesVivek Ghaisas2015-06-161-1/+1
| | | | | | | Fix issues found by MediaWiki.WhiteSpace.SpaceyParenthesis sniff. Bug: T102617 Change-Id: Iec7f71e64081659fba373ec20d9d2006306a98f4
* Change labels of paging links in Category pageTina Johnson2015-03-281-2/+2
| | | | | | | | | Links 'next 200' and 'previous 200' don't always list 200 items. Hence changed the labels to 'previous page' and 'next page'. Also, added new messages for the same. Bug: T59414 Change-Id: Id5c30e92227e863acdeb3cadc132200ef2bc48c8
* CategoryView modified to use css columnsSumit Asthana2015-02-231-36/+22
| | | | | | | | | | | The categories on Category page were listed using table layout. This layout has been changed to the responsive css column structure, which is 3 column wide beyond 768px, otherwise shrinks to a single column. break-inside is used which needs some consideration, see here: http://css-tricks.com/almanac/properties/b/break-inside/ Bug: T55130 Change-Id: I437e6079b20e110047f93fb5c09aae40189f1ec0
* Allow override of page disply within CategoryViewerErik Bernhardson2015-02-201-22/+23
| | | | | | | | | | | | | | | | | | | | | | Patch adds two hook which are described in hooks.txt. This is being used to allow Flow to offer two links instead of just one that are relevant to the page that was categorized. The default output without these hooks is: <a href="...">Topic:Soiasdf90f09</a> This patch allows flow to provide context as to where this topic came from, by replacing that with: <a href="...">Topic:Soiasdf90f09</a> on <a href="...">Talk:Help</a> (Note that the names of pages within the Topic namespace will also become more friendly soonish, but outside the scope of this patch). Bug: T87793 Related-Flow-Change: Ia4f2953bcd807ba3990e762a2efcaab428c40147 Change-Id: I182e6e35fcc3a2a298e928e088579bdb22e145ff
* Properly escape the messages in CategoryViewer.phpJackmcbarn2015-02-051-12/+6
| | | | | | | This mostly reverts commit 8fe8035da20d0f5861b51f196c7443dda06301ba, and redoes it without escaping the parser output. Change-Id: I87da10e63b55c1a6c83dd497e30f65ad224e052b
* Escape unsafe messages in CategoryViewer.phpScimonster2015-01-111-6/+12
| | | | | | Bug: T85864 GCI: http://www.google-melange.com/gci/task/view/google/gci2014/5811264311787520 Change-Id: Ie59fb389b804f031b761f93f2c91a548742326ab
* Updated some try-catch statements: MWException -> ExceptionAaron Schulz2015-01-091-1/+1
| | | | Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
* Remove obvious function-level profilingChad Horohoe2015-01-071-2/+0
| | | | | | | | | | | Xhprof generates this data now. Custom profiling of various sub-function units are kept. Calls to profiler represented about 3% of page execution time on Special:BlankPage (1.5% in/out); after this change it's down to about 0.98% of page execution time. Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
* Use getHtmlCode() instead of getCode() to set the lang attributeFomafix2014-11-061-2/+2
| | | | | | | The lang attribute of HTML elements should conform to BCP 47. Bug: 72939 Change-Id: I9b4a734753af2c9dd7256eec60781553bc76edbf
* Fix for Ia9baaf0b: Make previously public variables public againStephan Gambke2014-08-291-12/+12
| | | | | | | | | | | | | Change Ia9baaf0b changed the visibility of member variables (many of which are not otherwise exposed, e.g. by a method) and by that introduced a major API change breaking extensions. This patch explicitly marks affected variables as public again, keeping the intent of the original patch of making phpcs-strict pass on includes/ directory. Bug: 67522 Bug: 67984 Change-Id: I498512b2a1e615365bb477c1fd210aaa3241ca03
* Use Config instead of globals in CategoryViewer.phpAlexandre Emsenhuber2014-08-261-4/+3
| | | | Change-Id: If33619694f1cf298b356a1761e454e274fe6aa5c
* Use config instead of globals for ImageGalleryumherirrender2014-08-221-3/+2
| | | | | | | | | | Have to pass a context to the constructor to acutally use it for settings. Also adds a RequestContext::getMainAndWarn to get a default warning, when using the main request, but it would be better to pass one. Change-Id: I1628a1790c45d44aa4239701486b8b1b7c59a0e6
* Merge "Fix off-by-one error in the "previous 200" link in category listings ↵jenkins-bot2014-07-241-1/+23
|\ | | | | | | with until=param"
| * Fix off-by-one error in the "previous 200" link in category listingsRohan2014-07-171-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | with until=param When an until parameter is given i.e. going to a previous page, the category page does the sql query in descending order. In that case, the previous page link was given an until paramter that was one more than the last needed result, since until= is interpreted as up-to but not including, unlike from=, which is starting from and including. Bug: 36964 Change-Id: I7eaf58d78136ac069a2d9122bca03f87863d2c0b
* | Fixed spacingumherirrender2014-07-201-1/+1
|/ | | | | | | | | | - use tab as indent instead of spaces - Added space after closures "function" - Added spaces around string_concat - Added newline inside empty blocks - Removed four spaces after comma Change-Id: I4425b0c6a69b36f40acfea6511b8950cf09ce2b2
* Avoid begin/commit in Category::getCountMessage()Aaron Schulz2014-06-241-1/+4
| | | | Change-Id: I64e4a859a9adf2930265e282f59816c82e1c3070
* Make phpcs-strict pass on includes/ (7/7)Siebrand Mazeland2014-05-151-36/+41
| | | | Change-Id: Ia9baaf0b3cdbe1a3c6b50ef8c4fe86fead88f909
* Follow-Ups to "Fixed some @params documentation"umherirrender2014-04-231-2/+2
| | | | | | | | | | | | Fix of inline comments of the following patch sets: Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5 Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36 Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634 Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102 Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
* Fixed some @params documentation (includes/*)umherirrender2014-04-221-27/+27
| | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I0056b4a8df243cfc0c5f25378de48f7a35170aca
* Removed unneeded spaces and colons in @param and friendsumherirrender2014-04-081-4/+4
| | | | | | | | Also swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
* Try to make a dent in CodeSniffer reports on includes/ (1)Siebrand Mazeland2014-03-231-4/+14
| | | Change-Id: Iaf3120b4e32cc5835ef9ed86236d98679e2b87fa
* Remove classes and functions deprecated in MediaWiki 1.17Siebrand Mazeland2014-01-051-9/+0
| | | | | | | | | | | | | | | | | Removed classes: - WikiError (deprecated in 1.17) - WikiXmlError (deprecated in 1.17) - WikiErrorMsg (deprecated in 1.17) Removed methods: - ApiBase::getValidNamespaces() (deprecated in 1.17) - ApiMain::setCachePrivate() (deprecated in 1.17) - ApiMain::setVaryCookie (deprecated in 1.17) - CategoryViewer::addSubcategory() (deprecated in 1.17) - WebRequest::getFileSize() (deprecated in 1.17) - WebRequest::isPathInfoBad() (deprecated in 1.17) Change-Id: Id715c2391742c136d09f5369f88d67e798842af7
* doc: Remove repetitive "Give grep a chance" phrase from commentsTimo Tijhof2013-08-291-22/+21
| | | | | | | | * Follows-up b2e2b2e016. * Minor clean up of surrounding documentation comments. * Fixed missing keys for messages in WebInstallerPage Change-Id: Iaa692064262f3c0e10cfa5e4b1ec8c86e5d02362
* Add url parameter to trigger autogenerated gallery type.Brian Wolff2013-08-231-1/+9
| | | | | | | This was requested at commons as a temporary measure to evaluate the new gallery options. Change-Id: Ib12ac8228c824533262e1896adf2618dd298f655
* Fix comments for grepshirayuki2013-08-191-2/+2
| | | | | | | | * category-*-count * node-count-exceeded-* * expansion-depth-exceeded-* Change-Id: If5a58c4f128d15969c56955af43aff76954ca94b
* Give grep a chance to find the usagesshirayuki2013-08-161-5/+4
| | | | Change-Id: I18846326539b814fa7fa93ca54117dac3572e4b0
* New more slick gallery displayBrian Wolff2013-08-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extension adds a "mode" parameter to the gallery tag, allowing different formats for the gallery tag (galleries in the ui can be controlled by a global) The added modes are: *traditional - The original gallery *nolines - Like the original, no borders, less padding *packed - All images aligned by having same height. JS also justifies the images. (I think this one is the one that will go over best with users.) *packed-overlay - like packed, but caption goes over top the image in a transloucent box. *packed-hover - like packed-overlay, but caption only visible on hover. Degrades gracefully on screen readers, and falls back to packed-overlay if you are using a touch screen. I kind of like this mode when the caption is not that important (ex a category where its just the file name). This also adds a hook to allow people to make their own gallery version. I believe there would be interest in this, as different people have done different experiments. For example: * Wikia: http://community.wikia.com/wiki/Help:Galleries,_Slideshows,_and_Sliders/wikitext * Wikinews: https://en.wikinews.org/wiki/Template:Picture_select What I would like to see for this patch, is first it gets enabled, with the default still "traditional". After about a month or two we consult with users. If feedback is positive, we change the default mode to one of the others (probably "packed"). Adds a "mode" parameter to gallery for different mode, including one 'height-constrained-overlay' which looks much more like other modern websites. Note: This makes one change to the old gallery format. It makes Nonexistent files be rendered like thumbnails (i.e. they are rendered with a little grey border). One thing I'm slightly worried about with this patch, is that I added an option to MediaTransformOutput::toHtml to override the width attribute. I'm not sure if that is the best approach, and would appreciate thoughts on that. This should be merged at the same time as Ie82c1548 Change-Id: I33462a8b52502ed76aeb163b66e3704c8618ba23